SonarLint correctly detects C++ issues but SonarQube does not.
Sonar Scanner: 5.0.1
SonarQube Server: 9.9.0
The project uses the default C and C++ Quality Profiles. And Quality gate is set to Sonar way BUILT IN
.
For example the following issues only caught by SonarLint:
- Replace “.” with “::” for access to “delay::wait”.
sonarlint(cpp:S2209)
- Complete the task associated to this “todo” comment.
sonarlint(cpp:S1135)
- Use the init-statement to declare “foo” inside the if statement. [+1 location]
sonarlint(cpp:S6004)
Aren’t these rules enabled in default quality profiles? Is there a reason why SonarQuve doesn’t show them?
Steps: CI pipeline
script:
- mkdir -p .sonar
- build-wrapper-linux-x86-64 --out-dir .sonar/bw-output cmake --workflow --preset tests-gcc
- cmake --build --preset tests-gcc --target sonarqube-coverage
- sonar-scanner
-Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
-Dsonar.coverageReportPaths=output/build/Debug/tests-gcc/sonarqube.xml
-Dsonar.qualitygate.wait=true
Logs:
SonarScanLogs.txt (9.8 KB)