golang / net
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 2,227 units with 31,160 lines of code in units (53.3% of code).
    • 5 very complex units (1,100 lines of code)
    • 21 complex units (2,266 lines of code)
    • 139 medium complex units (6,583 lines of code)
    • 284 simple units (7,440 lines of code)
    • 1,778 very simple units (13,771 lines of code)
3% | 7% | 21% | 23% | 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
go3% | 7% | 21% | 23% | 44%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
webdav10% | 10% | 29% | 22% | 25%
html12% | 19% | 31% | 18% | 17%
publicsuffix25% | 0% | 0% | 33% | 40%
http20% | 7% | 19% | 27% | 45%
idna0% | 14% | 28% | 19% | 37%
internal0% | 6% | 6% | 26% | 61%
bpf0% | 14% | 28% | 18% | 38%
icmp0% | 0% | 24% | 26% | 49%
websocket0% | 0% | 35% | 20% | 43%
dns0% | 0% | 12% | 25% | 61%
route0% | 0% | 19% | 29% | 50%
ipv40% | 0% | 14% | 27% | 57%
ipv60% | 0% | 11% | 13% | 74%
nettest0% | 0% | 19% | 26% | 53%
lif0% | 0% | 34% | 9% | 56%
trace0% | 0% | 8% | 21% | 69%
http0% | 0% | 26% | 11% | 61%
dict0% | 0% | 31% | 46% | 21%
proxy0% | 0% | 12% | 21% | 65%
context0% | 0% | 0% | 10% | 89%
xsrftoken0% | 0% | 0% | 47% | 52%
netutil0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func inBodyIM()
in html/parse.go
332 109 1
func()
in webdav/internal/xml/read.go
233 86 1
func()
in webdav/internal/xml/xml.go
261 81 1
func main1()
in publicsuffix/gen.go
121 62 0
func render1()
in html/render.go
153 57 2
func()
in webdav/internal/xml/xml.go
146 50 1
func()
in html/token.go
188 50 1
func()
in webdav/internal/xml/marshal.go
122 49 1
func()
in webdav/internal/xml/marshal.go
125 42 1
func unescapeEntity()
in html/escape.go
87 41 4
func()
in http2/transport.go
127 40 1
func()
in idna/idna10.0.0.go
79 39 1
func()
in bpf/instructions.go
108 38 1
func main()
in html/atom/gen.go
135 37 0
func structFieldInfo()
in webdav/internal/xml/typeinfo.go
94 34 2
func()
in internal/socks/client.go
129 34 1
func()
in http2/transport.go
111 34 1
func()
in http2/server.go
88 34 1
func()
in idna/idna9.0.0.go
69 33 1
func()
in http2/server.go
102 31 1