Linux / Drivers / Md
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 4,180 units with 80,041 lines of code in units (77.7% of code).
    • 82 very long units (12,911 lines of code)
    • 206 long units (13,696 lines of code)
    • 843 medium size units (25,545 lines of code)
    • 1,034 small units (15,144 lines of code)
    • 2,015 very small units (12,745 lines of code)
16% | 17% | 31% | 18% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c16% | 17% | 32% | 18% | 14%
h0% | 0% | 0% | 16% | 83%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT18% | 17% | 30% | 18% | 14%
bcache5% | 18% | 37% | 18% | 19%
persistent-data0% | 7% | 43% | 25% | 23%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
516 127 3
468 121 3
379 92 3
317 85 3
305 96 1
277 137 1
262 61 1
222 66 1
217 47 3
216 69 3
212 33 2
205 47 3
200 63 4
197 66 2
193 47 3
185 44 2
184 48 3
184 26 2
172 29 2
169 46 2
168 31 3
165 45 1
164 40 5
161 19 2
158 35 4
158 53 2
157 28 3
155 23 3
155 28 3
153 62 2
152 52 3
147 34 1
146 21 3
143 41 1
143 40 2
142 35 2
141 42 3
139 43 2
137 27 5
137 42 5
135 39 2
134 32 1
132 25 10
132 19 3
131 25 4
129 28 1
127 31 1
126 27 4
125 63 4
124 36 3