CodeChecker: running the analyzer from the command line

Basic Usage

Install CodeChecker as described here: CodeChecker Install Guide.

Create a compilation database. If you use cmake then pass the -DCMAKE_EXPORT_COMPILE_COMMANDS=1 parameter to cmake. Cmake will create a compile_commands.json file. If you have a Makefile based or similar build system then you can log the build commands with the help of CodeChecker:

make clean
CodeChecker log -b "make" -o compile_commands.json

Analyze your project.

CodeChecker analyze compile_commands.json -o ./reports

View the analysis results. Print the detailed results in the command line:

CodeChecker parse --print-steps ./reports
Or view the detailed results in a browser:
CodeChecker parse ./reports -e html -o ./reports_html
firefox ./reports_html/index.html

Optional: store the analysis results in a DB.

mkdir ./ws
CodeChecker server -w ./ws -v 8555 &
CodeChecker store ./reports --name my-project --url http://localhost:8555/Default

Optional: manage (categorize, suppress) the results in your web browser:

firefox http://localhost:8555/Default

Detailed Usage

For extended documentation please refer to the official site of CodeChecker!