Linux / Drivers / Power
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 2,134 units with 46,878 lines of code in units (71.6% of code).
    • 34 very long units (4,602 lines of code)
    • 137 long units (9,627 lines of code)
    • 545 medium size units (17,278 lines of code)
    • 719 small units (10,475 lines of code)
    • 699 very small units (4,896 lines of code)
9% | 20% | 36% | 22% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 20% | 36% | 22% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
supply10% | 20% | 36% | 22% | 10%
reset0% | 13% | 43% | 28% | 14%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
280 73 2
270 87 1
215 26 1
187 55 3
172 27 2
167 45 3
157 32 1
153 33 2
147 43 3
145 20 1
145 36 1
139 26 1
128 10 1
126 42 3
119 32 1
118 44 3
117 21 2
116 20 1
115 41 3
114 19 1
112 32 3
111 21 4
110 16 2
108 16 2
107 14 1
107 47 3
106 35 1
104 23 2
102 17 1
101 18 4
101 16 1
101 26 2
101 21 1
101 22 2
100 15 1
100 11 1
100 30 3
98 23 3
98 32 2
98 18 2
98 22 1
97 27 3
97 16 1
97 22 1
97 21 1
96 28 3
95 14 1
94 15 2
94 13 2
93 20 2