kubernetes / utils
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 362 units with 3,209 lines of code in units (80.1% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (280 lines of code)
    • 29 medium size units (805 lines of code)
    • 57 small units (850 lines of code)
    • 272 very small units (1,274 lines of code)
0% | 8% | 25% | 26% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 8% | 25% | 26% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mount0% | 17% | 44% | 15% | 21%
diff0% | 40% | 30% | 20% | 9%
inotify0% | 0% | 48% | 39% | 11%
nsenter0% | 0% | 36% | 9% | 53%
exec0% | 0% | 21% | 24% | 53%
trace0% | 0% | 28% | 11% | 59%
clock0% | 0% | 11% | 39% | 48%
net0% | 0% | 6% | 42% | 50%
env0% | 0% | 0% | 82% | 17%
buffer0% | 0% | 0% | 84% | 15%
io0% | 0% | 0% | 72% | 27%
strings0% | 0% | 0% | 34% | 65%
path0% | 0% | 0% | 100% | 0%
field0% | 0% | 0% | 45% | 54%
pointer0% | 0% | 0% | 11% | 88%
temp0% | 0% | 0% | 31% | 68%
integer0% | 0% | 0% | 0% | 100%
lru0% | 0% | 0% | 0% | 100%
keymutex0% | 0% | 0% | 0% | 100%
semantic0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
96 33 3
func()
in mount/mount_linux.go
64 17 1
func()
in mount/mount_windows.go
61 14 1
func ParseMountInfo()
in mount/mount_helper_unix.go
59 13 1
func()
in inotify/inotify_linux.go
48 11 1
41 9 2
func()
in mount/mount_linux.go
37 10 1
func doCleanupMountPoint()
in mount/mount_helper_common.go
35 9 4
func limit()
in diff/diff.go
32 15 3
32 8 2
func SearchMountPoints()
in mount/mount_linux.go
32 13 2
func()
in clock/testing/fake_clock.go
31 8 1
func parseProcMounts()
in mount/mount_linux.go
31 6 1
func()
in nsenter/nsenter.go
29 6 1
func()
in mount/mount_windows.go
29 6 1
func()
in exec/testing/fake_exec.go
28 8 1
func IsNotMountPoint()
in mount/mount.go
28 9 2
func openLocalPort()
in net/port.go
27 6 1
func()
in inotify/inotify_linux.go
26 5 1
func()
in mount/fake_mounter.go
26 6 1