1 The Cppcheck Plugin

1.0.1 Description

Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many
other analysis tools, it don't detect syntax errors. Cppcheck only detects the
types of bugs that the compilers normally fail to detect. The goal is no false

This plugin is responsible for scanning with cppcheck the C/C++ code included
in each component in the build and reporting errors and warnings found.

It looks for C/C++ code under the directory ${srcDir}/src/
where ${srcDir} is specified by the property src.location or, alternatively,
under the path specified by the property cpp.src.location, or alternatively,
It generates a report (html) with the total number of warnings/errors found for
each component with a link to the cppcheck output for that component.
It updates the corresponding metrics in the buildstatus.xml file.
If a report relative to a module is not readable, it is not included in the
report nor it contributes to the metrics value.

1.0.2 Version

Cppcheck 1.47

1.0.3 Homepage


1.1 Activation

1.1.1 Suitability

Suitable for any module which contains C/C++ code.

1.1.2 Execution point

The execution point defines during which command and which target the plugin will be executed.

TARGET pretest

1.1.3 Profiles

The profiles must be specified in the configuration in order to activate the plugin.

The plugin profile can be used to enable specific plugins.

The bundle profiles can be used to enable a set of plugins within a specific category.


1.1.4 Deactivation

If this plugin has been activated for a larger set of modules (at project or subsystem level), it is possible to disable it for specific modules using special properties:

NAME nocppcheck
DESCRIPTION To disable the cppcheck execution for the current module

NAME notest
DESCRIPTION To disable all the plugins registered at TEST target (PRETEST, TEST, POSTTEST) for the current module

1.2 Input

1.2.1 Required properties

The required properties must be available in order for the plugin to run.

Some of the required properties may have default values which correctness must be check to ensure the correct execution of the plugin.

NAME {cpp.src.location}
DESCRIPTION Points to the path under which C/C++ code is looked for
DEFAULT VALUE ${src.location}/src
EXAMPLE To have the plugin look for C/C++ code under ${src.location}/c++, the property must be set as: ${src.location}/c++

NAME {cppcheck.src.location}
DESCRIPTION Points to the path under which C/C++ code is looked for.It takes precedence over {cpp.src.location}
DEAFULT VALUE ${src.location}/src
EXAMPLE To have the plugin look for C/C++ code under ${src.location}/c++, the property must be set as: ${src.location}/c++

1.2.2 Other requirements


1.2.3 Dependencies

ant (to convert xml output into html)

1.3 Output

1.3.1 Module reports

For each module, the output is generated in ${src.location}/reports/cppcheck. The plugin generates ${moduleName}-${configuration}/CPPCHECK-${moduleName}.err.xml and ${moduleName}-${configuration}/CPPCHECK-${moduleName}.err.html containing the output of cppcheck execution and ${moduleName}-${configuration}/CPPCHECK-${moduleName}.log containing the log of the execution of cppcheck.

1.3.2 Global reports

The plugin generates the overall html report index.html with number of warnings and errors found for every module and the corresponding metric value.

1.4 Metrics

1.4.1 Overall

NAME Cppcheck
VALUE errors
UNIT violations
TYPE integer
LINKS HTML: ${workspaceDir}/reports/cppcheck/index.html

NAME Cppcheck rate
VALUE Percentage of modules that have successfully run cppcheck
UNITS Modules
TYPE Percentage
LINKS HTML: ${workspaceDir}/reports/cppcheck/index.html
VALUES success: number of successful modules, failed: number of failed modules

1.4.2 Module

NAME Cppcheck
VALUE errors
UNIT Violations
TYPE Integer
LINKS HTML: ${workspaceDir}/reports/cppcheck/index.html

1.5 Advanced

1.5.1 Register

verifies the existence of cppcheck registers the plugin

1.5.2 Execute

verifies the existence of user defined properties and analyses C/C++ code with cppcheck.

1.5.3 Publish

Analyses the result of the scan. Feeds metrics into build-status.xml.

1.5.4 Finalise

Generates an overall report and overall metrics. -- - 28-Sep-2011
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2011-10-05 - FabioCapanniniExternal
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EMI All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback