codeclimate-cppcheck
is a Code Climate engine that wraps Cppcheck.
You can run it on your command line using the Code Climate CLI, or on our
hosted analysis platform.
Cppcheck is a static analysis tool for C/C++ code.
codeclimate engines:install cppcheck
to install the Code.codeclimate.yml
file. See example below.codeclimate analyze
. If you skipped step 2, the Cppcheck engine will.codeclimate.yml
.Like the cppcheck
command line tool itself, you can configure various
aspects of the static analysis. Right now, the following options are supported
in .codeclimate.yml
:
check
: issue categories to check.all
, warning
, style
, performance
, portability
,information
, unusedFunction
, etc.--enable=
option of cppcheck
for more information.project
: use Visual Studio project/solution (*.vcxproj
/*sln
) or compilecompile_commands.json
) for files to analyse, include paths,--project=
option of cppcheck
for more information.language
: forces cppcheck
to check all files as the given language.c
, c++
.--language=
option of cppcheck
for more information.stds
: multiple language standards to check against.--std=
option of cppcheck
for more information.platform
: specifies platform specific types and sizes. Available builtinunix32
, unix64
, win32A
, win32W
, win64
, etc.--platform=
option of cppcheck
for more information.library
: specifies library cfg
files to be loaded. Refer to the--library=
option of cppcheck
for more information.jobs
: specifies the number of jobs for execution Refer to the-j <jobs>
option of cppcheck
for more information.dump
: create dump files during execution.--dump
option of cppcheck
for more information.defines
: define preprocessor symbols.-D
option of cppcheck
for more information.undefines
: undefine preprocessor symbols.-U
option of cppcheck
for more information.includes
: paths for searching include files. First given path is searched-I
option of cppcheck
for more information.max_configs
: maximum number of configurations to check in a file beforemax_configs
can also be set to force
, whichcppcheck
to check all configs.--max-configs=
and --force
options of cppcheck
for moreinconclusive
: allow reporting issues that are not inconclusive.--inconclusive
option of cppcheck
for more information.suppressions-list
: suppress warnings listed in the file.--suppressions-list
option of cppcheck
for more information.inline-suppr
: allow suppression of warnings with inline comments,// cppcheck-suppress arrayIndexOutOfBounds
.--inline-suppr
option of cppcheck
for more informationAdditional options may be supported later.
An example .codeclimate.yml
file:
version: "2"
plugins:
cppcheck:
enabled: true
config:
check: all
project: compile_commands.json
language: c++
stds:
- c++11
platform: unix64
defines:
- "DEBUG=1"
- "__cplusplus"
undefines:
- "DEBUG"
includes:
- include/
max_configs: 42
inconclusive: false
dump: false
dump: false
suppressions-list: .cppcheck-suppressions
inline-suppr: true
jobs: 4
library: googletest
For help with Cppcheck, check out their documentation.
If you're running into a Code Climate issue, first look over this project's GitHub Issues, as your question may have already been covered. If not, go ahead and open a support ticket with us.