Linux / Arch / Mips
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 5,331 units with 96,237 lines of code in units (43.8% of code).
    • 86 very long units (16,734 lines of code)
    • 231 long units (15,626 lines of code)
    • 904 medium size units (27,339 lines of code)
    • 1,359 small units (20,148 lines of code)
    • 2,751 very small units (16,390 lines of code)
17% | 16% | 28% | 20% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c18% | 17% | 29% | 20% | 14%
h3% | 5% | 15% | 28% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kernel24% | 12% | 29% | 19% | 12%
math-emu55% | 29% | 8% | 3% | 3%
kvm29% | 21% | 25% | 11% | 11%
cavium-octeon16% | 18% | 33% | 20% | 10%
pci18% | 18% | 28% | 19% | 14%
mm14% | 16% | 34% | 19% | 14%
net24% | 16% | 40% | 10% | 7%
bcm47xx53% | 0% | 21% | 19% | 5%
loongson6419% | 14% | 30% | 18% | 17%
include3% | 5% | 15% | 29% | 46%
boot28% | 5% | 33% | 19% | 13%
txx912% | 7% | 31% | 25% | 22%
bcm63xx11% | 19% | 33% | 19% | 15%
lantiq9% | 14% | 21% | 35% | 18%
alchemy3% | 16% | 32% | 28% | 18%
ath7914% | 42% | 23% | 9% | 9%
mti-malta15% | 14% | 46% | 10% | 12%
dec11% | 18% | 28% | 23% | 18%
sni12% | 0% | 21% | 47% | 18%
loongson2ef0% | 40% | 11% | 27% | 19%
sibyte0% | 17% | 50% | 21% | 11%
vr41xx0% | 26% | 36% | 22% | 14%
ralink0% | 24% | 34% | 18% | 22%
generic0% | 40% | 33% | 10% | 15%
sgi-ip220% | 12% | 39% | 28% | 20%
ar70% | 14% | 42% | 23% | 18%
vdso0% | 62% | 16% | 0% | 21%
tools0% | 49% | 34% | 0% | 16%
sgi-ip270% | 9% | 38% | 36% | 15%
sgi-ip300% | 22% | 19% | 37% | 20%
lib0% | 22% | 34% | 33% | 10%
ath250% | 10% | 33% | 24% | 31%
sgi-ip320% | 12% | 17% | 37% | 32%
jazz0% | 12% | 25% | 25% | 37%
n640% | 67% | 0% | 0% | 32%
loongson320% | 0% | 37% | 22% | 40%
fw0% | 0% | 25% | 60% | 13%
rb5320% | 0% | 27% | 36% | 36%
crypto0% | 0% | 26% | 23% | 50%
pic320% | 0% | 17% | 42% | 39%
cobalt0% | 0% | 31% | 54% | 13%
bmips0% | 0% | 18% | 21% | 59%
power0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
1156 139 3
928 246 3
491 157 2
331 100 1
323 112 2
322 165 2
318 157 2
306 105 3
303 74 1
302 52 2
299 99 3
298 94 1
289 89 4
284 57 2
267 89 3
258 109 2
255 41 3
243 82 1
231 77 1
224 56 3
221 40 1
221 80 3
214 49 4
205 44 3
203 66 2
198 42 3
196 45 4
195 32 1
193 31 1
191 46 3
184 38 4
177 49 4
172 26 1
170 39 4
168 69 4
168 22 1
166 49 3
160 94 1
158 38 2
156 3 1
156 46 1
156 17 1
155 25 1
152 26 1
147 13 1
146 23 1
140 31 2
135 25 1
134 24 2
134 34 1