1

sonar doesn't launch cppcheck when I use sonar-runner. I'm using the last version off all (sonar, c++ community pluguin and sonar-runner) in ubuntu 12.04.

If someone has sonar working correctly with cppcheck (and the other plugins too, but now I only need cppcheck), tell me how please.

In the sonar dashboard of the project appears the number of lines of code, comments, quality index, technical debt,... and the rules compliance appears at 100% and it's not true, because the project has cppcheck errors. I'm sure that sonar doesn't launch cppcheck because running cppcheck takes 1-2 minutes, and sonar-runner shows 0ms in cppcheck section.

Thank you!

user1248057
  • 11
  • 1
  • 4
  • Hi, I have a similar result. I tried to add -Dsonar.cpp.cppcheck.path to cppcheck.exe path, but no more result... but maybe you could give it a try? Additionally, in the console output, nothing is printed nearby "Sensor CxxCppCheckSensor ... done : 1ms" – Alexis Jan 18 '13 at 10:27

1 Answers1

6

Though the documentation says otherwise, I couldn't trigger cppcheck analysis from sonar.

My solution was to launch cppcheck on its side, and then launch sonar-runner with report file parameter to import report to sonar dashboard:

sonar.cxx.cppcheck.reportPath=C:\...\cppcheck_report.xml

You may not need to precise this parameter if you generate the file at the expected place, WORKING_DIR/cppcheck-reports/ (not tested).

Alexis
  • 707
  • 8
  • 33
  • That's correct, the sonar plugin does no analysis on it's own. And while it will indeed check the current directory for the report, the sonar-runner does NOT (at least in my case) understand relative paths. – naugler Feb 01 '13 at 16:06