Linux / Fs
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 25,209 units with 614,315 lines of code in units (58.8% of code).
    • 711 very long units (112,730 lines of code)
    • 2,124 long units (145,582 lines of code)
    • 6,206 medium size units (198,105 lines of code)
    • 6,540 small units (97,053 lines of code)
    • 9,628 very small units (60,845 lines of code)
18% | 23% | 32% | 15% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c18% | 24% | 32% | 15% | 8%
h0% | <1% | 4% | 18% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
btrfs25% | 27% | 28% | 11% | 6%
ntfs70% | 14% | 8% | 3% | 3%
ocfs216% | 30% | 30% | 13% | 9%
ext420% | 28% | 31% | 12% | 6%
ntfs337% | 25% | 26% | 4% | 5%
f2fs17% | 26% | 30% | 14% | 10%
ceph27% | 25% | 26% | 13% | 7%
reiserfs26% | 26% | 25% | 12% | 8%
ubifs23% | 24% | 31% | 14% | 6%
jfs34% | 27% | 27% | 7% | 3%
ksmbd21% | 22% | 32% | 14% | 9%
ROOT7% | 16% | 37% | 23% | 14%
jffs230% | 29% | 23% | 11% | 5%
gfs213% | 20% | 36% | 19% | 9%
cifs17% | 26% | 36% | 12% | 7%
nfs5% | 14% | 37% | 26% | 16%
udf31% | 23% | 30% | 10% | 4%
afs10% | 24% | 39% | 16% | 9%
orangefs21% | 23% | 34% | 14% | 4%
fat21% | 22% | 28% | 15% | 11%
hpfs27% | 25% | 27% | 12% | 7%
jbd219% | 19% | 35% | 16% | 8%
hfsplus17% | 36% | 28% | 10% | 7%
nilfs27% | 18% | 44% | 17% | 11%
isofs41% | 26% | 17% | 8% | 6%
dlm6% | 20% | 38% | 21% | 12%
ext219% | 21% | 32% | 17% | 8%
unicode23% | 36% | 23% | 10% | 5%
exfat13% | 30% | 32% | 12% | 10%
ufs16% | 37% | 28% | 12% | 5%
overlayfs8% | 16% | 37% | 22% | 14%
squashfs22% | 29% | 25% | 13% | 8%
fuse4% | 18% | 44% | 19% | 12%
ecryptfs10% | 26% | 35% | 19% | 7%
erofs8% | 31% | 27% | 18% | 13%
hfs11% | 34% | 29% | 15% | 8%
affs43% | 19% | 8% | 21% | 6%
proc3% | 15% | 43% | 22% | 15%
autofs13% | 16% | 41% | 12% | 15%
pstore7% | 18% | 40% | 19% | 13%
cachefiles9% | 28% | 36% | 19% | 5%
nfsd2% | 9% | 32% | 29% | 24%
9p9% | 21% | 35% | 19% | 14%
minix12% | 10% | 43% | 20% | 12%
qnx625% | 17% | 19% | 13% | 23%
notify4% | 17% | 40% | 18% | 18%
configfs6% | 11% | 46% | 20% | 15%
bfs18% | 10% | 43% | 18% | 8%
omfs10% | 17% | 44% | 17% | 9%
fscache7% | 8% | 38% | 31% | 15%
quota2% | 23% | 41% | 21% | 10%
coda0% | 25% | 38% | 26% | 9%
crypto0% | 15% | 46% | 25% | 11%
verity0% | 37% | 35% | 16% | 10%
sysv0% | 18% | 46% | 22% | 12%
vboxsf0% | 21% | 45% | 20% | 12%
efs0% | 55% | 14% | 18% | 10%
zonefs0% | 22% | 49% | 16% | 10%
netfs0% | 32% | 33% | 22% | 12%
cramfs0% | 40% | 28% | 25% | 6%
hugetlbfs0% | 27% | 37% | 14% | 20%
hostfs0% | 15% | 46% | 17% | 20%
xfs0% | 9% | 24% | 19% | 46%
adfs0% | 10% | 36% | 37% | 15%
nls0% | 4% | 23% | 36% | 35%
iomap0% | 8% | 60% | 23% | 7%
freevxfs0% | 43% | 39% | 0% | 16%
kernfs0% | 4% | 55% | 20% | 19%
romfs0% | 13% | 53% | 22% | 9%
devpts0% | 33% | 20% | 21% | 25%
smbfs_common0% | 32% | 41% | 9% | 17%
sysfs0% | 5% | 44% | 30% | 18%
efivarfs0% | 20% | 51% | 9% | 19%
openpromfs0% | 25% | 38% | 19% | 16%
debugfs0% | 7% | 20% | 35% | 36%
exportfs0% | 34% | 15% | 38% | 11%
befs0% | 31% | 52% | 9% | 5%
lockd0% | 0% | 27% | 40% | 32%
qnx40% | 0% | 63% | 13% | 22%
nfs_common0% | 0% | 80% | 0% | 19%
ramfs0% | 0% | 48% | 27% | 23%
tracefs0% | 0% | 50% | 35% | 14%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
1038 246 2
951 204 2
860 1 3
701 177 1
665 215 3
562 112 4
556 167 2
541 167 8
505 87 1
494 71 1
456 122 3
452 85 3
439 124 1
432 86 4
428 105 5
409 87 3
392 81 1
378 71 3
368 64 4
366 73 6
357 102 2
351 103 3
346 74 1
337 78 2
337 64 3
336 88 1
330 68 1
322 65 4
316 65 4
315 77 2
314 45 7
313 64 1
312 51 1
311 89 9
310 72 1
308 73 2
302 62 2
299 57 6
285 55 3
280 59 3
278 86 2
277 45 2
276 54 1
275 47 4
271 40 2
270 58 3
269 72 4
268 70 4
267 56 5
266 28 3