scitools.com

← All und commands

und is the command-line interface to Understand — script project creation, analysis, CodeCheck, metrics, and reports, locally or in CI.

und analyze

analyzes the project files

The analyze command analyzes project files. By default, it analyzes all files. So, the command:

und analyze myProject.und

would analyze all files in myProject.und. Switches that control what is analyzed are:

OptionDescription
-allAnalyze all the files in the project, default.
-changedAnalyze only files that have changed since the last analyze.
-filesAnalyze only these files. Takes a list of files as an argument or a text file containing a list of all the files to add. The text file should have one file name per line, and start with a @. For example:
und analyze -files @someFile.txt

would analyze all the files contained in someFile.txt. Lines in the file starting with # will be ignored.

There are also switches to control the output. If any of these switches are used, then only the analysis summary and the values given by the switches are output. So

und analyze -errors myProject.und

will only output analysis errors and the summary line with error and warning totals. The switches are:

OptionDescription
-accuracyThe accuracy metric as shown on Project Overview Charts. This will appear after the summary.
-errorsAnalysis errors
-warningsAnalysis warnings
-progressAnalysis progress as a percentage.

The analysis errors and warnings can also be written to a file in SARIF (Static Analysis Results Interchange Format) JSON. The -sarif switch requires an output file:

OptionDescription
-sarif outputFileWrite the analysis errors and warnings to the given file in SARIF JSON format.
und analyze -sarif parselog.sarif myProject.und

Some examples of the command are:

und analyze myProject.und
und -db myProject.und analyze -changed
analyze -files file1.cpp file2.cpp file3.cpp    (Interactive mode)