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 metrics

generates project metrics

The metrics command can be run in several ways:

1) Generate Project Metrics

This is the default. It generates the project metrics. It does not take any arguments. It uses the current metrics settings, which can be viewed using the list command (und list -metrics settings) and changed using the settings command (see und help settings). It could look like this.

und metrics myProject.und
metrics   (Interactive Mode)

2) Generate Architecture Metrics

This generates metrics for a specific architecture. It takes in the name of an architecture, and the output file name (optional). The general format is und metrics -arch outputFile archName. If an output file is not specified, the output file will be in the directory where the database is and be named archname_metrics.csv. The command could look like this.

und metrics -arch myArch
metrics outputFile.csv myArch    (Interactive Mode)

3) Generate HTML Metrics

Generate an HTML report of the metrics. By default, all architectures are listed in the report. Multiple architectures may be specified. The name(s) of any desired architectures are optional. The output directory name is also optional. The general format is und metrics -html archName1 archName2 outDir. If an output directory is not specified, the output directory will be in the directory where the database is and be named projname_metrics. The command could look like this.

und metrics -html archName1 archName2 c:\Directory
metrics -html outputdirectory    (Interactive Mode)

4) Output summary metrics to standard out

By default, this lists the metric name and value, one metric per line. The -csv switch changes the format to a comma separated list of metric names on the first line and a comma spearated list of metric values on the second line. The command could look like this.

und metrics -summary project.und
metrics -summary -csv (Interactive Mode)