awslabs / aws-viewer-for-cbmc
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 416 units with 3,663 lines of code in units (77.9% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (189 lines of code)
    • 23 medium size units (643 lines of code)
    • 91 small units (1,303 lines of code)
    • 299 very small units (1,528 lines of code)
0% | 5% | 17% | 35% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 17% | 36% | 40%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
summary0% | 22% | 4% | 42% | 30%
cbmc_viewer0% | 1% | 20% | 34% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_parser()
in summary/stubs.py
73 2 0
def create_parser()
in summary/summary.py
59 2 0
def viewer()
in cbmc_viewer/viewer.py
57 5 0
def create_parser()
in cbmc_viewer/viewer.py
50 1 0
def default_source_method()
in cbmc_viewer/optionst.py
40 19 1
def close_function_stack_frames()
in cbmc_viewer/tracet.py
39 6 1
def handle_deprecated_arguments()
in cbmc_viewer/optionst.py
35 14 1
def parse_text_traces()
in cbmc_viewer/tracet.py
34 10 3
def make_source()
in cbmc_viewer/sourcet.py
29 16 7
def sloc()
in cbmc_viewer/sourcet.py
28 7 2
def parse_xml_step()
in cbmc_viewer/tracet.py
27 14 2
def parse_json_step()
in cbmc_viewer/tracet.py
27 14 2
def split_code_into_blocks()
in cbmc_viewer/markup_code.py
27 12 1
def main()
in summary/summary.py
27 12 0
def load_cbmc_json()
in cbmc_viewer/coveraget.py
26 7 2
def parse_symbol_table()
in cbmc_viewer/symbol_table.py
26 14 2
def report()
in cbmc_viewer/report.py
25 4 10
def __init__()
in cbmc_viewer/sourcet.py
24 8 3
def lookup()
in cbmc_viewer/markup_trace.py
24 7 3
def symbol_definitions()
in cbmc_viewer/symbol_table.py
24 9 3