NAME
cca - Analyzes C conditional compilation logic and outputs a summary
report of metrics and a graphical representation of the logic.
SYNOPSIS
Normal usage
cca [options] -f infile
To get the usage statement
cca [-h|-help |-?]
DESCRIPTION
cca takes input from a C source file infile and analyzes the
complexity of the conditional compilation logic in that file. The
output of the program is a summary report containing complexity
metrics (written to outfile) and a graphical structure chart of the
logic (written to graphfile).
The summary report contains the total lines of code in the file, the
number of lines of conditional control logic, McCabe's V(g) and V'(g)
for the conditional control logic, a list and the number of
conditional directives used, a list and the number of names and
constant expressions used, and a comprehensive listing of the
conditional logic.
The structure chart shows the "name" and/or constant expression used
at each conditional node, which line number the #directive is on, and
the number of lines of code. The numbers at the top of each graphical
output page indicate page ordering. The numbers are in the form
(X,Y), where X and Y are cartesion coordinates starting at (0,0). X
grows to the right, and Y grows downward.
OPTIONS
All non-conflicting options will be used. If there are any
conflicting options, the last one specified will be used.
-C (Default) Output comprehensive listing of conditional compilation
directives with their associated line numbers and expressions.
-c Do not output comprehensive listing (see -C option).
-D Output a list of the unique conditional directives used and the
number of times each one is used.
-d (Default) Do not output conditional directives list (see -D
option).
-E Output a list of the unique expressions used and the number of
times each one is used.
-e (Default) Do not output expressions list (see -E option).
-L (Default) Output total number of lines of code in the input file.
-l Do not output total number of lines of code (see -L option).
-T (Default) Output number of lines of conditional compilation
logic.
-t Do not output number of lines of conditional compilation logic
(see -T option).
-V (Default) Output McCabe's V(g) and V'(g) for the conditional
compilation logic.
-v Do not output McCabe's V(g) and V'(g) (see -V option).
-o outfile
outfile is the file to write the summary report to. If it is not
specified, the report is written to STDOUT.
-g[p|1|2|4|8|16] graphfile
graphfile is the file to write the graphical structure chart to.
This is a PostScript file. The options p, 1, 2, 4, 8, and 16
specify what scaling is desired for the graphical output. p
designates "page" scaling, where the entire output will be scaled
to fit on one 8.5"x11" page. This is the default scale. 1
designates a scaling of .125" square graphical blocks which
yields 64x80 (XxY) blocks per page. 2 designates .25" blocks
with 32x40 blocks per page. 4 designates .5" blocks with 16x20
blocks per page. 8 designates 1" blocks with 8x10 blocks per
page. 16 designates 2" blocks with 4x5 blocks per page. If this
option is not used, no graphical output will be generated.
EXAMPLES
The standard call to cca will specify an input file, use the default
flags, and output the summary report to STDOUT:
cca -f foo.c
or the summary report can be written to a file foo.out:
cca -o foo.out -f foo.c
The contents of the summary report can be changed by choosing flags
explicitly. The following example will print only the listing of
unique expressions:
cca -cdEltv -f foo.c
To generate the graphical structure chart, specify the name of the
PostScript file to write to and the scale factor to be used. The
following example will scale the chart to fit on one page and print it
to the file foo.ps:
cca -gp foo.ps -f foo.c
SEE ALSO
The CCA Software Support Document and CCA User's Manual are
distributed with the program. The support document gives an in-depth
description of the program and all its components. The user's manual
gives an overview of the program and the user interface.
AUTHORS
Charles Cary, Jason Evans, Sean Jones, and Noah Sutherland, Department
of Computer Science, University of Idaho, Moscow, ID 83843.
{cary8741|evans911|jone9333|suthe922}@cs.uidaho.edu.