golang / sys
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 6,356 units with 57,383 lines of code in units (34.2% of code).
    • 4 very complex units (1,109 lines of code)
    • 3 complex units (590 lines of code)
    • 26 medium complex units (1,499 lines of code)
    • 106 simple units (3,009 lines of code)
    • 6,217 very simple units (51,176 lines of code)
1% | 1% | 2% | 5% | 89%
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
go1% | 1% | 2% | 5% | 89%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
unix1% | 1% | <1% | 3% | 92%
plan917% | 0% | 0% | 4% | 77%
cpu0% | 0% | 26% | 12% | 61%
unix/internal0% | 0% | 61% | 7% | 31%
windows/svc0% | 0% | 21% | 29% | 49%
windows0% | 0% | 3% | 6% | 89%
windows/mkwinsyscall0% | 0% | 26% | 11% | 62%
unix/linux0% | 0% | 30% | 35% | 34%
windows/registry0% | 0% | 0% | 47% | 52%
execabs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func main()
in unix/mksyscall_aix_ppc64.go
354 89 0
func main()
in unix/mksyscall_aix_ppc.go
266 85 0
func main()
in plan9/mksyscall.go
246 76 0
func main()
in unix/mksyscall.go
243 76 0
func main()
in unix/mksyscall_solaris.go
193 46 0
func anyToSockaddr()
in unix/syscall_linux.go
230 41 2
func GetsockoptTCPInfo()
in unix/syscall_zos_s390x.go
167 32 3
func main()
in unix/mksysctl_openbsd.go
191 24 0
82 22 3
61 19 0
func filter()
in unix/internal/mkmerge/mkmerge.go
62 18 2
func newFn()
in windows/mkwinsyscall/mkwinsyscall.go
71 17 1
func()
in windows/dll_windows.go
38 17 1
func Faccessat()
in unix/syscall_linux.go
54 16 4
func main()
in unix/linux/mksysnum.go
60 16 0
func getRegistryValue()
in windows/setupapi_windows.go
50 15 2
func filterImports()
in unix/internal/mkmerge/mkmerge.go
54 14 1
func EscapeArg()
in windows/exec_windows.go
56 14 1
func Open()
in windows/syscall_windows.go
49 14 3
func ParseDirent()
in unix/dirent.go
38 13 3