und is the command-line interface to Understand — script project creation, analysis, CodeCheck, metrics, and reports, locally or in CI.
Run Understand from the command line · Headless workflow: create, analyze, check, report
und report
generate reports
und report [-format <formats>] [-codecheck|-ent|-arch <target>] [-options <string>] "Report Name" <output>
The report command allows generation of interactive reports from the command line. It takes the report name and output file/directory.
The format(s) of the report is determined by the -format switch. Supported formats are: pdf, html, txt, csv, png. The csv and png formats are partial output formats that only apply to report tables and images respectively. So, for example, if a report had two images and two tables, the command:
und report -format pdf,csv,png "Report Name" out_directory
would produce the following five files:
out_directory/report.pdf
outdirectory/image0.png
out_directory/image1.png
outdirectory/table0.csv
out_directory/table1.csv
If the format switch is not provided, and the output name has the extension ".txt" or ".pdf", then the extension determines the output format. Otherwise, output must be an existing directory and the format is assumed to be html. Note that pdf and png formats require graphic libraries.
The report target is the database unless one of the following switches is given.
| Option | Description |
|---|---|
-codecheck sarif | Run the report on the inspection saved in the given sarif file. If no sarif file is given and codecheck was run in this same instance of und, use that inspection. Otherwise, use "My Violations" (the inspection shown in the Violation Browser and Editor). A second argument can be given to create a report from an inspection diff: -codecheck current.sarif previous.sarif |
-ent uniquename | Run the report on the entity with the given unique name |
-arch longname | Run the report on the architecture with the given long name. |
Report options can be given with the options switch. The options string is a sequence of semicolon separated key=value pairs
| Option | Description |
|---|---|
-options optionsstring | Set report options. |
Examples
Print "API Info" interactive report for Fastgrep's chimaera function:
und report -ent @lchimaera@kchimaera@f./egrep.c "API Info" \
out.pdf fastgrep.und
Print a html codecheck report from the inspection just run.
und -db fastgrep.und codecheck "MISRA C 2012" outdir \
report -codecheck -options "Show Violations Chart=False" \
"Results By File Report" outdir/byfile
To generate multiple reports, give the report subcommand multiple times:
und -db myproject.und report "My IReport" out1.pdf \
report "Another Name" out2.pdf report "A third name" out3.pdf
If no arguments are provided to the report command, the legacy behavior of generating the project reports is kept. It uses the current report settings, which can be viewed by using the list command (und list -reports settings) and changed using the settings command (see und help settings). The command could look like this
und report myProject.und