golang / playground
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 153 units with 2,369 lines of code in units (59.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (68 lines of code)
    • 11 medium complex units (644 lines of code)
    • 19 simple units (681 lines of code)
    • 122 very simple units (976 lines of code)
0% | 2% | 27% | 28% | 41%
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% | 27% | 28% | 41%
js0% | 0% | 0% | 53% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 4% | 36% | 22% | 36%
sandbox0% | 0% | 20% | 34% | 45%
internal0% | 0% | 76% | 0% | 23%
internal/gcpdial0% | 0% | 0% | 46% | 53%
internal/metrics0% | 0% | 0% | 59% | 40%
static0% | 0% | 0% | 53% | 46%
cmd/latestgo0% | 0% | 0% | 0% | 100%
cmd/redirect0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func getTestProg()
in sandbox.go
68 27 1
func sandboxBuild()
in sandbox.go
96 25 4
func()
in tests.go
66 18 1
func()
in sandbox.go
61 17 1
func runHandler()
in sandbox/sandbox.go
102 16 2
func()
in edit.go
61 14 1
38 13 1
func main()
in main.go
55 12 0
func isTestFunc()
in sandbox.go
19 11 1
func WaitOrStop()
in internal/internal.go
39 11 4
53 11 2
func decode()
in play.go
54 11 2
43 10 2
func runInGvisor()
in sandbox/sandbox.go
42 10 0
func startContainer()
in sandbox/sandbox.go
80 10 1
function playgroundEmbed()
in static/playground-embed.js
28 10 1
func()
in internal/gcpdial/gcpdial.go
40 10 1
func()
in fmt.go
43 10 1
func sandboxRun()
in sandbox.go
44 9 3
func main()
in sandbox/sandbox.go
52 9 0