golang / example
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 42 units with 616 lines of code in units (70.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (103 lines of code)
    • 8 simple units (231 lines of code)
    • 32 very simple units (282 lines of code)
0% | 0% | 16% | 37% | 45%
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% | 0% | 16% | 37% | 45%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
gotypes0% | 0% | 49% | 41% | 8%
gotypes/implements0% | 0% | 86% | 0% | 13%
gotypes/typeandvalue0% | 0% | 0% | 85% | 15%
gotypes/doc0% | 0% | 0% | 100% | 0%
gotypes/nilfunc0% | 0% | 0% | 53% | 46%
gotypes/skeleton0% | 0% | 0% | 53% | 46%
gotypes/hugeparam0% | 0% | 0% | 64% | 35%
outyet0% | 0% | 0% | 0% | 100%
gotypes/defsuses0% | 0% | 0% | 0% | 100%
gotypes/lookup0% | 0% | 0% | 0% | 100%
template0% | 0% | 0% | 0% | 100%
gotypes/pkginfo0% | 0% | 0% | 0% | 100%
stringutil0% | 0% | 0% | 0% | 100%
appengine-hello0% | 0% | 0% | 0% | 100%
appengine-hello/static0% | 0% | 0% | 0% | 100%
hello0% | 0% | 0% | 0% | 100%
gotypes/hello0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func main()
in gotypes/weave.go
72 21 0
func main()
in gotypes/implements/main.go
31 12 0
func cleanListing()
in gotypes/weave.go
26 10 1
func CheckNilFuncComparison()
in gotypes/nilfunc/main.go
31 9 2
func include()
in gotypes/weave.go
35 9 2
func mode()
in gotypes/typeandvalue/main.go
28 9 1
func main()
in gotypes/doc/main.go
32 8 0
func PrintSkeleton()
in gotypes/skeleton/main.go
29 6 3
func main()
in gotypes/typeandvalue/main.go
23 6 0
func PrintHugeParams()
in gotypes/hugeparam/main.go
27 6 3
func main()
in gotypes/lookup/lookup.go
23 5 0
func isValidIdentifier()
in gotypes/skeleton/main.go
9 5 1
func PrintDefsUses()
in gotypes/defsuses/main.go
20 4 2
func main()
in gotypes/nilfunc/main.go
6 4 0
func main()
in gotypes/nilfunc/main.go
21 4 0
func main()
in gotypes/skeleton/main.go
16 4 0
func main()
in gotypes/hugeparam/main.go
15 4 0
func indexHandler()
in template/main.go
15 3 2
func imageHandler()
in template/main.go
10 3 2
func main()
in gotypes/defsuses/main.go
10 3 0