-tminimum, --threshold=minimum Reporting threshold. This option takes an integer number as its
argument. The default minimum for this option is:
30
Ignore any procedures with a complexity measure below this threshold. By default, a complexity score of
under 30 is not printed. However, if a histogram and statistics are to be printed, but not individual
procedure scores, then the default is set to zero. Procedures below this limit are not counted in the
statistics.
--horrid-threshold=minimum zero exit threshold. This option takes an integer number as its argument.
The default minimum for this option is:
100
If any procedures score higher than this threshold, then the program will exit non-zero.
(4/COMPLEX_EXIT_HORRID_FUNCTION, if no other problems are encountered.) By default, this program exits
zero unless one function exceeds the horrid score of 100.
-nfactor, --nesting-penalty=factor score multiplier for nested code.
Linguistic constructs weigh more heavily the more deeply nested they are. By default, each layer
penalizes by a factor of 1.9. The option argument is a floating point number. The penalty may be 1, but
not less.
--demi-nesting-penalty=factor score multiplier for nested expressions.
By default, this value is halfway between 1.0 and the nesting penalty (specifically, the square root of
the nesting penalty). It refers to a parenthesized sub-expression. e.g.
((a > b) && (c > d))
contains two parenthesized sub-expressions. This would count 3.5 points. On the other hand, this:
(a > b && c > d)
contains two relation operators and a logical operator at the same level. These nested counts will be
multiplied together and yield 2.5*2.5, or 6.25. Don't do that. It gets even worse if you have logical
ands and ors at the same level.
-sfactor, --scale=factor complexity scaling factor. This option takes an integer number as its
argument.
By default, the scaling is 20 which divides the raw score by 20. This was normalized to roughly
correspond to the pmccabe scores:
0-9 Easily maintained code.
10-19 Maintained with little trouble.
20-29 Maintained with some effort.
30-39 Difficult to maintain code.
40-49 Hard to maintain code.
50-99 Unmaintainable code.
100-199 Crazy making difficult code.
200+ I only wish I were kidding.
Score | ln-ct | nc-lns| file-name(line): proc-name
4707 3815 2838 lib/vasnprintf.c(1747): VASNPRINTF
-h, --histogram, --no-histogram Display histogram of complexity numbers. The no-histogram form will
disable the option. This option may not be preset with environment variables or in initialization (rc)
files.
Instead of printing out each function's score, a summary is printed at the end showing how many functions
had particular ranges of scores. Unless --scores is specifically called out, the scores will not print
with this option specified. The minimum scoring threshold will also be reduced to zero (0), unless
--threshold is specified.
-c, --scores, --no-scores Display the score for each procedure. The no-scores form will disable the
option. This option may not be preset with environment variables or in initialization (rc) files.
If you specify --histogram, individual scores will not be displayed, unless this option is specified.
-Istring, --ignore=string procedure name to be ignored. This option may appear an unlimited number of
times.
Some code has macros defined that confuse the lexical analysis. This will cause them to be ignored.
Other ways to cause functions to be ignored are:
Use K&R syntax for a procedure header.
Use a preprocessing macro to assemble the procedure header.
Simplify your code.
Generally speaking, anything you do that alters normal C syntax will confuse the lexical analysis. If a
procedure is not seen, then it will not get counted. If code within a procedure is incomprehensible, you
will likely get inappropriate results.
-H, --no-header do not print scoring header. This option may not be preset with environment variables or
in initialization (rc) files.
If a script is going to process the scoring output, parsing is easier without a header. The histogram
output will always have a header.
-uunifdef-opt, --unifdef=unifdef-opt Run the source(s) through unifdef(1BSD). This option may appear an
unlimited number of times.
Strip out sections of code surrounded by #if/#endif directives. The option argument is passed as an
argument to the unifdef(1BSD) program. For example:
complexity -u-Dsymbol
would cause symbol to be defined and remove sections of code preceded by #ifndefsymbol directives.
Please see the unifdef documentation for more information.
--unif-exe=prog Specify the unifdef program.
Alternate program to use for unifdef-ing the input.
-ifile-name, --input=file-name file of file list.
Instead of either a command line list of input files or reading them from standard input, read the list
of files from this file.
--trace=file-name trace output file.
Print intermediate scores to a trace file.
-?, --help Display usage information and exit.
-!, --more-help Pass the extended usage information through a pager.
-> [cfgfile], --save-opts [=cfgfile] Save the option state to cfgfile. The default is the last
configuration file listed in the OPTIONPRESETS section, below. The command will exit after updating the
config file.
-<cfgfile, --load-opts=cfgfile, --no-load-opts Load options from cfgfile. The no-load-opts form will
disable the loading of earlier config/rc/ini files. --no-load-opts is handled early, out of order.
-v [{v|c|n--version [{v|c|n}]}] Output version of program and exit. The default mode is `v', a simple
version. The `c' mode will print copyright information and `n' will print the full copyright notice.
OPTIONPRESETS
Any option that is not marked as notpresettable may be preset by loading values from
configuration ("RC" or ".INI") file(s) and values from environment variables named:
COMPLEXITY_<option-name> or COMPLEXITY
The environmental presets take precedence (are processed later than) the configuration files. The
homerc files are "$@/complex.conf", "$HOME", "$PROJECT_ROOT/complex.conf", and ".". If any of
these are directories, then the file .complexityrc is searched for within those directories.