golang / mod
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 293 units with 4,756 lines of code in units (87.2% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (249 lines of code)
    • 34 medium complex units (1,651 lines of code)
    • 53 simple units (1,304 lines of code)
    • 204 very simple units (1,552 lines of code)
0% | 5% | 34% | 27% | 32%
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% | 5% | 34% | 27% | 32%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
modfile0% | 9% | 34% | 30% | 25%
zip0% | 19% | 41% | 14% | 24%
sumdb0% | 0% | 36% | 32% | 30%
sumdb/tlog0% | 0% | 25% | 31% | 42%
module0% | 0% | 27% | 34% | 37%
sumdb/note0% | 0% | 60% | 11% | 28%
semver0% | 0% | 42% | 24% | 33%
sumdb/storage0% | 0% | 44% | 25% | 30%
gosumcheck0% | 0% | 36% | 40% | 23%
sumdb/dirhash0% | 0% | 0% | 0% | 100%
internal/lazyregexp0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func checkFiles()
in zip/zip.go
110 30 1
func()
in modfile/rule.go
139 28 1
func()
in sumdb/tlog/tile.go
98 25 1
func checkZip()
in zip/zip.go
83 24 2
func()
in modfile/read.go
78 24 1
func Open()
in sumdb/note/note.go
70 23 2
func()
in modfile/read.go
74 21 1
func()
in sumdb/server.go
96 20 1
func checkElem()
in module/module.go
56 20 2
func()
in modfile/read.go
63 20 1
func parseReplace()
in modfile/rule.go
73 18 5
func parse()
in semver/semver.go
54 17 1
func Unzip()
in zip/zip.go
59 16 3
func()
in sumdb/client.go
64 15 1
func ParseTilePath()
in sumdb/tlog/tile.go
43 15 1
func SplitPathVersion()
in module/module.go
21 15 1
func comparePrerelease()
in semver/semver.go
47 14 2
func parseVersionInterval()
in modfile/rule.go
41 13 4
func parsePrerelease()
in semver/semver.go
23 12 1
func()
in sumdb/client.go
51 12 1