golang / benchmarks
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 729 units with 11,139 lines of code in units (62.6% of code).
    • 2 very complex units (937 lines of code)
    • 4 complex units (465 lines of code)
    • 41 medium complex units (2,511 lines of code)
    • 86 simple units (2,316 lines of code)
    • 596 very simple units (4,910 lines of code)
8% | 4% | 22% | 20% | 44%
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
go8% | 4% | 22% | 20% | 44%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd/bent60% | 0% | 17% | 6% | 15%
garbage3% | 2% | 31% | 22% | 39%
sweet/cmd0% | 31% | 22% | 22% | 22%
sweet/generators0% | 21% | 25% | 2% | 49%
sweet/benchmarks0% | 0% | 25% | 23% | 50%
driver0% | 0% | 7% | 16% | 76%
sweet/cli0% | 0% | 16% | 29% | 53%
stats0% | 0% | 0% | 59% | 40%
cmd/bench0% | 0% | 0% | 56% | 43%
sweet/common0% | 0% | 0% | 26% | 73%
sweet/source-assets0% | 0% | 0% | 83% | 16%
sweet/harnesses0% | 0% | 0% | 0% | 100%
http0% | 0% | 0% | 0% | 100%
build0% | 0% | 0% | 0% | 100%
json0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func main()
in cmd/bent/bent.go
779 190 0
func()
in garbage/nethttp.go
158 63 1
func()
in garbage/nethttp.go
102 36 1
func()
in sweet/cmd/sweet/run.go
122 34 1
func()
in sweet/generators/tile38.go
130 32 1
func()
in sweet/cmd/sweet/benchmark.go
111 28 1
func()
in garbage/nethttp.go
110 25 1
func RunBenchmark()
in sweet/benchmarks/internal/driver/driver.go
74 25 2
func()
in garbage/nethttp.go
75 24 1
func()
in garbage/nethttp.go
77 24 1
func()
in garbage/nethttp.go
104 24 1
func()
in garbage/nethttp.go
84 24 1
func readSetCookies()
in garbage/nethttp.go
83 23 1
func readTransfer()
in garbage/nethttp.go
90 23 2
func()
in garbage/nethttp.go
67 22 1
func newTransferWriter()
in garbage/nethttp.go
70 22 1
func()
in sweet/generators/gvisor.go
98 21 1
func isCookieDomainName()
in garbage/nethttp.go
44 20 1
func serveContent()
in garbage/nethttp.go
92 20 5
func()
in cmd/bent/configuration.go
108 20 1