The cxx plugin does not run any static analysis tools, thus all reports must be generated externally
Here is a quick guide how to generate the reports using external tools
Make sure to pass all include directories as otherwise the analysis will be incomplete. Caveat: cppcheck writes the output to the standard error.
Extension of cppcheck rules is possible by using extensions/rules/cppcheck. See Extending the Available Tools Rules on how to create the rules
You may also use -D and -M options to tell cppncss about preprocessor macros.
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.
Extension of valgrind rules is possible by using extensions/rules/valgrind. See Extending the Available Tools Rules on how to create the rules
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.
Extension of vera++ rules is possible by using extensions/rules/vera++. See Extending the Available Tools Rules on how to create the rules
Extension of rats rules is possible by using extensions/rules/rats. See Extending the Available Tools Rules on how to create the rules
Please refer to product page (Official Site)
Extension of pclint rules is possible by using extensions/rules/pclint. See Extending the Available Tools Rules on how to create the rules
External Tool sensor
As of version 0.2, any static analysis tool can be reused with the plugin using the property sonar.cxx.externalrules.reportPath. The following table describes the format of the report
|Xml Description - RNG-Schema||Example|
<element name="results" xmlns="http://relaxng.org/ns/structure/1.0"> <zeroOrMore> <element name="error"> <attribute name="file"/> <attribute name="msg"/> <attribute name="id"/> <attribute name="line"> <data type="integer" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" /> </attribute> <text/> </element> </zeroOrMore> </element>
|file||source file, relative to project path|
|line||line of the violation|
|id||id of the rule, mapped a rule in sonar. See "Enable the rules in Sonar server" below|
|msg||description of the violation|
To enable the rules in sonar see