Linux / Drivers / Of
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 369 units with 7,444 lines of code in units (72.4% of code).
    • 5 very long units (633 lines of code)
    • 28 long units (1,813 lines of code)
    • 78 medium size units (2,400 lines of code)
    • 122 small units (1,789 lines of code)
    • 136 very small units (809 lines of code)
8% | 24% | 32% | 24% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c8% | 24% | 32% | 24% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT8% | 24% | 32% | 24% | 10%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
164 16 1
134 34 2
116 11 1
116 15 1
103 24 5
83 13 3
80 19 1
78 12 1
77 14 1
73 15 4
72 16 6
70 13 1
70 12 3
69 13 1
67 10 1
67 19 4
66 11 1
65 10 1
65 21 2
64 9 2
63 21 6
62 5 1
62 18 4
60 8 1
60 7 1
59 1 1
58 8 2
58 2 1
56 12 1
54 10 2
53 10 3
51 7 1
51 10 1
49 14 3
48 10 5
45 16 1
45 4 1
43 17 4
43 5 1
43 10 3
42 9 5
42 9 1
42 5 1
40 10 2
39 9 2
39 4 3
38 6 6
38 8 1
38 7 3
38 9 8