Linux / Drivers / Sh
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 168 units with 2,456 lines of code in units (78.5% of code).
    • 1 very long units (149 lines of code)
    • 4 long units (257 lines of code)
    • 30 medium size units (824 lines of code)
    • 44 small units (626 lines of code)
    • 89 very small units (600 lines of code)
6% | 10% | 33% | 25% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c6% | 10% | 33% | 25% | 24%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
intc13% | 4% | 29% | 31% | 20%
maple0% | 36% | 33% | 9% | 20%
clk0% | 0% | 41% | 26% | 32%
superhyway0% | 0% | 28% | 42% | 29%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
149 38 1
74 11 1
71 15 1
58 8 1
54 12 4
43 9 5
42 5 1
41 9 5
34 6 3
32 7 1
30 5 1
30 5 3
29 9 1
28 7 3
28 5 2
28 7 1
27 5 4
27 10 5
27 7 1
27 7 1
26 7 1
26 8 1
26 8 2
25 6 3
25 10 2
24 4 5
24 7 1
23 4 3
23 8 1
22 5 1
22 7 2
22 7 2
21 4 2
21 4 1
21 7 2
20 3 1
20 5 4
20 4 1
19 4 2
19 4 2
19 3 2
18 3 1
18 3 1
17 3 2
17 6 2
17 3 2
16 4 2
16 3 2
16 6 1
15 6 2