Linux / Drivers / Sbus
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 108 units with 2,351 lines of code in units (65.8% of code).
    • 1 very long units (118 lines of code)
    • 7 long units (436 lines of code)
    • 39 medium size units (1,143 lines of code)
    • 28 small units (415 lines of code)
    • 33 very small units (239 lines of code)
5% | 18% | 48% | 17% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 18% | 48% | 17% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
char5% | 18% | 48% | 17% | 10%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
118 15 4
85 17 4
70 17 2
63 17 4
60 20 4
54 13 1
53 21 3
51 28 3
50 11 4
48 10 1
45 13 3
45 13 3
44 5 1
37 9 3
36 11 2
35 7 1
35 9 6
34 8 3
34 8 3
33 3 3
32 8 1
31 5 2
30 3 2
29 8 1
27 7 3
27 8 2
26 7 2
25 5 1
25 9 2
25 16 3
24 3 3
24 7 1
24 4 5
24 7 4
24 5 2
24 6 3
23 6 1
23 9 1
23 3 1
23 6 3
23 3 2
22 6 1
22 5 4
22 13 3
22 5 2
22 4 2
21 3 1
20 8 2
20 2 5
20 5 1