This manual is for Complexity version 1.10, updated March 2016.

Copyright © 2011-2016 by Bruce Korb.

     Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

Measure complexity of C source
******************************

This file documents Complexity version 1.10.  It is a tool designed for analyzing the complexity of ``C'' program functions.  It is very similar to the McCabe scoring, but addresses several issues not considered in that scoring scheme.

This edition documents version 1.10, updated March 2016

     [file intro.texi not included]
     [file compute.texi not included]

Example Output
**************

This is a self-referential example. This output was obtained by going into the complexity source directory and running the command:

     complexity --histogram --score --thresh=3 *.c

The --threshold is set to three because all of the functions score below the default threshold of 30.  It is not zero because there are too many trivial (0, 1 or 2) functions for a short example.

This results in:

     Complexity Scores
     Score | ln-ct | nc-lns| file-name(line): proc-name
         3      19      16   tokenize.c(553): skip_params
         3      22      17   tokenize.c(79): check_quote
         3      28      21   score.c(105): handle_stmt_block
         3      33      21   opts.c(924): translate_option_strings
         3      27      22   tokenize.c(158): hash_check
         3      28      23   tokenize.c(121): comment_check
         3      37      27   complexity.c(47): initialize
         3      43      35   score.c(546): handle_TKN_KW_DO
         4      20      16   tokenize.c(439): next_nonblank
         4      25      19   tokenize.c(24): skip_comment
         4      25      20   tokenize.c(580): skip_to_semi
         4      37      32   tokenize.c(365): keyword_check
         4      54      42   complexity.c(330): load_file
         5      33      28   score.c(499): handle_TKN_KW_CASE
         5      40      32   score.c(326): handle_parms
         5      55      39   complexity.c(270): popen_unifdef
         5      65      42   opts.c(687): main
         5      61      47   complexity.c(470): do_proc
         5      66      47   score.c(782): score_proc
         5      63      51   score.c(152): fiddle_subexpr_score
         5      77      57   score.c(594): handle_TKN_KW_IF
         7      53      42   score.c(676): handle_TKN_KW_FOR
         8      73      57   complexity.c(114): print_histogram
        10      57      50   tokenize.c(610): find_proc_start
        10     236     181   opts.c(961): bogus_function
        13     103      73   score.c(377): handle_expression
        14      90      65   score.c(226): handle_subexpr
        25      84      68   tokenize.c(464): next_token

     Complexity Histogram
     Score-Range  Lin-Ct
         0-9         753 **********************************************
        10-19        369 *****************************
        20-29         68 *****

     Scored procedure ct:       28
     Non-comment line ct:     1190
     Average line score:         8
     25%-ile score:              4 (75% in higher score procs)
     50%-ile score:              5 (half in higher score procs)
     75%-ile score:             10 (25% in higher score procs)
     Highest score:             25 (next_token() in tokenize.c)

     [file invoke-complexity.texi not included]

Copying This Manual
*******************

You may copy this manual under the terms of the FDL (the GNU Free Documentation License (http://gnu.org/licenses/fdl.texi)).

     [file fdl.texi not included]