Linux / Virt
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 331 units with 5,192 lines of code in units (81.7% of code).
    • 3 very long units (473 lines of code)
    • 9 long units (621 lines of code)
    • 54 medium size units (1,660 lines of code)
    • 89 small units (1,353 lines of code)
    • 176 very small units (1,085 lines of code)
9% | 11% | 31% | 26% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 11% | 32% | 26% | 20%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kvm9% | 12% | 30% | 26% | 21%
lib0% | 0% | 90% | 9% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
192 46 3
171 42 3
110 17 3
90 12 4
86 15 5
79 12 2
75 29 2
64 10 2
61 10 8
60 12 4
54 16 2
52 20 2
49 11 2
47 11 2
47 15 1
45 8 2
45 6 3
43 20 2
42 7 3
41 13 4
41 11 2
41 10 2
40 5 1
39 14 5
38 10 3
37 10 6
37 10 3
36 8 3
36 6 1
34 9 1
33 6 5
33 6 1
32 5 1
32 10 4
30 5 1
30 7 3
29 10 4
29 5 4
29 5 1
28 6 2
27 8 5
27 9 2
27 5 1
26 4 4
26 9 4
26 5 3
26 5 1
26 5 1
25 4 5
25 9 2