Linux / Drivers / Pnp
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 260 units with 4,889 lines of code in units (75.4% of code).
    • 1 very long units (128 lines of code)
    • 10 long units (738 lines of code)
    • 66 medium size units (2,104 lines of code)
    • 85 small units (1,270 lines of code)
    • 98 very small units (649 lines of code)
2% | 15% | 43% | 25% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c2% | 15% | 43% | 25% | 13%
h0% | 0% | 0% | 52% | 47%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
isapnp15% | 17% | 27% | 21% | 16%
pnpacpi0% | 29% | 37% | 23% | 9%
ROOT0% | 8% | 54% | 23% | 12%
pnpbios0% | 12% | 38% | 35% | 14%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
128 40 2
99 21 4
84 26 2
83 18 1
78 18 2
77 21 2
73 13 2
69 19 2
63 13 1
57 5 12
55 18 1
50 13 3
49 16 2
49 16 2
47 10 1
47 8 3
46 16 1
45 11 3
45 17 2
45 7 1
43 9 2
42 17 2
42 9 3
41 8 3
39 9 4
39 10 1
38 9 1
37 13 4
37 10 1
37 11 1
36 9 1
36 6 3
35 10 1
35 6 3
34 9 3
34 5 3
33 4 1
33 10 1
33 5 1
33 6 5
32 6 4
32 5 2
32 9 1
31 12 3
31 4 2
31 6 2
31 6 1
30 8 1
29 2 1
29 11 1