Here is a quick guide how to run the supported analyzers and generate reports such that it fits SonarQube's needs.
In order to run Cppcheck and generate a fitting report, make sure:
- to pass all include directories as otherwise the analysis will be incomplete
- that the <sources> parameter matches the sonar.sources list in sonar-project.properties
- to create a XML report 'version 1' using the parameters "
- to get the report from the standard error channel
A Cppcheck run may take a while on a big code base. To cut down analysis times, check the following options:
-j Noption to run N workers in parallel
- Use only checks you're interested in via the option
- Restrict checking of preprocessor configurations using
- Get a faster machine
Just tell Valgrind to generate XML output. The 'tool' option isn't necessary as 'memcheck' is the default one. Make sure the binaries contain debug info.
The generation of vera++ reports is somewhat more tricky. We find all the files we want to be analysed, pipe this list into vera++ and pipe its output into a Perl script which finally generates the required XML.
The Pc-Lint XML output needs to be formated to fit SonarQube.
This formating has been verifed with Pc-Lint 9.0i.
For further details on how to configure Pc-Lint please refer to product page (Official Site)