Linux / Drivers / Infiniband
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 9,576 units with 230,790 lines of code in units (71.3% of code).
    • 229 very long units (36,566 lines of code)
    • 770 long units (52,667 lines of code)
    • 2,564 medium size units (81,052 lines of code)
    • 2,485 small units (37,239 lines of code)
    • 3,528 very small units (23,266 lines of code)
15% | 22% | 35% | 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
c16% | 23% | 35% | 16% | 8%
h0% | 0% | 10% | 20% | 69%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hw18% | 22% | 34% | 15% | 9%
sw18% | 22% | 32% | 13% | 11%
core5% | 23% | 40% | 19% | 10%
ulp6% | 23% | 37% | 21% | 11%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
582 139 2
491 168 7
454 170 2
356 89 1
347 84 3
344 82 6
322 44 6
312 43 7
297 67 4
294 67 2
277 39 1
275 86 8
267 45 2
263 71 3
257 52 1
250 64 8
242 70 6
238 30 2
237 64 5
237 86 2
237 6 2
234 47 4
233 36 1
233 65 6
231 43 3
224 44 4
223 54 1
223 41 2
223 64 1
222 33 2
220 38 4
217 40 4
214 36 4
211 52 2
209 76 4
205 48 5
205 56 4
203 29 1
202 65 1
201 35 3
201 41 4
200 44 3
199 54 2
199 43 2
198 39 2
197 31 5
197 37 3
197 38 1
197 34 2
193 35 8