Linux / Arch / Arm
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 7,671 units with 97,052 lines of code in units (33.4% of code).
    • 22 very long units (4,816 lines of code)
    • 172 long units (11,028 lines of code)
    • 918 medium size units (27,396 lines of code)
    • 1,863 small units (27,150 lines of code)
    • 4,696 very small units (26,662 lines of code)
4% | 11% | 28% | 27% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 11% | 29% | 28% | 25%
pl24% | 26% | 35% | 5% | 8%
h0% | 4% | 12% | 26% | 56%
inl0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
probes48% | 8% | 12% | 15% | 14%
mm5% | 8% | 30% | 30% | 24%
mach-omap22% | 12% | 28% | 27% | 28%
net32% | 4% | 28% | 16% | 17%
mach-omap17% | 22% | 20% | 25% | 23%
kernel2% | 11% | 32% | 29% | 23%
crypto6% | 13% | 32% | 26% | 21%
nwfpe4% | 34% | 33% | 18% | 8%
mach-iop32x18% | 0% | 13% | 27% | 41%
mach-sa11007% | 0% | 22% | 32% | 37%
mach-ep93xx10% | 0% | 15% | 34% | 38%
common4% | 11% | 33% | 28% | 22%
mach-imx4% | 4% | 29% | 29% | 32%
vfp0% | 43% | 17% | 19% | 19%
mach-s3c0% | 7% | 26% | 34% | 31%
mach-davinci0% | 12% | 32% | 26% | 27%
mach-pxa0% | 4% | 25% | 31% | 38%
mach-sunxi0% | 33% | 41% | 14% | 10%
mach-mmp0% | 17% | 23% | 31% | 27%
mach-rpc0% | 18% | 38% | 19% | 23%
include0% | 5% | 17% | 23% | 53%
mach-shmobile0% | 21% | 25% | 20% | 33%
mach-qcom0% | 56% | 17% | 17% | 8%
boot0% | 40% | 6% | 12% | 40%
mach-ixp4xx0% | 12% | 4% | 43% | 39%
xen0% | 22% | 29% | 29% | 18%
mach-at910% | 15% | 46% | 27% | 10%
mach-mxs0% | 47% | 13% | 10% | 28%
mach-mvebu0% | 9% | 35% | 33% | 21%
plat-orion0% | 9% | 21% | 48% | 21%
mach-orion5x0% | 3% | 42% | 30% | 22%
mach-vt85000% | 83% | 0% | 0% | 16%
mach-hisi0% | 14% | 45% | 21% | 18%
vdso0% | 54% | 0% | 0% | 45%
mach-bcm0% | 8% | 52% | 22% | 15%
mach-meson0% | 23% | 56% | 6% | 13%
plat-omap0% | 7% | 50% | 22% | 19%
mach-socfpga0% | 16% | 20% | 37% | 25%
plat-pxa0% | 28% | 16% | 16% | 39%
mach-exynos0% | 4% | 32% | 36% | 26%
mach-footbridge0% | 0% | 34% | 33% | 31%
mach-rockchip0% | 0% | 71% | 7% | 20%
mach-vexpress0% | 0% | 40% | 26% | 33%
mach-tegra0% | 0% | 32% | 31% | 36%
mach-dove0% | 0% | 29% | 34% | 35%
mach-mv78xx00% | 0% | 25% | 43% | 30%
mach-spear0% | 0% | 30% | 30% | 39%
mach-zynq0% | 0% | 40% | 8% | 50%
mach-cns3xxx0% | 0% | 25% | 37% | 36%
mach-lpc32xx0% | 0% | 55% | 20% | 23%
mach-actions0% | 0% | 85% | 14% | 0%
lib0% | 0% | 59% | 9% | 31%
mach-realview0% | 0% | 90% | 0% | 9%
mach-ux5000% | 0% | 16% | 51% | 32%
mach-highbank0% | 0% | 21% | 16% | 61%
mach-mediatek0% | 0% | 50% | 37% | 11%
mach-sti0% | 0% | 80% | 0% | 19%
mach-integrator0% | 0% | 21% | 25% | 53%
mach-s5pv2100% | 0% | 21% | 38% | 39%
mach-npcm0% | 0% | 59% | 40% | 0%
mach-berlin0% | 0% | 45% | 0% | 54%
mach-oxnas0% | 0% | 68% | 31% | 0%
mach-versatile0% | 0% | 40% | 0% | 59%
mach-keystone0% | 0% | 0% | 74% | 25%
mach-milbeaut0% | 0% | 0% | 59% | 40%
plat-versatile0% | 0% | 0% | 59% | 40%
mach-axxia0% | 0% | 0% | 84% | 15%
mach-aspeed0% | 0% | 0% | 100% | 0%
mach-mstar0% | 0% | 0% | 48% | 51%
mach-alpine0% | 0% | 0% | 37% | 62%
mach-clps711x0% | 0% | 0% | 63% | 36%
mach-artpec0% | 0% | 0% | 0% | 100%
mach-realtek0% | 0% | 0% | 0% | 100%
mach-gemini0% | 0% | 0% | 0% | 100%
mach-nomadik0% | 0% | 0% | 0% | 100%
mach-nspire0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
1158 5 1
729 1 1
380 166 2
232 1 1
173 1 0
165 47 1
154 42 3
150 36 1
140 49 1
139 1 1
137 7 1
132 24 1
126 11 1
125 1 1
121 5 1
119 1 1
113 8 2
107 7 3
107 12 1
105 13 1
103 22 2
101 12 2
98 2 0
96 16 1
95 21 2
95 16 1
94 23 2
93 25 3
93 21 4
92 13 2
92 23 1
91 8 1
91 21 5
91 19 1
90 1 0
89 22 3
88 22 1
87 13 1
86 1 1
85 26 2
83 8 3
83 21 1
83 15 4
82 19 1
81 5 7
80 16 1
78 19 1
76 7 1
76 10 1
76 23 3