Linux / Drivers / Video
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 6,445 units with 152,421 lines of code in units (65.5% of code).
    • 180 very long units (28,919 lines of code)
    • 497 long units (34,934 lines of code)
    • 1,504 medium size units (47,070 lines of code)
    • 1,709 small units (25,331 lines of code)
    • 2,555 very small units (16,167 lines of code)
18% | 22% | 30% | 16% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c19% | 23% | 31% | 16% | 10%
h0% | 0% | 9% | 54% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fbdev20% | 22% | 30% | 15% | 9%
backlight5% | 21% | 32% | 22% | 17%
console0% | 23% | 36% | 27% | 12%
ROOT0% | 19% | 49% | 11% | 19%
logo0% | 34% | 27% | 24% | 12%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
646 136 1
628 70 2
546 114 2
431 119 1
346 94 1
339 105 2
334 128 1
331 69 2
314 80 1
306 83 3
279 60 2
277 70 3
276 35 3
273 78 3
258 57 3
253 68 3
248 2 1
238 71 1
236 71 1
236 41 1
223 25 1
218 49 2
218 47 2
216 33 3
215 38 1
204 20 1
202 37 1
202 40 1
190 32 2
190 31 3
189 44 1
187 73 7
187 36 2
184 34 2
183 25 1
183 53 3
181 28 8
177 43 1
176 35 3
175 4 1
173 24 1
173 24 1
173 18 3
172 35 2
170 14 1
170 36 2
168 23 1
166 15 1
165 15 5
165 29 2