Linux / Drivers / 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 226 units with 5,113 lines of code in units (80.9% of code).
    • 6 very long units (890 lines of code)
    • 15 long units (992 lines of code)
    • 53 medium size units (1,701 lines of code)
    • 68 small units (1,022 lines of code)
    • 84 very small units (508 lines of code)
17% | 19% | 33% | 19% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c17% | 19% | 33% | 20% | 8%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
acrn27% | 3% | 30% | 21% | 17%
nitro_enclaves31% | 17% | 30% | 14% | 6%
vboxguest5% | 26% | 41% | 20% | 5%
ROOT0% | 45% | 15% | 25% | 13%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
279 81 3
156 33 3
126 18 1
113 19 2
111 13 2
105 16 2
96 14 2
81 12 2
80 48 3
79 18 1
70 22 4
69 10 1
65 8 2
64 12 2
62 16 8
59 13 6
57 19 3
54 12 1
52 8 6
52 20 3
52 14 2
50 11 5
50 8 2
48 7 2
47 7 2
47 11 2
44 6 1
44 14 4
44 9 5
43 10 1
42 12 4
41 10 6
41 8 1
40 7 8
40 8 2
38 10 2
38 9 3
37 7 3
36 7 1
35 6 2
35 8 1
34 7 3
34 6 2
33 7 4
33 4 6
31 5 5
31 7 3
31 9 3
30 4 1
30 5 2