golang / crypto
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 1,695 units with 28,007 lines of code in units (66.8% of code).
    • 1 very complex units (228 lines of code)
    • 11 complex units (1,262 lines of code)
    • 76 medium complex units (4,183 lines of code)
    • 204 simple units (6,414 lines of code)
    • 1,403 very simple units (15,920 lines of code)
<1% | 4% | 14% | 22% | 56%
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
go<1% | 4% | 14% | 22% | 56%
c0% | 0% | 0% | 62% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ssh3% | 6% | 17% | 27% | 45%
openpgp0% | 5% | 27% | 27% | 39%
otr0% | 15% | 14% | 25% | 44%
acme0% | 4% | 16% | 32% | 46%
ocsp0% | 27% | 38% | 4% | 29%
pkcs120% | 0% | 36% | 12% | 51%
cryptobyte0% | 0% | 16% | 22% | 60%
ed255190% | 0% | 5% | 8% | 86%
argon20% | 0% | 14% | 13% | 72%
chacha200% | 0% | 21% | 20% | 57%
twofish0% | 0% | 27% | 15% | 57%
sha30% | 0% | 0% | 18% | 81%
ripemd1600% | 0% | 0% | 73% | 26%
curve255190% | 0% | 0% | 14% | 85%
md40% | 0% | 0% | 62% | 37%
blake2b0% | 0% | 0% | 16% | 83%
blowfish0% | 0% | 0% | 41% | 58%
xts0% | 0% | 0% | 73% | 26%
bn2560% | 0% | 0% | 3% | 96%
blake2s0% | 0% | 0% | 11% | 88%
internal0% | 0% | 0% | 12% | 87%
cast50% | 0% | 0% | 32% | 67%
nacl0% | 0% | 0% | 15% | 84%
salsa200% | 0% | 0% | 4% | 95%
scrypt0% | 0% | 0% | 10% | 90%
chacha20poly13050% | 0% | 0% | 0% | 100%
bcrypt0% | 0% | 0% | 0% | 100%
xtea0% | 0% | 0% | 0% | 100%
tea0% | 0% | 0% | 0% | 100%
hkdf0% | 0% | 0% | 0% | 100%
pbkdf20% | 0% | 0% | 0% | 100%
poly13050% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in ssh/server.go
228 66 1
func parseSignatureSubpacket()
in openpgp/packet/signature.go
165 45 3
func()
in otr/otr.go
160 44 1
func ReadMessage()
in openpgp/read.go
111 34 4
111 34 3
func Unmarshal()
in ssh/messages.go
111 33 2
func()
in acme/autocert/internal/acmetest/ca.go
152 31 1
141 30 2
func decode()
in ssh/messages.go
65 29 1
func()
in otr/otr.go
82 27 1
func()
in ssh/agent/server.go
97 26 1
67 26 1
func ReadEntity()
in openpgp/keys.go
71 22 1
func getSafeContents()
in pkcs12/pkcs12.go
62 22 2
func marshalStruct()
in ssh/messages.go
76 22 2
func()
in otr/smp.go
89 22 1
func Decode()
in openpgp/clearsign/clearsign.go
82 21 1
func writeAndSign()
in openpgp/write.go
70 21 5
func Read()
in openpgp/packet/packet.go
64 21 1
func()
in ssh/client_auth.go
84 21 1