CodeChecker support
CodeChecker is a static analysis infrastructure. It executes analysis tools available on the build system, such as Clang-Tidy, Clang Static Analyzer and Cppcheck. Refer to the analyzer’s websites for installation instructions.
Installing CodeChecker
CodeChecker itself is a python package available on pypi.
pip install codechecker
Building with CodeChecker
To run CodeChecker, west build should be
called with a -DZEPHYR_SCA_VARIANT=codechecker
parameter, e.g.
west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=codechecker
Configuring CodeChecker
CodeChecker uses different command steps, each with their respective configuration parameters. The following table lists all these options.
Parameter |
Description |
---|---|
|
The number of threads to use in analysis. (default: <CPU count>) |
|
Arguments passed to the |
|
Perform a cleanup after parsing/storing. This will remove all |
|
A JSON or YAML file with configuration options passed to all commands. |
|
A comma separated list of report types. Allowed types are:
|
|
The CodeChecker run metadata name. (default: |
|
By default, CodeChecker identified issues will not fail the build, set this option to fail during analysis. |
|
Arguments passed to the |
|
Skip parsing the analysis, useful if you simply want to store the results. |
|
Run the |
|
Arguments passed to the |
|
Pass an identifier |
|
Trim the defined path from the analysis results, e.g. |
These parameters can be passed on the command line, or be set as environment variables.
Running twister with CodeChecker
When running CodeChecker as part of twister
some default options are set as following:
Parameter |
Value |
---|---|
|
|
|
|
|
The value from |
To override these values, set an environment variable or pass them as extra arguments.