Linux / Drivers / Vhost
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 389 units with 6,232 lines of code in units (71.5% of code).
    • 3 very long units (347 lines of code)
    • 17 long units (1,117 lines of code)
    • 72 medium size units (2,228 lines of code)
    • 77 small units (1,196 lines of code)
    • 220 very small units (1,344 lines of code)
5% | 17% | 35% | 19% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 18% | 36% | 19% | 20%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT5% | 17% | 35% | 19% | 21%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
121 38 3
118 23 1
108 22 7
91 19 2
87 16 5
81 16 8
79 15 3
72 16 2
67 19 3
64 15 3
63 12 3
63 16 3
61 10 2
59 11 7
59 6 2
57 14 3
56 11 2
53 12 1
53 16 3
52 16 3
46 8 2
45 6 1
45 9 1
45 12 3
44 9 5
44 7 2
42 3 1
42 7 3
42 7 2
41 8 2
40 4 4
40 7 1
40 3 8
40 9 6
39 6 4
38 5 1
38 7 1
37 6 6
37 9 2
37 12 3
36 12 5
36 8 2
35 5 2
34 8 2
33 4 2
31 5 2
31 6 4
31 3 2
31 6 3
31 6 2