codechecker-ctl

% CodeChecker Control
% Tamás Dezső
% Jan 27, 2026

CodeChecker Control

It is a lightweight control tool and workflow driver for running CodeChecker inside Docker. It standardizes build capture, analysis, and report generation for local development and CI, while keeping the execution environment reproducible.

CodeChecker Control focuses on:


Quick start

This is the shortest useful path. It assumes Docker is installed.

git clone https://github.com/xsnpdngv/codechecker-ctl.git
cd codechecker-ctl

make image                     # build the CodeChecker image
alias cctl="$(pwd)/bin/cctl"   # make cctl script available

# run analysis
cd /path/to/target/project
cctl build
cctl analyze
cctl parse

# open local HTML report
firefox codechecker/report-html/index.html

That’s it. No server required.

Read further for tuning checkers, excluding files, or storing results in a CodeChecker server.


Architecture overview

CodeChecker Control builds a single Docker image that can be used in two modes:

┌──────────────────────────────┐
│  CodeChecker Control Image   │
│                              │
│  gcc / clang / cppcheck      │
│  CodeChecker CLI             │
│  CodeChecker server          │
└──────────────┬───────────────┘
               │ mounts
               V
┌──────────────────────────────┐
│  Host filesystem             │
│                              │
│  → source code               │
│  → CodeChecker workspace     │
└──────────────────────────────┘

The analyzed project always lives on the host filesystem. The container only provides the tooling.


Preparation

Build the Docker image

Build the CodeChecker Control Docker image.

If necessary, customize the environment to match the requirements of the target project by editing docker/Dockerfile.final before building the image.

make image

This is typically done once per version update.


Make CodeChecker Control available in the shell

Add the codechecker-ctl entry point to your PATH (for example via ~/.profile):

export PATH="/path/to/codechecker-ctl/bin:$PATH"

Reload the shell or source the profile for the change to take effect.


Prepare CodeChecker configuration for the target project

In the project to be analyzed, copy the sample CodeChecker configuration and adjust it as needed.

cd /path/to/target/project
cp -r /path/to/codechecker-ctl/codechecker ./
vi codechecker/config.yml
vi codechecker/skipfile.txt

These files control:

They are expected to live inside the analyzed project.


Workflow

All commands below are executed from the project directory being analyzed.

cd /path/to/target/project

cctl build [build-cmd] # build the project and generate compile_commands.json
cctl analyze [args]    # run CodeChecker analysis and produce reports
cctl parse [args]      # generate a static HTML report
cctl server-up         # start the CodeChecker web server
cctl store [args]      # upload reports to the CodeChecker server

Build command selection

cctl build runs the project build inside the Docker container in order to generate compile_commands.json.

By default, the following build command is used:

make clean && make

The build command can be overridden in two ways.

Environment variable

export PROJECT_BUILD_CMD="cmake --build build"
cctl build

This is useful for CI or when working with multiple projects.

Command-line override

cctl build ninja -C build

When provided, the command-line argument takes precedence over the environment variable.

Precedence order

  1. Command-line argument
  2. PROJECT_BUILD_CMD environment variable
  3. Built-in default

The build command is passed verbatim to CodeChecker and executed inside the container. Ensure the Docker image contains all tools and dependencies required to build the project.


Open the web UI in a browser:

firefox http://localhost:8001/

When finished, stop the server if needed:

cctl server-down

Files and configuration

Credentials

Password file for accessing the CodeChecker server when storing results:

chmod 600 ${HOME}/.codechecker/passwords.json

Example structure:

{
  "client_autologin": true,
  "credentials": {
    "*": "user123:232341f5f368dcc56783344cda5881ab"
  }
}

Server configuration

The CodeChecker server configuration is stored in:

~/.local/share/codechecker/workspace/server_config.json

Edit this file to adjust server ports, paths, or authentication behavior.


Notes