Linux / Drivers / Vfio
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 470 units with 10,255 lines of code in units (85.0% of code).
    • 5 very long units (1,009 lines of code)
    • 36 long units (2,315 lines of code)
    • 121 medium size units (3,689 lines of code)
    • 134 small units (2,048 lines of code)
    • 174 very small units (1,194 lines of code)
9% | 22% | 35% | 19% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 22% | 36% | 19% | 11%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT14% | 17% | 36% | 21% | 10%
pci9% | 32% | 29% | 19% | 9%
mdev0% | 23% | 21% | 19% | 35%
fsl-mc0% | 16% | 63% | 15% | 5%
platform0% | 8% | 55% | 19% | 16%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
391 100 3
268 76 3
130 28 3
119 20 2
101 29 3
92 22 3
88 21 6
86 27 9
84 23 2
82 27 2
76 22 3
76 22 6
71 20 3
70 17 5
69 15 1
68 20 5
66 21 3
66 12 2
63 23 5
63 19 3
63 17 1
63 15 1
62 19 5
61 18 3
60 22 6
60 11 2
59 12 1
58 11 1
57 10 4
57 12 2
56 12 1
56 15 3
56 9 2
56 16 2
56 12 3
55 14 2
53 8 2
52 16 6
52 14 2
52 11 5
51 13 3
49 11 5
48 11 2
47 16 6
46 11 1
46 9 1
44 8 6
44 10 5
44 15 4
43 8 3