Linux / Drivers / Clk
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,610 units with 103,229 lines of code in units (26.1% of code).
    • 88 very long units (16,244 lines of code)
    • 196 long units (13,391 lines of code)
    • 1,076 medium size units (32,523 lines of code)
    • 1,675 small units (24,445 lines of code)
    • 2,575 very small units (16,626 lines of code)
15% | 12% | 31% | 23% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c15% | 12% | 31% | 23% | 16%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
imx54% | 8% | 15% | 13% | 8%
sunxi-ng25% | 22% | 23% | 16% | 12%
ROOT10% | 9% | 36% | 25% | 18%
spear80% | 0% | 8% | 8% | 3%
at9128% | 10% | 22% | 22% | 16%
mmp30% | 11% | 33% | 20% | 3%
sprd25% | 16% | 18% | 21% | 18%
actions47% | 6% | 7% | 17% | 21%
samsung11% | 25% | 19% | 22% | 20%
tegra5% | 17% | 40% | 21% | 15%
ux50049% | 0% | 15% | 17% | 17%
zynq63% | 12% | 12% | 8% | 3%
sunxi9% | 25% | 32% | 22% | 10%
ti3% | 17% | 39% | 22% | 17%
berlin34% | 15% | 17% | 23% | 8%
mvebu6% | 21% | 26% | 29% | 15%
rockchip7% | 0% | 55% | 25% | 11%
ingenic12% | 9% | 21% | 29% | 26%
bcm3% | 11% | 46% | 20% | 17%
qcom0% | 7% | 42% | 27% | 22%
renesas0% | 14% | 38% | 35% | 12%
keystone0% | 29% | 45% | 16% | 9%
socfpga0% | 18% | 32% | 40% | 9%
mxs0% | 38% | 29% | 10% | 22%
axis0% | 100% | 0% | 0% | 0%
st0% | 13% | 41% | 28% | 17%
versatile0% | 26% | 53% | 10% | 9%
meson0% | 8% | 33% | 31% | 25%
nxp0% | 10% | 31% | 32% | 25%
davinci0% | 8% | 42% | 19% | 28%
microchip0% | 13% | 42% | 21% | 22%
xilinx0% | 27% | 35% | 28% | 8%
analogbits0% | 44% | 31% | 18% | 5%
imgtec0% | 93% | 0% | 0% | 6%
starfive0% | 33% | 0% | 23% | 43%
pistachio0% | 14% | 23% | 41% | 20%
mstar0% | 80% | 0% | 20% | 0%
ralink0% | 22% | 57% | 10% | 10%
hisilicon0% | 3% | 38% | 41% | 16%
visconti0% | 15% | 26% | 39% | 18%
loongson10% | 43% | 38% | 0% | 17%
mediatek0% | 0% | 31% | 52% | 16%
zynqmp0% | 0% | 48% | 45% | 5%
baikal-t10% | 0% | 47% | 23% | 29%
x860% | 0% | 37% | 25% | 36%
pxa0% | 0% | 22% | 44% | 32%
axs10x0% | 0% | 61% | 16% | 22%
h83000% | 0% | 65% | 28% | 5%
sifive0% | 0% | 25% | 36% | 37%
uniphier0% | 0% | 49% | 22% | 27%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
594 1 2
473 2 1
460 1 1
427 33 1
371 18 1
337 4 1
322 21 1
320 19 1
301 1 6
299 4 3
296 1 6
290 5 1
284 4 1
282 5 1
263 1 6
256 5 1
233 42 2
232 1 5
228 2 1
228 4 3
217 4 2
216 3 1
213 1 6
212 4 1
207 5 4
203 35 1
202 41 2
198 33 1
195 1 6
185 32 1
183 1 6
181 30 1
174 42 1
170 1 1
169 1 6
166 19 1
165 3 2
164 3 1
160 32 2
158 1 11
156 46 3
155 1 6
152 27 2
150 1 7
149 1 11
149 29 1
148 24 1
146 1 6
144 12 1
141 1 1