Configuring Cppcheck

Cppcheck is a tool commonly used to check Dead Code within C/C++ source code. Within TICS, these results can be used to give a more detailed overview of Dead Code than just checking which files are and are not buildable.

Basic configuration

Configuring timeout values

The timeout in seconds can optionally be configured as a configuration property either on SERVER or PROJECT level. If this property is not configured in SERVER.yaml or PROJECTS.yaml, the default value of 6 hours is used. The example sets the timeout for Cppcheck to 3600 seconds. Note the capitalization; this is to match the internals of TICS.

TOOLS:
  Cppcheck:
    TIMEOUT: 3600

Suppressing Dead Code

In Cppcheck, you may occasionally encounter false positives when checking for Dead Code. A good example of this is if your function is never called by the source code, but instead is called by specific hardware interfaces. It is then possible to suppress these Dead Code parts so that they do not count against your Dead Code score. See the Dead Code metric for more information.