Linux / Drivers / Virtio
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 359 units with 5,797 lines of code in units (76.6% of code).
    • 5 very long units (568 lines of code)
    • 12 long units (777 lines of code)
    • 67 medium size units (1,991 lines of code)
    • 83 small units (1,192 lines of code)
    • 192 very small units (1,269 lines of code)
9% | 13% | 34% | 20% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 13% | 34% | 20% | 21%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT9% | 13% | 34% | 20% | 21%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
133 27 8
116 22 1
114 20 8
103 16 1
102 13 1
93 24 3
89 17 1
85 12 7
63 11 4
62 17 8
60 1 1
59 16 1
55 11 2
54 15 1
54 9 1
52 11 1
51 13 2
46 12 2
46 5 5
42 9 1
39 14 3
39 6 2
38 5 1
38 7 4
38 7 4
37 4 1
36 7 3
36 8 2
36 8 3
36 6 2
35 3 1
35 6 1
35 4 1
35 1 1
34 7 3
33 6 3
33 10 3
33 5 4
33 5 4
33 7 6
33 7 1
33 5 7
32 11 2
32 4 1
32 5 1
32 4 4
31 7 1
31 5 1
30 5 3
30 5 4