This plugin can be used to import Cppcheck reports into SonarQube.
The plugin will not run Cppcheck but instead re-use the report generated by it. Here are the steps:
- Download and install Cppcheck (version 1.47 or higher) on the machine running the SonarQube analysis
- Install this SonarQube Cppcheck plugin (see the release section and the instructions to manually install a SonarQube plugin)
- Run Cppcheck to create an xml report:
cppcheck --xml --xml-version=2 --enable=all <source-location> 2> cppcheck-report.xml
- Set the
sonar.cppcheck.reportPath
analysis property to the path of the Cppcheck xml report, e.g.:
sonar.cppcheck.reportPath=cppcheck-report.xml
- Activate some Cppcheck rules in your quality profile
- Run the SonarQube analysis on your project