Linux / Drivers / Message
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 59 units with 1,884 lines of code in units (7.7% of code).
    • 3 very long units (411 lines of code)
    • 7 long units (464 lines of code)
    • 18 medium size units (580 lines of code)
    • 26 small units (386 lines of code)
    • 5 very small units (43 lines of code)
21% | 24% | 30% | 20% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c21% | 24% | 30% | 20% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fusion21% | 24% | 30% | 20% | 2%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
200 46 4
109 15 3
102 27 2
89 12 3
69 9 2
66 1 3
63 7 2
62 10 3
60 11 2
55 2 4
50 6 1
49 1 2
48 10 1
45 5 2
39 6 1
37 16 2
31 1 2
31 14 3
30 4 1
30 4 1
26 5 1
26 3 1
25 7 2
25 4 4
23 6 2
23 1 2
21 4 3
21 6 2
20 3 1
20 5 1
20 1 2
19 3 2
18 10 1
18 3 2
17 1 4
17 4 2
16 10 1
16 3 2
16 1 2
16 3 3
15 4 2
15 4 2
15 2 2
14 3 1
13 1 4
12 3 1
12 2 2
11 1 4
11 1 4
11 1 4