Linux / Drivers / Gpu
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 43,403 units with 930,666 lines of code in units (23.4% of code).
    • 854 very long units (162,057 lines of code)
    • 2,610 long units (178,509 lines of code)
    • 9,863 medium size units (308,524 lines of code)
    • 11,485 small units (170,648 lines of code)
    • 18,591 very small units (110,928 lines of code)
17% | 19% | 33% | 18% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c17% | 19% | 34% | 18% | 10%
h18% | <1% | 2% | 8% | 69%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
drm17% | 19% | 33% | 18% | 11%
ipu-v314% | 19% | 36% | 18% | 11%
host1x3% | 8% | 21% | 17% | 48%
vga16% | 10% | 33% | 27% | 11%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
4329 5 1
1760 414 1
1751 412 1
1653 393 1
1586 384 1
1521 397 1
1506 191 1
1496 175 1
1263 45 1
1241 120 1
1217 130 1
1129 121 1
900 13 1
862 300 1
809 61 10
804 189 2
734 195 1
703 1 1
698 55 1
691 57 13
682 48 10
677 21 1
656 1 1
639 303 3
627 1 10
615 39 10
614 39 10
587 142 2
573 54 13
554 30 1
546 29 1
543 20 1
509 134 3
504 210 4
503 54 1
493 28 1
477 131 1
466 47 5
463 84 3
427 61 64
425 55 1
417 1 1
412 52 1
410 186 3
408 51 1
404 12 1
400 76 1
387 162 4
385 8 2
385 60 1