@@ -19,8 +19,8 @@ CodeChecker itself is a python package available on `pypi <https://pypi.org/proj
1919
2020 pip install codechecker
2121
22- Running with CodeChecker
23- ************************
22+ Building with CodeChecker
23+ *************************
2424
2525To run CodeChecker, :ref: `west build <west-building >` should be
2626called with a ``-DZEPHYR_SCA_VARIANT=codechecker `` parameter, e.g.
@@ -33,56 +33,63 @@ called with a ``-DZEPHYR_SCA_VARIANT=codechecker`` parameter, e.g.
3333 Configuring CodeChecker
3434***********************
3535
36- To configure CodeChecker or analyzers used, arguments can be passed using the
37- ``CODECHECKER_ANALYZE_OPTS `` parameter, e.g.
38-
39- .. code-block :: shell
40-
41- west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=codechecker \
42- -DCODECHECKER_ANALYZE_OPTS=" --config;$CODECHECKER_CONFIG_FILE ;--timeout;60"
43-
44-
45- Storing CodeChecker results
46- ***************************
47-
48- If a CodeChecker server is active the results can be uploaded and stored for tracking purposes.
49- Storing is done using the optional ``CODECHECKER_STORE=y `` or ``CODECHECKER_STORE_OPTS="arg;list" ``
50- parameters, e.g.
51-
52- .. code-block :: shell
53-
54- west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=codechecker \
55- -DCODECHECKER_STORE_OPTS=" --name;build;--url;localhost:8001/Default"
56-
57- .. note ::
58-
59- If ``--name `` isn't passed to either ``CODECHECKER_ANALYZE_OPTS `` or ``CODECHECKER_STORE_OPTS ``,
60- the default ``zephyr `` is used.
61-
62-
63- Exporting CodeChecker reports
64- *****************************
65-
66- Optional reports can be generated using the CodeChecker results, when passing a
67- ``-DCODECHECKER_EXPORT=<type> `` parameter. Allowed types are: ``html,json,codeclimate,gerrit,baseline ``.
68- Multiple types can be passed as comma-separated arguments.
69-
70- Optional parser configuration arguments can be passed using the
71- ``CODECHECKER_PARSE_OPTS `` parameter, e.g.
72-
73- .. code-block :: shell
74-
75- west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=codechecker \
76- -DCODECHECKER_EXPORT=html,json -DCODECHECKER_PARSE_OPTS=" --trim-path-prefix;$PWD "
77-
78- Failing the build on CodeChecker issues
79- ***************************************
80-
81- By default, CodeChecker identified issues will not fail the build, only generate
82- a report. To fail the build if any issues are found (for example, for use in
83- CI), pass the ``CODECHECKER_PARSE_EXIT_STATUS=y `` parameter, e.g.
84-
85- .. code-block :: shell
86-
87- west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=codechecker \
88- -DCODECHECKER_PARSE_EXIT_STATUS=y
36+ CodeChecker uses different command steps, each with their respective configuration
37+ parameters. The following table lists all these options.
38+
39+ .. list-table ::
40+ :header-rows: 1
41+
42+ * - Parameter
43+ - Description
44+ * - ``CODECHECKER_ANALYZE_JOBS ``
45+ - The number of threads to use in analysis. (default: <CPU count>)
46+ * - ``CODECHECKER_ANALYZE_OPTS ``
47+ - Arguments passed to the ``analyze `` command directly. (e.g. ``--timeout;360 ``)
48+ * - ``CODECHECKER_CLEANUP ``
49+ - Perform a cleanup after parsing/storing. This will remove all ``plist `` files.
50+ * - ``CODECHECKER_CONFIG_FILE ``
51+ - A JSON or YAML file with configuration options passed to all commands.
52+ * - ``CODECHECKER_EXPORT ``
53+ - A comma separated list of report types. Allowed types are:
54+ ``html,json,codeclimate,gerrit,baseline ``.
55+ * - ``CODECHECKER_NAME ``
56+ - The CodeChecker run metadata name. (default: ``zephyr ``)
57+ * - ``CODECHECKER_PARSE_EXIT_STATUS ``
58+ - By default, CodeChecker identified issues will not fail the build, set this option to fail
59+ during analysis.
60+ * - ``CODECHECKER_PARSE_OPTS ``
61+ - Arguments passed to the ``parse `` command directly. (e.g. ``--verbose;debug ``)
62+ * - ``CODECHECKER_PARSE_SKIP ``
63+ - Skip parsing the analysis, useful if you simply want to store the results.
64+ * - ``CODECHECKER_STORE ``
65+ - Run the ``store `` command after analysis.
66+ * - ``CODECHECKER_STORE_OPTS ``
67+ - Arguments passed to the ``store `` command directly. Implies ``CODECHECKER_STORE ``.
68+ (e.g. ``--url;localhost:8001/Default ``)
69+ * - ``CODECHECKER_STORE_TAG ``
70+ - Pass an identifier ``--tag `` to the ``store `` command.
71+ * - ``CODECHECKER_TRIM_PATH_PREFIX ``
72+ - Trim the defined path from the analysis results, e.g. ``/home/user/zephyrproject ``.
73+ The value from ``west topdir `` is added by default.
74+
75+ These parameters can be passed on the command line, or be set as environment variables.
76+
77+
78+ Running twister with CodeChecker
79+ ********************************
80+
81+ When running CodeChecker as part of ``twister `` some default options are set as following:
82+
83+ .. list-table ::
84+ :header-rows: 1
85+
86+ * - Parameter
87+ - Value
88+ * - ``CODECHECKER_ANALYZE_JOBS ``
89+ - ``1 ``
90+ * - ``CODECHECKER_NAME ``
91+ - ``<board target>:<testsuite name> ``
92+ * - ``CODECHECKER_STORE_TAG ``
93+ - The value from ``git describe `` in the application source directory.
94+
95+ To override these values, set an environment variable or pass them as extra arguments.
0 commit comments