15.1.2 Disable Metrics For Local Units

gnatmetric relies on the GNAT compilation model −
one compilation
unit per one source file. It computes line metrics for the whole source
file, and it also computes syntax
and complexity metrics for the file's outermost unit.

By default, gnatmetric will also compute all metrics for certain
kinds of locally declared program units:

subprogram (and generic subprogram) bodies;

package (and generic package) specs and bodies;

task object and type specifications and bodies;

protected object and type specifications and bodies.

These kinds of entities will be referred to as
eligible local program units, or simply eligible local units,
in the discussion below.

Note that a subprogram declaration, generic instantiation,
or renaming declaration only receives metrics
computation when it appear as the outermost entity
in a source file.

Suppression of metrics computation for eligible local units can be
obtained via the following switch: