[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. 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      13      12   tokenize.c(507): skip_params
    3      15      13   score.c(121): handle_stmt_block
    3      22      17   tokenize.c(64): check_quote
    3      34      27   score.c(736): score_proc
    3      37      27   complexity.c(72): initialize
    3      43      35   score.c(513): handle_TKN_KW_DO
    4      15      13   tokenize.c(28): skip_comment
    4      20      16   tokenize.c(405): next_nonblank
    4      22      18   tokenize.c(528): skip_to_semi
    4      35      28   tokenize.c(335): keyword_check
    4      52      40   complexity.c(360): load_file
    5      33      28   score.c(466): handle_TKN_KW_CASE
    5      35      30   score.c(315): handle_parms
    5      58      41   complexity.c(297): popen_unifdef
    5      59      48   score.c(160): fiddle_subexpr_score
    5      78      58   score.c(561): handle_TKN_KW_IF
    6      45      30   opts.c(776): translate_option_strings
    6      67      44   opts.c(670): main
    7      49      40   score.c(644): handle_TKN_KW_FOR
   10      84      65   complexity.c(441): complex_eval
   11      57      50   tokenize.c(555): find_proc_start
   11      88      65   complexity.c(123): print_histogram
   12      81      60   score.c(224): handle_subexpr
   12      92      68   score.c(355): handle_expression
   15      64      51   tokenize.c(103): hash_check
   25      72      60   tokenize.c(430): next_token

Complexity Histogram
Score-Range  Lin-Ct
    0-9         565 **********************************************
   10-19        359 **************************************
   20-29         60 ******

Scored procedure ct:       26
Non-comment line ct:      984
Average line score:         8
25%-ile score:              4 (75% in higher score procs)
50%-ile score:              6 (half in higher score procs)
75%-ile score:             11 (25% in higher score procs)
Highest score:             25 (next_token() in tokenize.c)

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Bruce Korb on May 15, 2011 using texi2html 1.82.