Next: , Up: Switches for gnatmetric

14.1.1 Output File Control

gnatmetric has two output formats. It can generate a textual (human-readable) form, and also XML. By default only textual output is generated.

When generating the output in textual form, gnatmetric creates for each Ada source file a corresponding text file containing the computed metrics, except for the case when the set of metrics specified by gnatmetric parameters consists only of metrics that are computed for the whole set of analyzed sources, but not for each Ada source. By default, this file is placed in the same directory as where the source file is located, and its name is obtained by appending the .metrix suffix to the name of the input file.

All the output information generated in XML format is placed in a single file. By default this file is placed in the current directory and has the name metrix.xml.

Some of the computed metrics are summed over the units passed to gnatmetric; for example, the total number of lines of code. By default this information is sent to stdout, but a file can be specified with the -og switch.

The following switches control the gnatmetric output:

Generate the XML output

Generate the XML output and the XML schema file that describes the structure of the XML metric report, this schema is assigned to the XML file. The schema file has the same name as the XML output file with .xml suffix replaced with .xsd

Do not generate the output in text form (implies -x)

-d output_dir
Put textual files with detailed metrics into output_dir

-o file_suffix
Use file_suffix, instead of .metrix in the name of the output file.

-og file_name
Put global metrics into file_name

-ox file_name
Put the XML output into file_name (also implies -x)

Use “short” source file names in the output. (The gnatmetric output includes the name(s) of the Ada source file(s) from which the metrics are computed. By default each name includes the absolute path. The -sfn switch causes gnatmetric to exclude all directory information from the file names that are output.)