golang / website
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 3,130 units with 32,369 lines of code in units (33.7% of code).
    • 0 very complex units (0 lines of code)
    • 9 complex units (915 lines of code)
    • 101 medium complex units (4,744 lines of code)
    • 218 simple units (5,691 lines of code)
    • 2,802 very simple units (21,019 lines of code)
0% | 2% | 14% | 17% | 64%
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% | 15% | 15% | 65%
js0% | 3% | 9% | 30% | 56%
java0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
cjs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
internal/backport0% | 4% | 26% | 21% | 47%
internal/screentest0% | 29% | 16% | 36% | 17%
internal/webtest0% | 37% | 24% | 15% | 22%
_content/talks0% | 1% | 7% | 13% | 77%
internal/texthtml0% | 18% | 23% | 19% | 38%
internal/codewalk0% | 18% | 35% | 30% | 14%
internal/history0% | 46% | 0% | 0% | 53%
internal/pkgdoc0% | 0% | 53% | 12% | 34%
internal/web0% | 0% | 31% | 20% | 48%
internal/gitfs0% | 0% | 43% | 26% | 30%
internal/tmplfunc0% | 0% | 55% | 20% | 24%
_content/blog0% | 0% | 7% | 12% | 79%
internal/api0% | 0% | 77% | 0% | 22%
internal/dl0% | 0% | 27% | 27% | 45%
cmd/golangorg0% | 0% | 17% | 37% | 44%
cmd/locktrigger0% | 0% | 63% | 0% | 36%
internal/talks0% | 0% | 40% | 16% | 42%
internal/short0% | 0% | 40% | 27% | 32%
_content/js0% | 0% | 0% | 33% | 66%
_content/doc0% | 0% | 0% | 12% | 87%
internal/tour0% | 0% | 0% | 38% | 61%
cmd/versionprune0% | 0% | 0% | 60% | 39%
internal/play0% | 0% | 0% | 27% | 72%
cmd/events0% | 0% | 0% | 45% | 54%
_content/tour0% | 0% | 0% | 3% | 96%
cmd/screentest0% | 0% | 0% | 100% | 0%
internal/spec0% | 0% | 0% | 24% | 75%
cmd/googlegolangorg0% | 0% | 0% | 50% | 49%
internal/redirect0% | 0% | 0% | 11% | 88%
internal/blog0% | 0% | 0% | 0% | 100%
internal/memcache0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
cmd/admingolangorg0% | 0% | 0% | 0% | 100%
internal/env0% | 0% | 0% | 0% | 100%
tour0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func readTests()
in internal/screentest/screentest.go
182 48 2
function keyDown()
in _content/talks/2010/support/slidy.js
131 46 1
func parseScript()
in internal/webtest/webtest.go
153 42 2
func goLinksFor()
in internal/texthtml/ast.go
82 34 1
func compare()
in internal/backport/fmtsort/sort.go
104 33 2
func addrNumber()
in internal/codewalk/codewalk.go
72 29 6
func()
in internal/backport/html/template/escape.go
83 28 1
func lexInsideAction()
in internal/backport/text/template/parse/lex.go
61 27 1
func()
in internal/history/history.go
47 27 1
func()
in internal/backport/html/template/escape.go
56 25 1
func()
in internal/backport/text/template/exec.go
66 25 1
func()
in internal/webtest/webtest.go
61 24 1
func eq()
in internal/backport/text/template/funcs.go
57 24 2
func()
in internal/backport/text/template/parse/node.go
78 23 1
func addrToByteRange()
in internal/codewalk/codewalk.go
83 23 3
function resized()
in _content/talks/2010/support/slidy.js
51 22 0
func()
in internal/pkgdoc/doc.go
90 22 1
func()
in internal/web/render.go
98 22 1
func()
in internal/gitfs/git.go
80 21 1
func()
in internal/backport/text/template/exec.go
72 21 1