korosuke613 / learnCPP
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 208 units with 2,752 lines of code in units (81.4% of code).
    • 0 very long units (0 lines of code)
    • 13 long units (864 lines of code)
    • 30 medium size units (940 lines of code)
    • 24 small units (360 lines of code)
    • 141 very small units (588 lines of code)
0% | 31% | 34% | 13% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 33% | 36% | 13% | 16%
cpp0% | 0% | 14% | 15% | 70%
c0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 33% | 36% | 13% | 16%
src0% | 0% | 11% | 11% | 77%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
93 20 5
88 40 5
87 44 7
68 38 4
63 13 6
62 4 4
62 18 5
61 19 1
59 11 4
58 4 3
58 15 1
54 27 4
51 33 5
47 8 4
43 13 3
42 6 3
42 24 4
42 20 5
42 14 3
40 22 4
40 18 5
39 6 1
34 2 5
33 9 2
33 5 1
32 25 5
31 9 5
31 15 3
31 13 4
29 11 1
29 12 4
25 4 1
25 8 2
25 3 9
25 5 5
24 11 4
24 16 4
23 11 6
23 3 0
22 9 5
22 6 2
21 8 5
21 13 3
20 5 5
20 9 4
18 8 4
18 4 3
18 8 3
18 10 2
18 8 5