### Start CodeChecker Server with Default Configuration Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Execute this command to start the CodeChecker server with its default settings. No additional arguments are needed for a basic setup. ```bash CodeChecker server ``` -------------------------------- ### Install report-converter via Makefile Source: https://codechecker.readthedocs.io/en/latest/tools/report-converter Use these commands to initialize a virtual environment and install the package dependencies. ```bash # Create a Python virtualenv and set it as your environment. make venv source $PWD/venv/bin/activate # Build and install report-converter package. make package ``` -------------------------------- ### Navigate to CodeChecker examples directory Source: https://codechecker.readthedocs.io/en/latest/usage Change the current directory to the CodeChecker examples directory within the repository. ```bash cd /docs/examples ``` -------------------------------- ### Client Configuration File Example Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Example of a JSON configuration file used to specify command-line arguments for CodeChecker sub-commands, such as 'store'. This allows for cleaner command invocation. ```json { "store": [ "--name=my_run", "--tag=my_tag", "--url=http://codechecker.my:9090/MyProduct" ] } ``` -------------------------------- ### CodeChecker diff CLI examples Source: https://codechecker.readthedocs.io/en/latest/web/diff Command-line examples for comparing local and remote analysis results using CodeChecker diff. ```bash CodeChecker cmd diff --basename ./my_base_results --newname ./my_updated_results --new ``` ```bash CodeChecker cmd diff --basename "My Base Results" --newname "My Updated Results" --new ``` ```bash CodeChecker cmd diff --basename "My Base Results" --newname ./my_updated_results --new CodeChecker cmd diff --basename ./my_base_results --newname "My Updated Results" --new ``` -------------------------------- ### Analyze Unmodified Example Project Source: https://codechecker.readthedocs.io/en/latest/usage Analyze the unmodified example project to generate initial reports. Ensure sensitive checkers are enabled. ```bash CodeChecker analyze ./compile_commands.json --output ./reports \ --enable sensitive ``` -------------------------------- ### Example C Header File Source: https://codechecker.readthedocs.io/en/latest/usage This is an example C header file containing inline functions that might lead to analysis findings. ```c //lib.h: inline int div_h(){int *p; *p=4;}; inline int my_div(int); ``` -------------------------------- ### CodeChecker Analysis Configuration File Example Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Use a JSON file to specify command-line arguments for CodeChecker sub-commands like 'analyze'. This example shows how to enable specific checks, configure analyzer settings, set report hash generation, and enable verbose output. ```json { "analyze": [ "--enable=core.DivideZero", "--enable=core.CallAndMessage", "--analyzer-config", "clangsa:unroll-loops=true", "--checker-config", "clang-tidy:google-readability-function-size.StatementThreshold=100", "--report-hash", "context-free-v2", "--verbose=debug", "--clean" ], } ``` -------------------------------- ### Install Dependencies on Mac OS X Source: https://codechecker.readthedocs.io/en/latest/install_macosx Installs necessary build tools and libraries using Homebrew and pip. Ensure Homebrew is installed before running these commands. ```bash # Download and install dependencies. brew update brew install gcc git pip3 install virtualenv ``` ```bash # Install the latest clang see: https://formulae.brew.sh/formula/llvm brew install llvm@10.0.0 ``` ```bash # Install npm brew install npm ``` -------------------------------- ### Install CodeChecker via snap Source: https://codechecker.readthedocs.io/en/latest Install CodeChecker using the snap package manager. Note that snap packages only support lowercase command names. ```bash sudo snap install codechecker --classic ``` -------------------------------- ### Start CodeChecker Server Source: https://codechecker.readthedocs.io/en/latest/usage Start the CodeChecker server locally. Use SQLite DB for local testing; not recommended for multi-user deployment. Specify a workspace directory for the database. ```bash cd CodeChecker server --workspace ./ws --port 8555 ``` -------------------------------- ### Skip List Format Example Source: https://codechecker.readthedocs.io/en/latest/usage A sample skip list file format. Lines starting with '+' include files, while lines starting with '-' exclude them. The '*' acts as a wildcard. ```text #skip.list: +*main.cpp -* ``` -------------------------------- ### Install External Authentication Dependencies Source: https://codechecker.readthedocs.io/en/latest/web/authentication Installs necessary system libraries and Python modules for external authentication methods like PAM and LDAP. Ensure the Python virtual environment is sourced before installing modules. ```bash # get additional system libraries sudo apt-get install libldap2-dev libsasl2-dev libssl-dev # the python virtual environment must be sourced! source ~/checker_env/bin/activate # install required python modules pip3 install -r requirements_py/auth/requirements.txt ``` -------------------------------- ### Set Up Virtual Environment and Install CodeChecker Source: https://codechecker.readthedocs.io/en/latest/web/postgresql_setup Activates the CodeChecker virtual environment, builds the package, and adds the build directory to the PATH for easy access. ```bash # Set the created virtualenv as your environment. source $PWD/venv/bin/activate # Build and install a CodeChecker package. make package # For ease of access, add the build directory to PATH. export PATH="$PWD/build/CodeChecker/bin:$PATH" ``` -------------------------------- ### Start CodeChecker Server with PostgreSQL Configuration Source: https://codechecker.readthedocs.io/en/latest/web/postgresql_setup Starts the CodeChecker server, specifying PostgreSQL connection details for the configuration database. This database stores server-specific configurations. ```bash CodeChecker server --postgresql \ --db-host localhost --db-port 5432 \ --db-username codechecker --db-name codechecker_config ``` -------------------------------- ### Install Clang 7 on Ubuntu 18.04 Source: https://codechecker.readthedocs.io/en/latest/deps Commands to add the LLVM repository and install Clang 7 and Clang-Tidy 7, followed by updating system alternatives. ```bash apt-get update && apt-get install -y software-properties-common wget && \ wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \ add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" sudo apt-get install clang-7 clang-tidy-7 # Set clang and clang-tidy to point to clang-7 and clang-tidy-7 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-7 100 && \ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-7 100 && \ update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-7 100 ``` -------------------------------- ### Install additional library for Ubuntu 23 with venv_dev Source: https://codechecker.readthedocs.io/en/latest Installs the libpq-dev library, which is required for the venv_dev target on Ubuntu 23 Linux. ```bash # In case of venv_dev target and Ubuntu 23 Linux, install an additional library: sudo apt-get install libpq-dev ``` -------------------------------- ### Install CodeChecker via pip Source: https://codechecker.readthedocs.io/en/latest Use this command to install CodeChecker from PyPI. This method is available on Linux, OS X, and Windows. ```bash pip3 install codechecker ``` -------------------------------- ### Example C Source File (lib.c) Source: https://codechecker.readthedocs.io/en/latest/usage A C source file that includes 'lib.h' and defines a function that can cause a division by zero. ```c //lib.c: #include "lib.h" int my_div(int b){ return 1/b; } ``` -------------------------------- ### Example C Source File (b.c) Source: https://codechecker.readthedocs.io/en/latest/usage Another C source file that includes 'lib.h' and calls a function that can lead to an error. ```c //b.c: #include "lib.h" int h(){ return my_div(0); } ``` -------------------------------- ### Example C/C++ Project Structure for Testing Source: https://codechecker.readthedocs.io/en/latest/tests Illustrates the basic file structure for a C/C++ project used in tests, including Makefile, source files, and report files. ```makefile Makefile # build and analyze targets for the test source files main.cpp # cpp file with errors in it reports/base/*.plist # first report set used for the tests reports/new/*.plist # second report set used for the tests ``` -------------------------------- ### Manage CodeChecker Server Source: https://codechecker.readthedocs.io/en/latest Commands to start the web server and store analysis results into the database. ```bash CodeChecker server ``` ```bash CodeChecker store ./results -n my-project ``` -------------------------------- ### Enable runtime server log configuration Source: https://codechecker.readthedocs.io/en/latest/logging Start the server with the CC_LOG_CONFIG_PORT environment variable to allow dynamic log updates. ```bash CC_LOG_CONFIG_PORT='8888' Codechecker server ... ``` -------------------------------- ### GCC Include Path Example Source: https://codechecker.readthedocs.io/en/latest/analyzer/gcc_incompatibilities This output displays the include search paths utilized by GCC during preprocessing, illustrating its system header locations. ```text $ gcc -E -x c -v - #include <...> search starts here: /usr/lib/gcc/x86_64-linux-gnu/7/include /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/include ``` -------------------------------- ### Example C Source File (a.c) Source: https://codechecker.readthedocs.io/en/latest/usage A C source file that includes 'lib.h' and calls a function that can lead to an error. ```c //a.c: #include "lib.h" int f(){ return my_div(0); } ``` -------------------------------- ### CodeChecker CLI: Examples for Results Analysis Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Provides practical examples of using the 'CodeChecker cmd results' command for various analysis and filtering tasks. Demonstrates how to specify runs, filter by severity and file paths, and output in JSON format. ```bash #Get analysis results for a run: CodeChecker cmd results my_run ``` ```bash # Get analysis results for multiple runs: CodeChecker cmd results my_run1 my_run2 ``` ```bash # Get analysis results by using regex: CodeChecker cmd results "my_run*" ``` ```bash # Get analysis results for a run and filter the analysis results: CodeChecker cmd results my_run --severity critical high medium \ --file "/home/username/my_project/*" ``` ```bash # Get detailed analysis results for a run in JSON format. CodeChecker cmd results -o json --details my_run ``` ```bash # Get analysis results using a saved filter preset: CodeChecker cmd results my_run --filter-preset my_preset \ --url ``` -------------------------------- ### View loop-related analyzer options Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Example output showing configuration options for loop analysis in ClangSA. ```text clangsa:cfg-loopexit (bool) Whether or not the end of the loop information should be included in the CFG. (default: false) clangsa:unroll-loops (bool) Whether the analysis should try to unroll loops with known bounds. (default: false) clangsa:widen-loops (bool) Whether the analysis should try to widen loops. (default: false) ``` -------------------------------- ### Build and Install CodeChecker Package Source: https://codechecker.readthedocs.io/en/latest/install_macosx Builds and installs a CodeChecker package after dependencies and source code are set up. This command generates the necessary build artifacts. ```bash # Build and install a CodeChecker package. make package ``` -------------------------------- ### CodeChecker CLI: Create Filter Preset Example Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Demonstrates how to create a new filter preset using the 'CodeChecker cmd filter-preset new' command. This example shows creating a preset that filters analysis results by severity levels 'critical' and 'high'. ```bash # Create a minimal preset that filters by severity: CodeChecker cmd filter-preset new \ --name "high_and_critical" \ --url \ --severity critical high ``` -------------------------------- ### Clang Include Path Example Source: https://codechecker.readthedocs.io/en/latest/analyzer/gcc_incompatibilities This output shows the include search paths used by Clang when preprocessing C code, highlighting differences from GCC's paths. ```text $ clang -E -x c -v - ... #include <...> search starts here: /usr/local/include /usr/lib/llvm-4.0/bin/../lib/clang/4.0.0/include /usr/include/x86_64-linux-gnu /usr/include ``` -------------------------------- ### Apply analyzer configuration Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Example of enabling loop unrolling during an analysis run. ```bash CodeChecker analyze build.json \ --analyzer-config clangsa:unroll-loops=true \ -o reports ``` -------------------------------- ### Example source file for analysis Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide A sample C++ file containing a division by zero bug, used to demonstrate the parsing output. ```cpp #define DIV(x, y) x / y int foo(int p) { // codechecker_confirmed [core.DivideZero] This is a bug. return DIV(1, p); } int main() { return foo(0); } ``` -------------------------------- ### Install PostgreSQL Packages and Python Development Headers Source: https://codechecker.readthedocs.io/en/latest/web/postgresql_setup Installs required PostgreSQL packages and Python development headers for PostgreSQL support. Ensure you are running this on an Ubuntu LTS system. ```bash sudo apt-get install libpq-dev postgresql \ postgresql-client-common postgresql-common \ python-dev ``` -------------------------------- ### Clang-Tidy YAML Configuration Source: https://codechecker.readthedocs.io/en/latest/analyzer/checker_and_analyzer_configuration Example of a .clang-tidy configuration file using YAML format. ```yaml --- Checks: 'clang-diagnostic-*,clang-analyzer-*' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false CheckOptions: - key: google-readability-braces-around-statements.ShortStatementLines value: '1' - key: modernize-loop-convert.MaxCopySize value: '16' - key: modernize-loop-convert.NamingStyle value: CamelCase - key: modernize-use-nullptr.NullMacros value: 'NULL' ... ``` -------------------------------- ### Clang-Tidy JSON Configuration Source: https://codechecker.readthedocs.io/en/latest/analyzer/checker_and_analyzer_configuration Example of a .clang-tidy configuration file using JSON format. ```json { "Checks": "clang-diagnostic-*,clang-analyzer-*", "WarningsAsErrors": "", "HeaderFilterRegex": "", "AnalyzeTemporaryDtors": false, "CheckOptions": [ { "key": "google-readability-braces-around-statements.ShortStatementLines", "value": "1" }, { "key": "modernize-loop-convert.MaxCopySize", "value": "16" }, { "key": "modernize-loop-convert.NamingStyle", "value": "CamelCase" }, { "key": "modernize-use-nullptr.NullMacros", "value": "NULL" } ] } ``` -------------------------------- ### Full Development Cycle Example Source: https://codechecker.readthedocs.io/en/latest/usage This sequence demonstrates a typical development cycle including checking, fixing issues, and performing incremental analysis using a skip list. It assumes a clean state and `compile_commands.json`. ```bash CodeChecker check --build "make" --output ./reports --enable sensitive CodeChecker fixit --checker-name bugprone-suspicious-string-compare \ --apply ./reports CodeChecker check --ignore skip.list --output ./reports --enable sensitive \ --logfile ./compile_commands.json ``` -------------------------------- ### View token generation command help Source: https://codechecker.readthedocs.io/en/latest/web/authentication Display the usage instructions and available options for the token creation command. ```text usage: CodeChecker cmd token new [-h] [--description DESCRIPTION] [--url SERVER_URL] [--verbose {info,debug,debug_analyzer}] NAME Creating a new personal access token. positional arguments: NAME A unique name that identifies the access token. options: -h, --help show this help message and exit --description DESCRIPTION A custom textual description to be shown alongside the token. common arguments: --url SERVER_URL The URL of the server to access, in the format of '[http[s]://]host:port'. (default: localhost:8001) --verbose {info,debug_analyzer,debug} Set verbosity level. ``` -------------------------------- ### CodeChecker diff command examples Source: https://codechecker.readthedocs.io/en/latest/web/diff Examples of using the CodeChecker diff command to compare analysis runs. ```bash CodeChecker cmd diff -b run1 -n run2 --new ``` ```bash CodeChecker cmd diff -b run1 -n /my_report_dir --new ``` ```bash CodeChecker cmd diff -b run1 -n run2 --unresolved --severity high medium ``` ```bash CodeChecker cmd diff -b /reports.baseline -n /my_report_dir --new ``` -------------------------------- ### Define example.cpp for initial analysis Source: https://codechecker.readthedocs.io/en/latest/web/diff Initial C++ source file containing code that triggers DivideZero and DeadStores checkers. ```cpp // example.cpp int foo(int z) { if (z == 0) return 1 / z; // report by core.DivideZero return 0; } int bar(int x) { int y; y = x % 2; // report by deadcode.DeadStores return x % 2; } ``` -------------------------------- ### C++ Example Code Source: https://codechecker.readthedocs.io/en/latest/web/diff This C++ code contains examples of potential bugs that CodeChecker can detect, such as division by zero and dead code. ```cpp // example.cpp int foo(int z) { if (z == 0) return 1 / z; // report by core.DivideZero return 0; } int bar(int x) { int y; y = x % 2; // report by deadcode.DeadStores return x % 2; } ``` ```cpp // example.cpp int foo(int z) { if (z != 0) return 1 / z; // no reports return 0; } int bar(int x) { int y; y = x % 2; // report by deadcode.DeadStores return x % 2; } void baz(int *p) { if (!p) *p = 0; // report by core.NullDereference } ``` -------------------------------- ### Analysis Report Example Source: https://codechecker.readthedocs.io/en/latest/usage Example of an analysis report showing a division by zero error, including severity, file, line number, and steps. ```text [HIGH] .../docs/examples/src/divide.c:5:22: Division by zero [core.DivideZero] return numerator / denominator; ^ Report hash: 0865bada8cc2c49d99f981d8c6484bd7 Steps: 1, main.c:17:44: Passing the value 0 via 2nd parameter 'denominator' 2, main.c:17:26: Calling 'divide' 3, divide.c:3:1: Entered call from 'main' 4, divide.c:5:22: Division by zero Found 1 defect(s) in divide.c ``` -------------------------------- ### Enable server debug logging at startup Source: https://codechecker.readthedocs.io/en/latest/logging Set the log level during the initial server launch. ```bash Codechecker server ... --verbose debug ``` -------------------------------- ### C++ Code Example with Suppressions Source: https://codechecker.readthedocs.io/en/latest/web/diff This C++ code demonstrates source code suppressions for static analysis checkers and includes examples of potential reports. ```cpp // example.cpp int foo(int z) { if (z != 0) return 1 / z; // no reports return 0; } int bar(int x) { int y; // codechecker_false_positive [all] suppress all checker results y = x % 2; // report by deadcode.DeadStores return x % 2; } void baz(int *p) { if (!p) *p = 0; // report by core.NullDereference } ``` -------------------------------- ### Install Node.js for web dependencies Source: https://codechecker.readthedocs.io/en/latest Installs Node.js version 16.x using NodeSource repository, required for CodeChecker's web components. Refer to official Node.js documentation for other distributions. ```bash # Install nodejs dependency for web. In case of Debian/Ubuntu you can use the # following commands. For more information see the official docs: # https://nodejs.org/en/download/package-manager/ curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs ``` -------------------------------- ### Configure Analyzer with Verbatim Arguments File Source: https://codechecker.readthedocs.io/en/latest/analyzer/checker_and_analyzer_configuration This example shows how to use a configuration file to pass verbatim command-line arguments to the clang driver for the Clang Static Analyzer. This is useful for enabling debug or hidden checkers. ```bash CodeChecker analyze --analyzer-config clangsa:cc-verbatim-args-file=args.cfg \ compile_commands.json ``` -------------------------------- ### Plist Report Annotation Example Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide An example of a .plist file structure extended with a 'report-annotation' section. This section allows custom labels like 'testcase', 'timestamp', and 'chronological_order' for dynamic analysis reports. ```xml diagnostics category unknown check_name UndefinedBehaviorSanitizer description ... issue_hash_content_of_line_in_context ... location ... **report-annotation testcase yhegalkoei timestamp 1970-04-26T17:27:55 chronological_order 42 ** path ... ``` -------------------------------- ### Create PostgreSQL User and Databases for CodeChecker Source: https://codechecker.readthedocs.io/en/latest/web/postgresql_setup Sets up a dedicated PostgreSQL user and databases for CodeChecker. This involves switching to the postgres user, creating a new user with a password prompt, creating configuration and product databases, and granting privileges. ```bash # Switch to this daemon user. sudo -i -u postgres # Create a new user to be used for connecting to the database. # (The password will be prompted for, and read from the standard input.) createuser --login --pwprompt codechecker # Create the configuration database for CodeChecker. createdb codechecker_config # The newly created user must have privileges on its own database. psql -c "GRANT ALL PRIVILEGES ON DATABASE codechecker_config TO codechecker;" # Return to your normal shell via: exit ``` -------------------------------- ### Install mandatory dependencies for CodeChecker on Ubuntu Source: https://codechecker.readthedocs.io/en/latest Installs essential dependencies for building and analyzing code with CodeChecker on Ubuntu 20.04 LTS. Ensure Clang, Clang-Tidy, Cppcheck, and GCC versions meet the minimum requirements. ```bash # Install mandatory dependencies for a development and analysis environment. # NOTE: clang or clang-tidy can be any sufficiently fresh version, and need not # come from package manager! # In case of Cppcheck, the minimal supported version is 1.80. # In case of gcc, the minimal supported version is 13.0.0. # Infer: https://fbinfer.com/docs/getting-started sudo apt-get install clang clang-tidy cppcheck g++ build-essential curl \ gcc-multilib git python3-dev python3-venv python3-setuptools ``` -------------------------------- ### Using quadmath.h with Clang Source: https://codechecker.readthedocs.io/en/latest/analyzer/gcc_incompatibilities Demonstrates how to compile C code with the quadmath library using Clang. Ensure GCC's intrinsic system include is added. Vector instructions may cause compilation failures. ```c clang -O0 -m32 -lquadmath -I /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/include float128.c ``` -------------------------------- ### Apply checker configuration Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Example of setting a specific threshold for a Clang-Tidy checker. ```bash CodeChecker analyze build.json \ --checker-config clang-tidy:google-readability-function-size.StatementThreshold=100 \ -o reports ``` -------------------------------- ### List Source Components Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Lists the name and basic information of source components added to the server. Supports various output formats. ```bash usage: CodeChecker cmd components list [-h] [--url PRODUCT_URL] [-o {plaintext,rows,table,csv,json}] [--verbose {info,debug,debug_analyzer}] ``` -------------------------------- ### Configure superuser in server_config.json Source: https://codechecker.readthedocs.io/en/latest/web/permissions Set the initial superuser during the first startup to enable administrative access via the web GUI. ```json "authentication": { "enabled" : true, "super_user" : "admin", ... ``` -------------------------------- ### C++ code for analysis Source: https://codechecker.readthedocs.io/en/latest/web/diff Example C++ code containing potential bugs for static analysis. ```cpp // example.cpp int foo(int z) { if (z == 0) return 1 / z; // report by core.DivideZero return 0; } int bar(int x) { int y; y = x % 2; // report by deadcode.DeadStores return x % 2; } ``` -------------------------------- ### Execute build and analysis in one step Source: https://codechecker.readthedocs.io/en/latest/usage Combines build logging and analysis into a single command using the check utility. ```bash cd /docs/examples make clean CodeChecker check --build "make" --output ./reports --clean \ --enable sensitive ``` ```bash CodeChecker check --jobs 22 --build "make clean ; make --jobs 22" \ --output ./reports --clean --enable sensitive ``` -------------------------------- ### Clang-Tidy Verbatim Arguments File Source: https://codechecker.readthedocs.io/en/latest/analyzer/checker_and_analyzer_configuration Example of a file content used with the clang-tidy:cc-verbatim-args-file option. ```text -config="{ ... single line with lots of JSON .. }" ``` -------------------------------- ### Configure PostgreSQL Password File Source: https://codechecker.readthedocs.io/en/latest/web/postgresql_setup Sets up the PGPASSFILE environment variable and creates a .pgpass file for secure password authentication. Ensure the file has restricted permissions (0600). ```bash # PGPASSFILE environment variable should be set to a 'pgpass' file. # For format and further information see PostgreSQL documentation: # http://www.postgresql.org/docs/current/static/libpq-pgpass.html echo "*:5432:*:codechecker:my_password" >> ~/.pgpass chmod 0600 ~/.pgpass ``` -------------------------------- ### GET /history Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Lists the specific storage events that occurred during storage processes for analysis runs. ```APIDOC ## GET /history ### Description Show run history for analysis runs, listing storage events that occurred during storage processes. ### Method GET ### Endpoint /history ### Parameters #### Query Parameters - **--name** (string) - Optional - Names of the analysis runs to show history for. Supports * wildcards. ``` -------------------------------- ### List analyzer configuration options Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Use this command to view available configuration options for a specific analyzer. ```bash CodeChecker analyzers --analyzer-config --details ``` -------------------------------- ### Manage server database schema upgrades Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Use these arguments to check database status or perform schema migrations. Ensure the workspace and configuration arguments match those used to start the server. ```text Database management arguments.: WARNING these commands needs to be called with the same workspace and configuration arguments as the server so the configuration database will be found which is required for the schema migration. Migration can be done without a running server but pay attention to use the same arguments which will be used to start the server. NOTE: Before migration it is advised to create a full a backup of the product databases. --status STATUS Name of the product to get the database status for. Use 'all' to list the database statuses for all of the products. --upgrade-schema PRODUCT_TO_UPGRADE Name of the product to upgrade to the latest database schema available in the package. Use 'all' to upgrade all of the products.NOTE: Before migration it is advised to create a full backup of the product databases. --db-force-upgrade Force the server to do database migration without user interaction. NOTE: Please use with caution and before automatic migration it is advised to create a full backup of the product databases. ``` -------------------------------- ### CodeChecker server command Source: https://codechecker.readthedocs.io/en/latest/web/user_guide Starts the CodeChecker Web server to handle storage and navigation of analysis results. ```APIDOC ## CodeChecker server ### Description Starts the CodeChecker Web server to handle the storage and navigation of analysis results. The server can be accessed via a web browser or the CodeChecker command-line client. ### Parameters #### Optional Arguments - **-w, --workspace** (string) - Directory where CodeChecker stores analysis result data. - **-f, --config-directory** (string) - Directory for server-specific configuration files. - **--machine-id** (string) - Unique identifier for the machine running the server process. - **--api-handler-processes** (integer) - Number of API request handler processes. - **--task-worker-processes** (integer) - Number of task worker processes for report storage. - **--host** (string) - IP address or hostname to listen on (default: localhost). - **-v, -p, --port** (integer) - Port to listen on (default: 8001). - **--not-host-only** (boolean) - Allows access over the network beyond localhost. - **--skip-db-cleanup** (boolean) - Skips database cleanup tasks. - **--config** (string) - Path to an explicit configuration file. ``` -------------------------------- ### Display plist-to-html help Source: https://codechecker.readthedocs.io/en/latest/tools/report-converter View the command-line interface options for the plist-to-html tool. ```bash usage: plist-to-html [-h] -o OUTPUT_DIR [-l LAYOUT_DIR] file/folder [file/folder ...] Parse and create HTML files from one or more '.plist' result files. positional arguments: file/folder The plist files and/or folders containing analysis results which should be parsed. optional arguments: -h, --help show this help message and exit -o OUTPUT_DIR, --output OUTPUT_DIR Generate HTML output files in the given folder. (default: None) -l LAYOUT_DIR, --layout LAYOUT_DIR Directory which contains dependency HTML, CSS and JavaScript files. (default: plist_to_html/../static) ``` -------------------------------- ### Overriding checker configuration Source: https://codechecker.readthedocs.io/en/latest/analyzer/user_guide Example of chaining enable and disable flags where subsequent flags override previous ones. ```bash --enable extreme --disable core.uninitialized --enable core.uninitialized.Assign ``` -------------------------------- ### Send log configuration to running server Source: https://codechecker.readthedocs.io/en/latest/logging Apply a new configuration file to a server running on the specified port. ```bash ./send_log_config.py -c new_log_cfg.conf -p 8888 ```