GNATMETRIC(1)
π GNATMETRIC(1) β Ada metrics tool
okay bestie, welcome to the ASIS Tools corner of the man pages, where we count things in Ada code and feel β¨ something β¨ about it. This is gnatmetric, and she is literally the metrics girlie of the GNAT fam. π
π¦ NAME π¦
gnatmetric β the Ada metrics tool. she computes. she counts. she serves numbers. periodt.
πΈ SYNOPSIS πΈ
gnatmetric [options] {filename | -files filename} [gcc_switches]
β¨ DESCRIPTION β¨
so basically, gnatmetric takes a whole set of compilable Ada sources as input, computes a bunch of programming metrics for them, and then generates the output. that's it, that's the job, and she does it flawlessly. π
you can hand her the Ada sources two ways:
- just drop them straight in as command line arguments, or
- put the names of the Ada sources you want metrics for into a textual file, and then pass the name of that file as the parameter of the
-filesoption.
also, Documentation about the ASIS tools may be found in /usr/share/doc/asis-doc/ β but only if the asis-doc package is installed. if it's not installed, no docs for you bestie, go install it. π
π OPTIONS π
-vβ verbose mode. she talks a lot. we love that for her.-qβ quiet mode. she goes silent. mysterious. iconic.-dvβ generate debug output.-ddβ generate a string to be used as input for a progress indicator. it's giving loading screen energy. π-noccβ do not compute the McCabe Cyclomatic Complexity.-noecβ do not compute the Essential Complexity.-nonlβ do not compute the maximal loop nesting level.-neβ do not considerexitstatements as gotos when computing Essential Complexity.-nolocalβ do not compute detailed metrics for local program units.
π Line metrics π
here's the vibe check: when you don't specify any of these explicitly, all line metrics are set on. but if you do specify some, then only the ones you specified get computed. choose wisely bestie. β¨
-laβ the number of all lines.-lcodeβ the number of code lines.-lcommβ the number of comment lines.-leolβ the number of code lines that also contain comments. multitasking lines, we stan. π-lbβ the number of blank lines.
π Element metrics π
same rule, different section: not specified explicitly = all element metrics are on. specify some = only those get computed. π
-edβ the total number of declarations.-esβ the total number of statements.-epsβ the number of public subprograms in a compilation unit.-easβ the number of all the subprograms in a compilation unit.-eptβ the number of public types in a compilation unit.-eatβ the number of all the types in a compilation unit.-enuβ the maximal program unit nesting level.-ecβ the maximal construct nesting level.
π¦ Output file control π¦
-ddirname β put files with detailed metrics into dirname.-xβ generate the XML output. slay.-ntβ do not generate the output in text form. this implies-x.-ofile-suffix β the suffix for the file to put the detailed metrics for a source file. heads up: file-suffix should begin with a dot.-ogfilename β the name of the file to put the global metrics info into. if it's not set, this info is sent toStdout.-oxfilename β the name of the file to put the XML output into. this implies-x.-sfnβ use short source file name in the output.
π Input files π
- filename β the name of the Ada source file for which metrics should be computed. Wildcards are allowed, so go wild. π₯
-filesfilename β the name of the text file containing a list of Ada source files for which metrics should be computed.
π GCC switches π
- gcc_switches β passed to
gnatgccas"-cargs gcc_switches".
π SEE ALSO π
gnat(1), asistant(1), gnat2xml(1), gnatcheck(1), gnatelim(1), gnatpp(1), gnatstub(1), gnattest(1)
Documentation about the ASIS tools may be found in /usr/share/doc/asis-doc/ if the asis-doc package is installed. The reference documentation about ASIS is excluded due to license problems, but may be found in various formats at http://libre.adacore.com/developers/documentation. (iykyk π«Ά)
ok that's the whole page bestie, every flag accounted for, no cap. now go compute some metrics and be the main character of your codebase. π β¨
Debian GNU/Linux Β· 2014-08-09 Β· GNATMETRIC(1) β mwah, signing off ππ
π¦ where this page comes from
- ubuntu jammy: asis-programs 2019-5 Β· GPL-3.0-or-later
- Copyright (C) 2006 Ludovic Brenta <ludovic@ludovic-brenta.org>
- Copyright (C) 2014 Nicolas Boulenguez <nicolas@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms