apple / darwin-xnu
File Size

The distribution of size of files (measured in lines of code).

Intro
  • File size measurements show the distribution of size of files.
  • Files are classified in four categories based on their size (lines of code): 1-100 (very small files), 101-200 (small files), 201-500 (medium size files), 501-1000 (long files), 1001+(very long files).
  • It is a good practice to keep files small. Long files may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
File Size Overall
  • There are 2,877 files with 1,126,517 lines of code.
    • 256 very long files (700,104 lines of code)
    • 259 long files (181,249 lines of code)
    • 423 medium size files (139,007 lines of codeclsfd_ftr_w_mp_ins)
    • 379 small files (55,019 lines of code)
    • 1,560 very small files (51,138 lines of code)
62% | 16% | 12% | 4% | 4%
Legend:
1001+
501-1000
201-500
101-200
1-100


explore: zoomable circles | sunburst | 3D view
File Size per Extension
1001+
501-1000
201-500
101-200
1-100
c71% | 15% | 9% | 2% | 1%
cpp74% | 11% | 10% | 2% | 1%
h24% | 20% | 22% | 14% | 18%
py49% | 27% | 10% | 7% | 4%
s30% | 14% | 39% | 11% | 4%
y59% | 28% | 12% | 0% | 0%
d0% | 0% | 35% | 43% | 20%
lua0% | 0% | 81% | 15% | 3%
cmd0% | 0% | 100% | 0% | 0%
m0% | 0% | 43% | 30% | 26%
pl0% | 0% | 65% | 20% | 14%
cocci0% | 0% | 0% | 74% | 25%
l0% | 0% | 0% | 100% | 0%
awk0% | 0% | 0% | 0% | 100%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
bsd70% | 14% | 9% | 2% | 3%
osfmk54% | 19% | 15% | 5% | 4%
iokit63% | 11% | 13% | 6% | 4%
EXTERNAL_HEADERS75% | 3% | 8% | 6% | 5%
libkern40% | 17% | 23% | 9% | 9%
tools46% | 26% | 13% | 9% | 4%
security61% | 6% | 13% | 13% | 5%
pexpert43% | 10% | 26% | 9% | 9%
libsyscall11% | 15% | 16% | 17% | 38%
san22% | 21% | 37% | 17% | 2%
libkdd0% | 68% | 15% | 5% | 10%
SETUP0% | 47% | 15% | 30% | 6%
libsa0% | 96% | 0% | 0% | 3%
makedefs0% | 0% | 100% | 0% | 0%
config0% | 0% | 0% | 88% | 11%
Longest Files (Top 50)
File# lines# units
AvailabilityInternal.h
in EXTERNAL_HEADERS
23276 -
vm_map.c
in osfmk/vm
14541 3
dtrace.c
in bsd/dev/dtrace
12340 5
pmap.c
in osfmk/arm
11580 5
OSKext.cpp
in libkern/c++
11318 -
vfs_syscalls.c
in bsd/vfs
9280 15
IOPMrootDomain.cpp
in iokit/Kernel
9241 -
pf.c
in bsd/net
9152 2
key.c
in bsd/netkey
7951 3
dlil.c
in bsd/net
7939 3
vfs_subr.c
in bsd/vfs
7577 2
nfs4_vnops.c
in bsd/nfs
7459 -
vm_pageout.c
in osfmk/vm
7277 -
nfs_vnops.c
in bsd/nfs
7018 -
vm_resident.c
in osfmk/vm
6855 1
IOService.cpp
in iokit/Kernel
6651 -
if_bridge.c
in bsd/net
6546 2
uipc_mbuf.c
in bsd/kern
6243 1
IOServicePM.cpp
in iokit/Kernel
6127 -
zalloc.c
in osfmk/kern
5974 -
kern_event.c
in bsd/kern
5863 6
task.c
in osfmk/kern
5830 7
necp_client.c
in bsd/net
5621 2
uipc_socket.c
in bsd/kern
5612 1
content_filter.c
in bsd/net
5584 3
nfs_socket.c
in bsd/nfs
5553 -
nfs_vfsops.c
in bsd/nfs
5493 -
GearImage.h
in pexpert/pexpert
5389 -
kern_memorystatus.c
in bsd/kern
5358 3
IOUserClient.cpp
in iokit/Kernel
5222 -
vm_object.c
in osfmk/vm
5125 3
vm_fault.c
in osfmk/vm
4897 2
mptcp_subr.c
in bsd/netinet
4793 2
IOMemoryDescriptor.cpp
in iokit/Kernel
4787 -
kern_exec.c
in bsd/kern
4523 2
if.c
in bsd/net
4462 16
vfs_cluster.c
in bsd/vfs
4445 2
tcp_input.c
in bsd/netinet
4303 1
sched_prim.c
in osfmk/kern
4256 1
kpi_vfs.c
in bsd/vfs
4239 1
ntstat.c
in bsd/net
4222 1
kern_sysctl.c
in bsd/kern
4218 2
if_bond.c
in bsd/net
4130 2
pf_ioctl.c
in bsd/net
4093 3
ipc_kmsg.c
in osfmk/ipc
4065 2
dis_tables.c
in bsd/dev/i386
4061 -
nfs_serv.c
in bsd/nfs
4004 -
ipsec.c
in bsd/netinet6
3999 1
IOUserServer.cpp
in iokit/Kernel
3935 -
memory.py
in tools/lldbmacros
3659 189
Files With Most Units (Top 20)
File# lines# units
memory.py
in tools/lldbmacros
3659 189
process.py
in tools/lldbmacros
1521 92
ipc.py
in tools/lldbmacros
1387 83
kcdata.py
in tools/lldbmacros
1647 80
net.py
in tools/lldbmacros
1743 78
cvalue.py
in tools/lldbmacros/core
377 72
ioreg.py
in tools/lldbmacros
1049 68
ccmode.h
in EXTERNAL_HEADERS/corecrypto
431 53
skywalk.py
in tools/lldbmacros
548 43
pmap.py
in tools/lldbmacros
1041 42
operating_system.py
in tools/lldbmacros/core
702 40
xnu.py
in tools/lldbmacros
914 38
scheduler.py
in tools/lldbmacros
930 37
parse_ipc_trace.py
in tools/trace
703 35
utils.py
in tools/lldbmacros
285 31
waitq.py
in tools/lldbmacros
903 30
kernelcore.py
in tools/lldbmacros/core
420 29
cc_priv.h
in EXTERNAL_HEADERS/corecrypto
469 27
mbufs.py
in tools/lldbmacros
615 27
standard.py
in tools/lldbmacros/core
180 24
Files With Long Lines (Top 20)

There are 572 files with lines longer than 120 characters. In total, there are 12065 long lines.

File# lines# units# long lines
AvailabilityInternal.h
in EXTERNAL_HEADERS
23276 - 5871
vfs_unicode_data.h
in bsd/vfs
1078 - 713
AvailabilityMacros.h
in EXTERNAL_HEADERS
2029 - 513
kern_memorystatus.c
in bsd/kern
5358 3 156
memory.py
in tools/lldbmacros
3659 189 150
necp_client.c
in bsd/net
5621 2 129
AppleBoot.h
in pexpert/pexpert
135 - 128
kern_sysctl.c
in bsd/kern
4218 2 124
sched_clutch.c
in osfmk/kern
2805 - 116
kcdata.py
in tools/lldbmacros
1647 80 97
kern_stackshot.c
in osfmk/kern
2409 1 90
operating_system.py
in tools/lldbmacros/core
702 40 86
kern_mib.c
in bsd/kern
733 - 85
pmap.c
in osfmk/arm
11580 5 84
kern_memorystatus_freeze.c
in bsd/kern
1628 - 66
vfs_attrlist.c
in bsd/vfs
3326 1 61
vm_unix.c
in bsd/vm
2716 1 61
vm_map.c
in osfmk/vm
14541 3 57
vm_compressor.c
in osfmk/vm
3453 - 56
scheduler.py
in tools/lldbmacros
930 37 55