Linux / Drivers / Cpuidle
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 254 units with 3,650 lines of code in units (74.0% of code).
    • 1 very long units (109 lines of code)
    • 7 long units (458 lines of code)
    • 45 medium size units (1,293 lines of code)
    • 60 small units (870 lines of code)
    • 141 very small units (920 lines of code)
2% | 12% | 35% | 23% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 12% | 35% | 23% | 24%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
governors19% | 25% | 29% | 11% | 14%
ROOT0% | 10% | 36% | 26% | 27%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
109 30 3
93 32 3
71 16 3
69 18 3
65 16 1
55 12 3
53 9 2
52 15 2
50 12 1
48 16 3
45 7 3
44 10 2
43 9 2
42 10 1
36 11 3
35 4 1
35 12 2
34 7 1
34 9 2
33 5 1
32 6 4
31 7 5
31 9 1
30 6 1
29 8 1
29 6 1
28 5 3
28 6 1
28 9 3
27 7 1
26 8 1
26 4 2
25 5 2
24 4 3
24 5 3
23 7 1
23 3 1
23 6 3
23 4 1
23 5 2
23 4 3
23 3 1
23 4 3
22 3 1
22 5 2
21 4 4
21 3 1
21 8 2
21 8 5
21 4 3