Skip to content

Headless workflow — create, analyze, check, report

A complete, GUI-free pipeline. Each step is a und command against one .und database.

DB=myProject.und

# 1. Create the database (accepts the same settings as `und settings`)
und -db $DB create -languages c++

# 2. Add source — a directory, or a CMake compilation database for accuracy
und -db $DB add /path/to/src
#   or: und -db $DB add -cmake /path/to/build/compile_commands.json

# 3. Configure (any project setting; see settings-and-filters)
und -db $DB settings -C++AddFoundFilesToProject on

# 4. Analyze
und -db $DB analyze            # -all is default; use -changed for incremental

# 5. Check coding standards (see the CodeCheck CLI page)
und -db $DB codecheck -exitstatus -sarif out/results.sarif "MyConfig" out

# 6. Metrics and reports
und -db $DB metrics            # writes the project metrics CSV
und -db $DB report -format html "Data Dictionary" out/report

Notes

  • -local on create stores analysis data in the project's local folder (useful for sharing).
  • analyze -changed only reparses changed files — fast for CI on each commit (und analyze).
  • settings can change any project setting — see Configure settings & filters and the und settings reference.
  • codecheck options (SARIF, gating, scoping) are on the und codecheck reference page.
  • report takes a report name + output and -format pdf,html,txt,csv,png; scope it with -codecheck, -ent, or -arch (und report).
  • metrics uses the project's metric settings (view with und list -metrics settings) and writes a CSV by default; other modes are -html, -summary (add -csv for a CSV summary), -all, and per-architecture metrics with -arch <name> (und metrics).
  • C/C++ with no compile_commands.json? Capture the build first with Buildspy in CI.

To wire this into Jenkins with build gating, see Run CodeCheck in CI, and for the full pipeline picture, Run Understand in a CI pipeline.