kubernetes / utils
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 362 units with 3,209 lines of code in units (80.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (96 lines of code)
    • 7 medium complex units (315 lines of code)
    • 30 simple units (732 lines of code)
    • 324 very simple units (2,066 lines of code)
0% | 2% | 9% | 22% | 64%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go0% | 2% | 9% | 22% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
diff0% | 40% | 13% | 17% | 29%
mount0% | 0% | 21% | 38% | 40%
inotify0% | 0% | 31% | 0% | 68%
net0% | 0% | 4% | 17% | 77%
exec0% | 0% | 0% | 21% | 78%
trace0% | 0% | 0% | 25% | 75%
clock0% | 0% | 0% | 11% | 88%
nsenter0% | 0% | 0% | 20% | 79%
io0% | 0% | 0% | 46% | 53%
field0% | 0% | 0% | 45% | 54%
pointer0% | 0% | 0% | 11% | 88%
strings0% | 0% | 0% | 21% | 78%
temp0% | 0% | 0% | 0% | 100%
integer0% | 0% | 0% | 0% | 100%
env0% | 0% | 0% | 0% | 100%
buffer0% | 0% | 0% | 0% | 100%
lru0% | 0% | 0% | 0% | 100%
path0% | 0% | 0% | 0% | 100%
keymutex0% | 0% | 0% | 0% | 100%
semantic0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
96 33 3
func()
in mount/mount_linux.go
64 17 1
func limit()
in diff/diff.go
32 15 3
func()
in mount/mount_windows.go
61 14 1
func ParseMountInfo()
in mount/mount_helper_unix.go
59 13 1
func SearchMountPoints()
in mount/mount_linux.go
32 13 2
func NewLocalPort()
in net/port.go
19 12 5
func()
in inotify/inotify_linux.go
48 11 1
func()
in mount/mount_linux.go
37 10 1
41 9 2
func IsNotMountPoint()
in mount/mount.go
28 9 2
func doCleanupMountPoint()
in mount/mount_helper_common.go
35 9 4
func IsCorruptedMnt()
in mount/mount_helper_unix.go
17 9 1
func()
in mount/mount_linux.go
19 9 1
func IsCorruptedMnt()
in mount/mount_helper_windows.go
25 9 1
func()
in clock/testing/fake_clock.go
31 8 1
func()
in exec/testing/fake_exec.go
28 8 1
func getMountRefsByDev()
in mount/mount.go
22 8 2
32 8 2
18 7 1