golang / mock
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 164 units with 2,240 lines of code in units (83.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (87 lines of code)
    • 8 medium complex units (541 lines of code)
    • 25 simple units (763 lines of code)
    • 130 very simple units (849 lines of code)
0% | 3% | 24% | 34% | 37%
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% | 3% | 24% | 34% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mockgen0% | 7% | 29% | 43% | 19%
gomock0% | 0% | 15% | 26% | 58%
mockgen/model0% | 0% | 27% | 22% | 50%
gomock/internal0% | 0% | 0% | 0% | 100%
sample0% | 0% | 0% | 0% | 100%
sample/concurrent0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in mockgen/parse.go
87 30 1
func main()
in mockgen/mockgen.go
93 23 0
func()
in mockgen/parse.go
94 23 1
func()
in mockgen/mockgen.go
78 21 1
func typeFromType()
in mockgen/model/model.go
83 21 1
func()
in gomock/call.go
63 20 1
func()
in gomock/matchers.go
41 13 1
func()
in mockgen/parse.go
37 11 1
func importsOfFile()
in mockgen/parse.go
52 11 1
func sourceMode()
in mockgen/parse.go
46 10 1
func runInDir()
in mockgen/reflect.go
40 9 2
func sanitize()
in mockgen/mockgen.go
21 9 1
func parsePackageImport()
in mockgen/mockgen.go
32 9 1
func()
in gomock/call.go
36 9 1
func reflectMode()
in mockgen/reflect.go
26 8 2
func main()
in mockgen/reflect.go
44 8 0
func()
in mockgen/mockgen.go
53 8 1
func()
in mockgen/mockgen.go
45 8 1
func()
in mockgen/parse.go
30 8 1
func()
in mockgen/parse.go
31 8 1