aws-samples / aws-iot-securetunneling-localproxy
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 98 units with 2,484 lines of code in units (73.0% of code).
    • 3 very long units (467 lines of code)
    • 9 long units (588 lines of code)
    • 28 medium size units (840 lines of code)
    • 27 small units (387 lines of code)
    • 31 very small units (202 lines of code)
18% | 23% | 33% | 15% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp19% | 24% | 33% | 15% | 7%
h0% | 0% | 57% | 0% | 42%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src19% | 24% | 31% | 15% | 8%
src/config0% | 0% | 84% | 10% | 4%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool process_cli()
in src/main.cpp
203 52 5
156 17 1
108 20 2
88 9 3
72 10 2
69 14 2
68 8 2
66 5 3
60 9 0
58 14 2
54 13 2
53 11 1
47 4 3
44 5 2
44 3 5
void update_port_mapping()
in src/config/ConfigFile.cpp
39 10 2
39 6 2
void WebProxyAdapter::on_tcp_connect()
in src/WebProxyAdapter.cpp
36 4 0
36 5 3
35 6 3