Linux / Drivers / Acpi
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 2,442 units with 47,871 lines of code in units (48.9% of code).
    • 29 very long units (4,541 lines of code)
    • 125 long units (8,314 lines of code)
    • 584 medium size units (18,288 lines of code)
    • 721 small units (10,523 lines of code)
    • 983 very small units (6,205 lines of code)
9% | 17% | 38% | 21% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 17% | 38% | 22% | 12%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
acpica23% | 17% | 34% | 18% | 5%
ROOT3% | 16% | 39% | 24% | 16%
nfit8% | 22% | 45% | 10% | 13%
apei6% | 15% | 40% | 22% | 14%
x860% | 49% | 35% | 12% | 2%
numa0% | 24% | 44% | 19% | 11%
arm640% | 11% | 43% | 35% | 8%
pmic0% | 14% | 27% | 34% | 23%
dptf0% | 0% | 54% | 28% | 17%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
293 54 1
274 55 1
217 52 1
214 39 1
191 39 2
190 51 4
182 48 2
177 42 1
175 34 1
171 48 6
169 11 1
166 31 1
150 16 1
149 23 2
143 20 1
141 18 1
138 25 1
137 30 1
132 23 1
123 20 1
123 28 1
122 21 2
116 29 1
116 23 3
111 26 1
109 40 3
107 28 3
104 27 2
101 19 4
100 23 2
100 16 1
98 24 2
98 29 6
92 22 1
92 18 1
91 20 4
90 18 4
90 17 1
89 24 1
86 19 2
85 19 1
84 22 2
84 13 1
84 12 1
84 13 2
84 13 2
83 15 1
83 19 3
82 12 1
82 11 1