SonarOpenCommunity / sonar-cxx

SonarQube C++ Community plugin (cxx plugin): This plugin adds C++ support to SonarQube with the focus on integration of existing C++ tools.
GNU Lesser General Public License v3.0
988 stars 363 forks source link

Cppcheck Report skipped despite configured Rules in Back End #1915

Closed p4kner closed 4 years ago

p4kner commented 4 years ago

Description

Upload of pre generated Cppcheck report is being skipped despite activated rules in quality profile.

(I am aware that this sounds similar to issue #1556 .)

Steps to reproduce the problem

  1. With the C (Community) plugin installed, create a new custom quality profile in Sonar Qube back end. Activate the the rules associated with Cppchcek for c. Assign this quality profile to a project in the back end.

  2. Run Cppcheck and generate a report as .xml version 2 on the project locally.

  3. Execute sonar-scanner on project with configured path to report via sonar.c.cppcheck.reportPath.

Expected behavior

Pre generated Cppcheck report is submitted to Sonar Qube on running of sonar-scanner and findings are visible in the back end.

Actual behavior

When running sonar-scanner on a C project which includes a report generated with Cppcheck, the report file is skipped. The given reason is that no corresponding rules are active in the quality profile of the project.

'C (Community) CppCheckSensor' skipped because there is no related rule activated in the quality profile

(If the report file is not there, or if the contents are wrong, the upload is being skipped with a different error message. Ar you would expect.)

Known workarounds

No known workaround I'm afraid.

LOG file

11:20:28.692 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
11:20:28.700 INFO: Project root configuration file: /xxx/xxx/xxx/xxx/sonar-project.properties
11:20:28.755 INFO: SonarScanner 4.4.0.2170
11:20:28.756 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
11:20:28.757 INFO: Linux 5.4.0-42-generic amd64
11:20:29.018 DEBUG: keyStore is :
11:20:29.019 DEBUG: keyStore type is : pkcs12
11:20:29.019 DEBUG: keyStore provider is :
11:20:29.020 DEBUG: init keystore
11:20:29.021 DEBUG: init keymanager of type SunX509
11:20:29.283 DEBUG: Create: /xxx/xx/.sonar/cache
11:20:29.285 INFO: User cache: /xxx/xx/.sonar/cache
11:20:29.287 DEBUG: Create: /xxx/xx/.sonar/cache/_tmp
11:20:29.291 DEBUG: Extract sonar-scanner-api-batch in temp...
11:20:29.295 DEBUG: Get bootstrap index...
11:20:29.296 DEBUG: Download: https://xxx.xxx.xxx/batch/index
11:20:29.789 DEBUG: Get bootstrap completed
11:20:29.794 DEBUG: Create isolated classloader...
11:20:29.811 DEBUG: Start temp cleaning...
11:20:29.824 DEBUG: Temp cleaning done
11:20:29.826 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
11:20:29.828 INFO: Project root configuration file: /xxx/xxx/xxx/xxx/sonar-project.properties
11:20:29.835 DEBUG: Execution getVersion
11:20:29.865 INFO: Analyzing on SonarQube server 7.9.3
11:20:29.866 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
11:20:29.868 DEBUG: Work directory: /xxx/xxx/xxx/xxx/.scannerwork
11:20:29.875 DEBUG: Execution execute
11:20:30.349 DEBUG: Community 7.9.3.33349
11:20:30.501 INFO: Load global settings
11:20:30.821 DEBUG: GET 200 https://xxx.xxx.xxx/api/settings/values.protobuf | time=315ms
11:20:30.862 INFO: Load global settings (done) | time=361ms
11:20:30.870 INFO: Server id: 243B8A4D-AXIPZIw73_Nv4fvjwgvp
11:20:30.888 INFO: User cache: /xxx/xxx/.sonar/cache
11:20:30.892 INFO: Load/download plugins
11:20:30.893 INFO: Load plugins index
11:20:30.926 DEBUG: GET 200 https://xxx.xxx.xxx/api/plugins/installed | time=33ms
11:20:31.013 INFO: Load plugins index (done) | time=120ms
11:20:31.163 INFO: Load/download plugins (done) | time=271ms
11:20:31.309 DEBUG: Plugins:
11:20:31.309 DEBUG:   * C++ (Community) 1.3.2.1853 (cxx)
11:20:31.310 DEBUG:   * SonarPython 1.14.1.3143 (python)
11:20:31.311 DEBUG:   * C (Community) 1.3.2.1853 (c)
11:20:31.311 DEBUG:   * SonarCSS 1.1.1.1010 (cssfamily)
11:20:31.312 DEBUG:   * GitHub Authentication for SonarQube 1.5.0.870 (authgithub)
11:20:31.313 DEBUG:   * JaCoCo 1.0.2.475 (jacoco)
11:20:31.313 DEBUG:   * SonarGo 1.1.1.2000 (go)
11:20:31.314 DEBUG:   * SonarKotlin 1.5.0.315 (kotlin)
11:20:31.314 DEBUG:   * Svn 1.9.0.1295 (scmsvn)
11:20:31.314 DEBUG:   * SonarJS 5.2.1.7778 (javascript)
11:20:31.315 DEBUG:   * SonarRuby 1.5.0.315 (ruby)
11:20:31.315 DEBUG:   * SonarScala 1.5.0.315 (sonarscala)
11:20:31.315 DEBUG:   * SonarC# 7.15.0.8572 (csharp)
11:20:31.315 DEBUG:   * SonarJava 5.13.1.18282 (java)
11:20:31.316 DEBUG:   * LDAP 2.2.0.608 (ldap)
11:20:31.316 DEBUG:   * SonarHTML 3.1.0.1615 (web)
11:20:31.317 DEBUG:   * Git 1.8.0.1574 (scmgit)
11:20:31.318 DEBUG:   * SonarFlex 2.5.1.1831 (flex)
11:20:31.318 DEBUG:   * SonarXML 2.0.1.2020 (xml)
11:20:31.319 DEBUG:   * SAML 2.0 Authentication for SonarQube 1.1.0.181 (authsaml)
11:20:31.320 DEBUG:   * SonarPHP 3.2.0.4868 (php)
11:20:31.322 DEBUG:   * SonarTS 1.9.0.3766 (typescript)
11:20:31.322 DEBUG:   * SonarVB 7.15.0.8572 (vbnet)
11:20:32.317 INFO: Process project properties
11:20:32.331 DEBUG: Process project properties (done) | time=14ms
11:20:32.333 INFO: Execute project builders
11:20:32.334 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
11:20:32.338 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
11:20:32.340 INFO: Execute project builders (done) | time=7ms
11:20:32.348 INFO: Project key: xxx-test1
11:20:32.348 INFO: Base dir: /xxx/xxx/xxx/xxx
11:20:32.349 INFO: Working dir: /xxx/xxx/xxx/xxx/.scannerwork
11:20:32.349 DEBUG: Project global encoding: UTF-8, default locale: en_US
11:20:32.354 DEBUG: Creating module hierarchy
11:20:32.355 DEBUG:   Init module 'xxx-test1'
11:20:32.356 DEBUG:     Base dir: /xxx/xxx/xxx/xxx
11:20:32.356 DEBUG:     Working dir: /xxx/xxx/xxx/xxx/.scannerwork
11:20:32.357 DEBUG:     Module global encoding: UTF-8, default locale: en_US
11:20:32.496 INFO: Load project settings for component key: 'xxx-test1'
11:20:32.544 DEBUG: GET 200 https://xxx.xxx.xxx/api/settings/values.protobuf?component=xxx-test1 | time=47ms
11:20:32.548 INFO: Load project settings for component key: 'xxx-test1' (done) | time=52ms
11:20:32.624 DEBUG: Available languages:
11:20:32.624 DEBUG:   * C++ (Community) => "c++"
11:20:32.625 DEBUG:   * Python => "py"
11:20:32.625 DEBUG:   * C (Community) => "c"
11:20:32.626 DEBUG:   * CSS => "css"
11:20:32.626 DEBUG:   * Go => "go"
11:20:32.627 DEBUG:   * Kotlin => "kotlin"
11:20:32.627 DEBUG:   * JavaScript => "js"
11:20:32.627 DEBUG:   * Ruby => "ruby"
11:20:32.628 DEBUG:   * Scala => "scala"
11:20:32.628 DEBUG:   * C# => "cs"
11:20:32.629 DEBUG:   * Java => "java"
11:20:32.629 DEBUG:   * HTML => "web"
11:20:32.629 DEBUG:   * JSP => "jsp"
11:20:32.630 DEBUG:   * Flex => "flex"
11:20:32.630 DEBUG:   * XML => "xml"
11:20:32.631 DEBUG:   * PHP => "php"
11:20:32.631 DEBUG:   * TypeScript => "ts"
11:20:32.631 DEBUG:   * VB.NET => "vbnet"
11:20:32.641 INFO: Load quality profiles
11:20:32.702 DEBUG: GET 200 https://xxx.xxx.xxx/api/qualityprofiles/search.protobuf?projectKey=xxx-test1 | time=60ms
11:20:32.733 INFO: Load quality profiles (done) | time=92ms
11:20:32.769 INFO: Load active rules
11:20:32.813 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIw7QvgMHOmZ8q1k1aw&ps=500&p=1 | time=41ms
11:20:32.939 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZN7c3_Nv4fvjwiIG&ps=500&p=1 | time=49ms
11:20:33.061 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXOwuSO91s7G0px-d8f2&ps=500&p=1 | time=70ms
11:20:33.129 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZN9n3_Nv4fvjwiI8&ps=500&p=1 | time=64ms
11:20:33.173 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZN-13_Nv4fvjwiJb&ps=500&p=1 | time=32ms
11:20:33.230 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOBd3_Nv4fvjwiK6&ps=500&p=1 | time=56ms
11:20:33.297 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZN_L3_Nv4fvjwiJ8&ps=500&p=1 | time=54ms
11:20:33.376 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOGL3_Nv4fvjwiRa&ps=500&p=1 | time=62ms
11:20:33.492 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOH53_Nv4fvjwiTq&ps=500&p=1 | time=57ms
11:20:33.583 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOJ33_Nv4fvjwiUz&ps=500&p=1 | time=56ms
11:20:33.841 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOMk3_Nv4fvjwiY8&ps=500&p=1 | time=233ms
11:20:34.086 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOUb3_Nv4fvjwiik&ps=500&p=1 | time=166ms
11:20:34.221 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOXy3_Nv4fvjwio1&ps=500&p=1 | time=43ms
11:20:34.270 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOaM3_Nv4fvjwip5&ps=500&p=1 | time=46ms
11:20:34.318 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZObm3_Nv4fvjwiqv&ps=500&p=1 | time=38ms
11:20:34.380 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOc93_Nv4fvjwisg&ps=500&p=1 | time=57ms
11:20:34.447 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOh-3_Nv4fvjwixA&ps=500&p=1 | time=54ms
11:20:34.496 DEBUG: GET 200 https://xxx.xxx.xxx/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt&activation=true&qprofile=AXIPZOjq3_Nv4fvjwizb&ps=500&p=1 | time=43ms
11:20:34.518 INFO: Load active rules (done) | time=1749ms
11:20:34.635 DEBUG: Declared extensions of language C++ (Community) were converted to sonar.lang.patterns.c++ : **/*.cxx,**/*.cpp,**/*.cc,**/*.hxx,**/*.hpp,**/*.hh
11:20:34.636 DEBUG: Declared extensions of language Python were converted to sonar.lang.patterns.py : **/*.py
11:20:34.636 DEBUG: Declared extensions of language C (Community) were converted to sonar.lang.patterns.c : **/*.c,**/*.h
11:20:34.637 DEBUG: Declared extensions of language CSS were converted to sonar.lang.patterns.css : **/*.css,**/*.less,**/*.scss
11:20:34.637 DEBUG: Declared extensions of language Go were converted to sonar.lang.patterns.go : **/*.go
11:20:34.638 DEBUG: Declared extensions of language Kotlin were converted to sonar.lang.patterns.kotlin : **/*.kt
11:20:34.638 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
11:20:34.639 DEBUG: Declared extensions of language Ruby were converted to sonar.lang.patterns.ruby : **/*.rb
11:20:34.639 DEBUG: Declared extensions of language Scala were converted to sonar.lang.patterns.scala : **/*.scala
11:20:34.640 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:20:34.640 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:20:34.641 DEBUG: Declared extensions of language HTML were converted to sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
11:20:34.641 DEBUG: Declared extensions of language JSP were converted to sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx
11:20:34.642 DEBUG: Declared extensions of language Flex were converted to sonar.lang.patterns.flex : **/*.as
11:20:34.642 DEBUG: Declared extensions of language XML were converted to sonar.lang.patterns.xml : **/*.disable-xml
11:20:34.643 DEBUG: Declared extensions of language PHP were converted to sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
11:20:34.643 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,**/*.tsx
11:20:34.644 DEBUG: Declared extensions of language VB.NET were converted to sonar.lang.patterns.vbnet : **/*.vb
11:20:34.647 DEBUG: Will ignore generated code
11:20:34.650 DEBUG: Will ignore generated code
11:20:34.651 INFO: Indexing files...
11:20:34.652 INFO: Project configuration:
11:20:34.685 DEBUG: readpipe [git, --version],/usr/bin
11:20:34.701 DEBUG: readpipe may return 'git version 2.17.1'
11:20:34.702 DEBUG: remaining output:

11:20:34.703 DEBUG: readpipe [git, config, --system, --edit],/usr/bin
11:20:34.707 DEBUG: readpipe may return '/etc/gitconfig'
11:20:34.708 DEBUG: remaining output:

11:20:34.885 DEBUG: 48 non excluded files in this Git repository
11:20:34.906 DEBUG: 'ccl_config_extract.xml' indexed with language 'null'
11:20:34.910 DEBUG: 'cppcheck-report.xml' indexed with language 'null'
11:20:34.919 DEBUG: 'manufacturercomponentproxydoc.cfg' indexed with language 'null'
11:20:34.921 DEBUG: 'manufacturercomponentproxy_21f5daf' indexed with language 'null'
11:20:34.924 DEBUG: 'manufacturercomponentproxy_55cfef3' indexed with language 'null'
11:20:34.927 DEBUG: 'manufacturercomponentproxy_7b2f533' indexed with language 'null'
11:20:34.931 DEBUG: 'manufacturercomponents.xml' indexed with language 'null'
11:20:34.933 DEBUG: 'manufacturercomponents.xsd' indexed with language 'null'
11:20:34.938 DEBUG: 'dox/ccl_config.dox' indexed with language 'null'
11:20:34.945 DEBUG: 'dox/usage.dox' indexed with language 'null'
11:20:34.948 DEBUG: 'Install.txt' indexed with language 'null'
11:20:34.950 DEBUG: 'Makefile' indexed with language 'null'
11:20:34.960 DEBUG: 'nicelib.supp' indexed with language 'null'
11:20:34.961 DEBUG: 'README' indexed with language 'null'
11:20:34.962 DEBUG: 'Release.txt' indexed with language 'null'
11:20:34.962 DEBUG: 'scanner-log-Old.txt' indexed with language 'null'
11:20:34.963 DEBUG: 'scanner-log.txt' indexed with language 'null'
11:20:34.964 DEBUG: 'scanner-log2.txt' indexed with language 'null'
11:20:34.965 DEBUG: 'sonar-project.properties' indexed with language 'null'
11:20:34.974 DEBUG: 'src/manufacturer.h' indexed with language 'c'
11:20:34.979 DEBUG: 'src/manufacturercomponentproxy.c' indexed with language 'c'
11:20:34.980 DEBUG: 'src/manufacturercomponentproxy.h' indexed with language 'c'
11:20:34.981 DEBUG: 'src/manufacturercomponentproxy.o' indexed with language 'null'
11:20:34.983 DEBUG: 'src/manufacturerpacket.h' indexed with language 'c'
11:20:34.984 DEBUG: 'src/manufacturerprotected.c' indexed with language 'c'
11:20:34.984 DEBUG: 'src/manufacturerprotected.h' indexed with language 'c'
11:20:34.985 DEBUG: 'src/manufacturerprotected.o' indexed with language 'null'
11:20:34.986 DEBUG: 'src/manufacturerredundant.c' indexed with language 'c'
11:20:34.987 DEBUG: 'src/manufacturerredundant.h' indexed with language 'c'
11:20:34.988 DEBUG: 'src/manufacturerredundant.o' indexed with language 'null'
11:20:34.990 DEBUG: 'src/Makefile' indexed with language 'null'
11:20:34.993 DEBUG: 'src/serverpackets.h' indexed with language 'c'
11:20:34.994 DEBUG: 'src/tablepacket.h' indexed with language 'c'
11:20:34.994 DEBUG: 'src/testfile.c' indexed with language 'c'
11:20:34.996 DEBUG: 'test/daylight' indexed with language 'null'
11:20:34.997 DEBUG: 'test/data' indexed with language 'null'
11:20:34.999 DEBUG: 'test/lightshow' indexed with language 'null'
11:20:35.000 DEBUG: 'test/onoff' indexed with language 'null'
11:20:35.004 INFO: 38 files indexed
11:20:35.005 INFO: 0 files ignored because of scm ignore settings
11:20:35.006 INFO: Quality profile for c: c-cpp-check
11:20:35.012 INFO: ------------- Run sensors on module xxx-test1
11:20:35.358 INFO: Load metrics repository
11:20:35.392 DEBUG: GET 200 https://xxx.xxx.xxx/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=34ms
11:20:35.457 INFO: Load metrics repository (done) | time=99ms
11:20:37.956 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:20:37.958 DEBUG: 'Import external issues report' skipped because one of the required properties is missing
11:20:37.960 DEBUG: 'C++ (Community) SquidSensor' skipped because there is no related file in current project
11:20:37.961 DEBUG: 'C++ (Community) RatsSensor' skipped because there is no related file in current project
11:20:37.964 DEBUG: 'C++ (Community) CppCheckSensor' skipped because there is no related file in current project
11:20:37.965 DEBUG: 'C++ (Community) PCLintSensor' skipped because there is no related file in current project
11:20:37.966 DEBUG: 'C++ (Community) DrMemorySensor' skipped because there is no related file in current project
11:20:37.973 DEBUG: 'C++ (Community) CxxCompilerGccSensor' skipped because there is no related file in current project
11:20:37.974 DEBUG: 'C++ (Community) CxxCompilerVcSensor' skipped because there is no related file in current project
11:20:37.975 DEBUG: 'C++ (Community) VeraxxSensor' skipped because there is no related file in current project
11:20:37.976 DEBUG: 'C++ (Community) ValgrindSensor' skipped because there is no related file in current project
11:20:37.977 DEBUG: 'C++ (Community) ClangTidySensor' skipped because there is no related file in current project
11:20:37.978 DEBUG: 'C++ (Community) ClangSASensor' skipped because there is no related file in current project
11:20:37.979 DEBUG: 'C++ (Community) ExternalRulesSensor' skipped because there is no related file in current project
11:20:37.983 DEBUG: 'C++ (Community) CoverageSensor' skipped because there is no related file in current project
11:20:37.984 DEBUG: 'Python Squid Sensor' skipped because there is no related file in current project
11:20:37.984 DEBUG: 'Cobertura Sensor for Python coverage' skipped because there is no related file in current project
11:20:37.985 DEBUG: 'PythonXUnitSensor' skipped because there is no related file in current project
11:20:37.985 DEBUG: 'PylintSensor' skipped because there is no related file in current project
11:20:37.986 DEBUG: 'PylintImportSensor' skipped because there is no related file in current project
11:20:37.987 DEBUG: 'Import of Bandit issues' skipped because there is no related file in current project
11:20:37.988 DEBUG: 'C (Community) RatsSensor' skipped because there is no related rule activated in the quality profile
11:20:37.990 DEBUG: 'C (Community) CppCheckSensor' skipped because there is no related rule activated in the quality profile
11:20:37.991 DEBUG: 'C (Community) PCLintSensor' skipped because there is no related rule activated in the quality profile
11:20:37.992 DEBUG: 'C (Community) DrMemorySensor' skipped because there is no related rule activated in the quality profile
11:20:37.993 DEBUG: 'C (Community) CxxCompilerGccSensor' skipped because there is no related rule activated in the quality profile
11:20:37.995 DEBUG: 'C (Community) CxxCompilerVcSensor' skipped because there is no related rule activated in the quality profile
11:20:37.995 DEBUG: 'C (Community) VeraxxSensor' skipped because there is no related rule activated in the quality profile
11:20:37.997 DEBUG: 'C (Community) ValgrindSensor' skipped because there is no related rule activated in the quality profile
11:20:37.999 DEBUG: 'C (Community) ClangTidySensor' skipped because there is no related rule activated in the quality profile
11:20:38.000 DEBUG: 'C (Community) ClangSASensor' skipped because there is no related rule activated in the quality profile
11:20:38.002 DEBUG: 'C (Community) ExternalRulesSensor' skipped because there is no related rule activated in the quality profile
11:20:38.004 DEBUG: 'C (Community) CoverageSensor' skipped because one of the required properties is missing
11:20:38.004 DEBUG: 'SonarCSS Metrics' skipped because there is no related file in current project
11:20:38.004 DEBUG: 'SonarCSS Rules' skipped because there is no related file in current project
11:20:38.005 DEBUG: 'Import of stylelint issues' skipped because there is no related file in current project
11:20:38.006 DEBUG: 'SonarGo' skipped because there is no related file in current project
11:20:38.007 DEBUG: 'Go Unit Test Report' skipped because there is no related file in current project
11:20:38.007 DEBUG: 'Import of go vet issues' skipped because there is no related file in current project
11:20:38.008 DEBUG: 'Import of Golint issues' skipped because there is no related file in current project
11:20:38.008 DEBUG: 'Import of GoMetaLinter issues' skipped because there is no related file in current project
11:20:38.009 DEBUG: 'Kotlin Sensor' skipped because there is no related file in current project
11:20:38.010 DEBUG: 'Import of detekt issues' skipped because there is no related file in current project
11:20:38.010 DEBUG: 'Import of Android Lint issues' skipped because one of the required properties is missing
11:20:38.011 DEBUG: 'SonarJS' skipped because there is no related file in current project
11:20:38.011 DEBUG: 'ESLint-based SonarJS' skipped because there is no related file in current project
11:20:38.014 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
11:20:38.016 DEBUG: 'Import of ESLint issues' skipped because one of the required properties is missing
11:20:38.018 DEBUG: 'Ruby Sensor' skipped because there is no related file in current project
11:20:38.019 DEBUG: 'Import of RuboCop issues' skipped because one of the required properties is missing
11:20:38.019 DEBUG: 'SimpleCov Sensor for Ruby coverage' skipped because there is no related file in current project
11:20:38.020 DEBUG: 'Scala Sensor' skipped because there is no related file in current project
11:20:38.021 DEBUG: 'Scoverage sensor for Scala coverage' skipped because one of the required properties is missing
11:20:38.021 DEBUG: 'Import of Scalastyle issues' skipped because there is no related file in current project
11:20:38.022 DEBUG: 'Import of Scapegoat issues' skipped because there is no related file in current project
11:20:38.022 DEBUG: 'C# Properties' skipped because there is no related file in current project
11:20:38.025 DEBUG: 'Import of Checkstyle issues' skipped because there is no related file in current project
11:20:38.026 DEBUG: 'Import of PMD issues' skipped because one of the required properties is missing
11:20:38.031 DEBUG: 'Import of SpotBugs issues' skipped because there is no related file in current project
11:20:38.034 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:20:38.036 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:20:38.038 DEBUG: 'Flex' skipped because there is no related file in current project
11:20:38.041 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
11:20:38.042 DEBUG: 'XML Sensor' skipped because there is no related file in current project
11:20:38.043 DEBUG: 'PHP sensor' skipped because there is no related file in current project
11:20:38.044 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
11:20:38.045 DEBUG: 'SonarTS' skipped because there is no related file in current project
11:20:38.048 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
11:20:38.049 DEBUG: 'Import of TSLint issues' skipped because one of the required properties is missing
11:20:38.050 DEBUG: 'VB.NET Properties' skipped because there is no related file in current project
11:20:38.059 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
11:20:38.059 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
11:20:38.060 DEBUG: 'C++ (Community) XunitSensor' skipped because one of the required properties is missing
11:20:38.060 DEBUG: 'C++ (Community) Unit Test Results Import' skipped because there is no related file in current project
11:20:38.061 DEBUG: 'C (Community) XunitSensor' skipped because one of the required properties is missing
11:20:38.062 DEBUG: 'C#' skipped because there is no related file in current project
11:20:38.062 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
11:20:38.063 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:20:38.064 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
11:20:38.064 DEBUG: 'VB.NET' skipped because there is no related file in current project
11:20:38.066 DEBUG: 'VB.NET Tests Coverage Report Import' skipped because there is no related file in current project
11:20:38.066 DEBUG: '[Deprecated] VB.NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:20:38.067 DEBUG: 'VB.NET Unit Test Results Import' skipped because there is no related file in current project
11:20:38.069 DEBUG: Sensors : C (Community) SquidSensor -> JaCoCo XML Report Importer -> JavaXmlSensor -> HTML
11:20:38.070 INFO: Sensor C (Community) SquidSensor [c]
11:20:38.213 DEBUG: Cyclomatic complexity threshold: 10
11:20:38.218 DEBUG: Function size threshold: 20
11:20:38.253 DEBUG: global settings for: '/xxx/xxx/xxx/xxx/src/manufacturer.h'
11:20:38.254 DEBUG: Parse 'manufacturer.h' as C++ file
11:20:38.587 DEBUG: API File: manufacturer.h
11:20:38.588 DEBUG: Header file suffixes: [.h]
11:20:38.588 DEBUG: finished preprocessing '/xxx/xxx/xxx/xxx/src/manufacturer.h'
11:20:38.666 INFO: Load project repositories
11:20:38.706 DEBUG: GET 200 https://xxx.xxx.xxx/batch/project.protobuf?key=xxx-test1 | time=40ms
11:20:38.716 INFO: Load project repositories (done) | time=50ms
11:20:38.716 DEBUG: 'src/manufacturer.h' generated metadata with charset 'UTF-8'
11:20:38.721 DEBUG: ***** Node: initDeclaratorList tokenValue='pdb_id_t' tokenLine=21 tokenColumn=17
...
11:20:42.737 DEBUG: global settings for: '/xxx/xxx/xxx/xxx/src/testfile.c'
11:20:42.737 DEBUG: Parse 'testfile.c' as C file, ends in '.c'
11:20:42.739 DEBUG: API File: testfile.c
11:20:42.739 DEBUG: Header file suffixes: [.h]
11:20:42.739 DEBUG: finished preprocessing '/xxx/xxx/xxx/xxx/src/testfile.c'
11:20:42.741 DEBUG: 'src/testfile.c' generated metadata with charset 'UTF-8'
11:20:42.741 DEBUG: Not enough content in 'src/testfile.c' to have CPD blocks, it will not be part of the duplication detection
11:20:42.760 DEBUG: CxxFileLinesVisitor: '/xxx/xxx/xxx/xxx/src/testfile.c'
11:20:42.761 DEBUG:    lines:           '7'
11:20:42.761 DEBUG:    executableLines: '[4, 5]'
11:20:42.761 DEBUG:    linesOfCode:     '[1, 3, 4, 5]'
11:20:42.761 DEBUG:    linesOfComments: '[]'
11:20:44.203 INFO: Sensor C (Community) SquidSensor [c] (done) | time=6134ms
11:20:44.203 INFO: Sensor JaCoCo XML Report Importer [jacoco]
11:20:44.208 DEBUG: No reports found
11:20:44.208 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
11:20:44.208 INFO: Sensor JavaXmlSensor [java]
11:20:44.217 INFO: 3 source files to be analyzed
11:20:44.233 DEBUG: 'ccl_config_extract.xml' generated metadata with charset 'UTF-8'
11:20:44.403 DEBUG: Skipped 'ccl_config_extract.xml' due to parsing error
11:20:44.424 DEBUG: 'cppcheck-report.xml' generated metadata with charset 'UTF-8'
11:20:44.697 DEBUG: 'manufacturercomponents.xml' generated metadata with charset 'UTF-8'
11:20:44.841 INFO: 3/3 source files have been analyzed
11:20:44.842 INFO: Sensor JavaXmlSensor [java] (done) | time=633ms
11:20:44.847 INFO: Sensor HTML [web]
11:20:44.870 INFO: Sensor HTML [web] (done) | time=23ms
11:20:44.874 INFO: ------------- Run sensors on project
11:20:44.884 DEBUG: 'Java CPD Block Indexer' skipped because there is no related file in current project
11:20:44.885 DEBUG: Sensors : Zero Coverage Sensor
11:20:44.886 INFO: Sensor Zero Coverage Sensor
11:20:44.997 INFO: Sensor Zero Coverage Sensor (done) | time=111ms
11:20:45.037 INFO: SCM provider for this project is: git
11:20:45.038 INFO: 2 files to be analyzed
11:20:45.060 DEBUG: Blame file xxx/src/testfile.c
11:20:45.062 DEBUG: Blame file xxx/cppcheck-report.xml
11:20:45.461 DEBUG: Unable to blame file cppcheck-report.xml. No blame info at line 1. Is file committed? [Author: PersonIdent[Not Committed Yet, , Fri Aug 7 11:20:45 2020 +0200] Source commit: null]
11:20:45.461 DEBUG: Unable to blame file src/testfile.c. No blame info at line 1. Is file committed? [Author: PersonIdent[Not Committed Yet, , Fri Aug 7 11:20:45 2020 +0200] Source commit: null]
11:20:45.468 INFO: 0/2 files analyzed
11:20:45.468 WARN: Missing blame information for the following files:
11:20:45.469 WARN:   * cppcheck-report.xml
11:20:45.469 WARN:   * src/testfile.c
11:20:45.469 WARN: This may lead to missing/broken features in SonarQube
11:20:45.493 INFO: 8 files had no CPD blocks
11:20:45.493 INFO: Calculating CPD for 3 files
11:20:45.493 DEBUG: Detection of duplications for /xxx/xxx/xxx/xxx/src/manufacturerredundant.c
11:20:45.507 DEBUG: Detection of duplications for /xxx/xxx/xxx/xxx/src/manufacturercomponentproxy.c
11:20:45.549 DEBUG: Detection of duplications for /xxx/xxx/xxx/xxx/src/manufacturerprotected.c
11:20:45.551 INFO: CPD calculation finished
11:20:46.129 INFO: Analysis report generated in 553ms, dir size=413 KB
11:20:46.838 INFO: Analysis report compressed in 708ms, zip size=96 KB
11:20:46.839 INFO: Analysis report generated in /xxx/xxx/xxx/xxx/.scannerwork/scanner-report
11:20:46.839 DEBUG: Upload report
11:20:47.181 DEBUG: POST 200 https://xxx.xxx.xxx/api/ce/submit?projectKey=xxx-test1 | time=341ms
11:20:47.187 INFO: Analysis report uploaded in 348ms
11:20:47.192 INFO: ANALYSIS SUCCESSFUL, you can browse https://xxx.xxx.xxx/dashboard?id=xxx-test1
11:20:47.193 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
11:20:47.194 INFO: More about the report processing at https://xxx.xxx.xxx/api/ce/task?id=AXPIOQb7VDQ4y_nwYk9O
11:20:47.225 DEBUG: Report metadata written to /xxx/xxx/xxx/xxx/.scannerwork/report-task.txt
11:20:47.235 DEBUG: Post-jobs : Final report -> Final report
11:20:47.236 INFO: Executing post-job 'Final report'
11:20:47.244 INFO: Executing post-job 'Final report'
11:20:47.245 WARN: Preprocessor: 44 include directive error(s). This is only relevant if parser creates syntax errors. The preprocessor searches for include files in the with 'sonar.cxx.includeDirectories' defined directories and order.
11:20:47.245 WARN: Source code parser: 8 syntax error(s) detected. Syntax errors could cause invalid software metric values. Root cause are typically missing includes, missing macros or compiler specific extensions.
11:20:47.255 INFO: Analysis total time: 15.879 s
11:20:47.258 INFO: ------------------------------------------------------------------------
11:20:47.259 INFO: EXECUTION SUCCESS
11:20:47.259 INFO: ------------------------------------------------------------------------
11:20:47.259 INFO: Total time: 18.609s
11:20:47.337 INFO: Final Memory: 14M/50M
11:20:47.338 INFO: ------------------------------------------------------------------------

Related information

Sonar Qube Community Edition version 7.9.3 (build 33349) C (Community) version 1.3.2 (build 1853) Cppcheck version 1.82 sonar-scanner version 4.4.0 (Linux) -- also tried with 4.0.0

guwirth commented 4 years ago

Hi @p4kner,

You are using the C and C++ plugin.

The c++ part seams to be not in use, why not using the C++ plugin? The code is the same, only difference is that if you are using C and C++ you can define language specific profiles.

Regards,

p4kner commented 4 years ago

Thanks for your helpful reply @guwirth!

Yes the activated rules in the Quality Profile are the Cppcheck C (Community) rules under the Repository heading - not the Cppcheck C++ (Community) rules. The Quality Profile says 522 Rules and 1 Projects (sic). The configured rules are shown as active when accessed via the Activate More Rules option. However I have noticed, that a click on the number of configured rules (the 522 is a hyperlink) opens an overview displaying the message 0 of 0 shown.

Yes, I am configuring the sonar.c.xxx settings. The log indicates, that the upload is being skipped for C++ due to a missing file. This is as expected, as I am not providing a report for C++.

'C++ (Community) CppCheckSensor' skipped because there is no related file in current project

Here are the project properties:

sonar.xml.file.suffixes=.disable-xml
sonar.c.suffixes.sources=.c
sonar.c.suffixes.headers=.h
sonar.c.cppcheck.reportPath=cppcheck-report.xml

Thanks for your remark re the use of both the C and C++ plugins. The aim is to analyse projects in c and others in c++. This should be possible with only the C++ plugin, right? Maybe this is where the problem originates from. I will get on to it!

Cheers!

guwirth commented 4 years ago

Hi @p4kner,

the default settings of the C++ plugin are:

sonar.cxx.suffixes.sources=.cxx,.cpp,.cc,.c
sonar.cxx.suffixes.headers=.hxx,.hpp,.hh,.h

Maybe you can try to set them to .dummy (or remove .c) to try if this is the problem?

The aim is to analyse projects in c and others in c++. This should be possible with only the C++ plugin, right?

Yes, The c plugin was introduced to configure the languages c and c++ in a different way (profiles). I think this works only if you have a pure C project and a pure C++ project. In any other case it's anyway mixed.

What the c plugin is doing:

The c plugin is still experimental and we are thinking about to remove it. Do you have reasons to keep it?

Regards,

guwirth commented 4 years ago

@p4kner in your log file I saw that sonar.cxx.suffixes.sources/headers is already correct. Must be something different...

p4kner commented 4 years ago

@guwirth yes, sorry, I had deactivated the file types .c and .h for C++ in the back end.

We can accomplish what we want without the C Community Plugin. However I don't think this is a case of the plugins interfering, as explained below.

As of now the Sonar Qube instance has been updated to only use the C++ Community plugin.

The C Community plugin has been removed. The default settings of the plugin have been reset. A new quality profile for c++ was created and the rules for Cppchecker were activated. The report path was configured for sonar.cxx.

To no avail.

The log shows that the C++ plugin is active and that the quality profile is being used. But the c++ cppchecker is still being skipped due to no configured rules in the profile.

Calls to the Sonar API show that the quality profile exists and has active rules (522) , as shown in the JSON:

{"key":"AXPdpHEQdeA7Kax_3GIw","name":"cxx-cppcheck-1","language":"c++","languageName":"C++ (Community)","isInherited":true,"parentKey":"AXIw7QvgMHOmZ8q1k1aw","parentName":"Sonar way","isDefault":false,"activeRuleCount":522,"activeDeprecatedRuleCount":0,"projectCount":1,"rulesUpdatedAt":"2020-08-11T13:29:47+0000","lastUsed":"2020-08-11T13:19:41+0000","userUpdatedAt":"2020-08-11T13:29:47+0000","organization":"default-organization","isBuiltIn":false,"actions":{"edit":true,"setAsDefault":true,"copy":true,"associateProjects":true,"delete":true}}

A further call to the API to get the explicit rules for the profile: https://xxx.xxx.xxx/api/rules/search?activation=true&qprofile=AXPdpHEQdeA7Kax_3GIw yields

{"total":0,"p":1,"ps":100,"rules":[]}

This didn't come as too much of a surprise as calls to the page with the activated rules for the quality profile by clicking on the number of rules

https://xxx.xxx.xxx/coding_rules?activation=true&qprofile=AXPdpHEQdeA7Kax_3GIw

sadly still displays the 0 of 0 shown message.

For the SonarWay quality profiles which are available by default, this overview is not empty. However for quality profiles which are created and for which additional rules are added no rules are shown. This has also been tried for rules that have nothing to do with the C++ Community plugin.

This ties in with the message in the log. So when the scanner is querying the active rules for the quality profile of the project during the analysis, no active rules are returned.

My belief is, that this is the real issue and that it is thus not related to sonar-cxx! So once again, thanks for your ideas and I'm terribly sorry for wasting your time @guwirth. I will let you know when our instance is up and running correctly. Maybe someone can learn from this.

guwirth commented 4 years ago

@p4kner thx