golang / crypto
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,695 units with 28,007 lines of code in units (66.8% of code).
    • 18 very long units (3,159 lines of code)
    • 77 long units (4,946 lines of code)
    • 310 medium size units (9,641 lines of code)
    • 364 small units (5,414 lines of code)
    • 926 very small units (4,847 lines of code)
11% | 17% | 34% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go11% | 17% | 34% | 19% | 17%
c0% | 62% | 0% | 0% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ed2551944% | 11% | 21% | 13% | 8%
ssh6% | 18% | 35% | 22% | 17%
salsa2088% | 0% | 9% | 0% | 2%
sha342% | 0% | 18% | 6% | 32%
openpgp5% | 20% | 42% | 17% | 13%
otr17% | 27% | 27% | 12% | 16%
acme4% | 9% | 49% | 21% | 14%
blake2s33% | 0% | 28% | 24% | 14%
blake2b30% | 0% | 25% | 23% | 19%
ocsp27% | 38% | 19% | 4% | 10%
argon227% | 14% | 32% | 18% | 7%
bn2560% | 26% | 24% | 18% | 29%
curve255190% | 36% | 22% | 20% | 20%
pkcs120% | 41% | 30% | 14% | 14%
chacha200% | 42% | 28% | 18% | 10%
ripemd1600% | 57% | 33% | 0% | 9%
scrypt0% | 57% | 20% | 10% | 12%
cryptobyte0% | 7% | 23% | 40% | 28%
twofish0% | 27% | 48% | 14% | 10%
internal0% | 15% | 27% | 12% | 44%
md40% | 42% | 42% | 0% | 14%
blowfish0% | 0% | 66% | 14% | 19%
cast50% | 0% | 78% | 0% | 21%
bcrypt0% | 0% | 34% | 44% | 20%
nacl0% | 0% | 29% | 32% | 37%
xts0% | 0% | 73% | 26% | 0%
chacha20poly13050% | 0% | 23% | 45% | 31%
pbkdf20% | 0% | 100% | 0% | 0%
hkdf0% | 0% | 57% | 0% | 42%
tea0% | 0% | 0% | 87% | 12%
xtea0% | 0% | 0% | 40% | 59%
poly13050% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func ScMulAdd()
in ed25519/internal/edwards25519/edwards25519.go
400 1 4
func keccakF1600()
in sha3/keccakf.go
341 2 1
func ScReduce()
in ed25519/internal/edwards25519/edwards25519.go
295 1 2
func()
in ssh/server.go
228 66 1
func core()
in salsa20/salsa/salsa20_ref.go
166 2 4
func Core208()
in salsa20/salsa/salsa208.go
166 2 2
func parseSignatureSubpacket()
in openpgp/packet/signature.go
165 45 3
func()
in otr/otr.go
160 44 1
func()
in acme/autocert/internal/acmetest/ca.go
152 31 1
func hashBlocksGeneric()
in blake2s/blake2s_generic.go
143 5 4
func hashBlocksGeneric()
in blake2b/blake2b_generic.go
143 5 4
141 30 2
func HSalsa20()
in salsa20/salsa/hsalsa20.go
116 2 4
func ReadMessage()
in openpgp/read.go
111 34 4
func Unmarshal()
in ssh/messages.go
111 33 2
111 34 3
func blamkaGeneric()
in argon2/blamka_generic.go
106 1 16
func()
in otr/smp.go
104 8 1
func CreateResponse()
in ocsp/ocsp.go
100 13 4
func()
in ssh/agent/server.go
97 26 1