aws / s2n-tls
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 2,074 units with 28,483 lines of code in units (54.4% of code).
    • 12 very long units (2,052 lines of code)
    • 33 long units (2,116 lines of code)
    • 289 medium size units (8,752 lines of code)
    • 563 small units (8,127 lines of code)
    • 1,177 very small units (7,436 lines of code)
7% | 7% | 30% | 28% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 6% | 30% | 29% | 26%
py0% | 40% | 36% | 12% | 10%
rs0% | 26% | 24% | 16% | 32%
h0% | 0% | 39% | 10% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pq-crypto16% | 6% | 31% | 22% | 23%
tls3% | 9% | 33% | 30% | 24%
utils9% | 8% | 26% | 28% | 26%
codebuild0% | 57% | 26% | 8% | 8%
bindings0% | 26% | 24% | 16% | 32%
crypto0% | 0% | 25% | 37% | 37%
stuffer0% | 0% | 24% | 41% | 33%
scram0% | 0% | 76% | 13% | 10%
error0% | 0% | 0% | 36% | 63%
scripts0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void KeccakF1600_StatePermute()
in pq-crypto/sike_r1/fips202_r1.c
241 2 1
static void KeccakF1600_StatePermute()
in pq-crypto/sike_r3/sikep434r3_fips202.c
240 2 1
static void KeccakF1600_StatePermute()
in pq-crypto/kyber_r2/fips202_kyber_r2.c
239 2 1
static void KeccakF1600_StatePermute()
in pq-crypto/kyber_r3/kyber512r3_fips202.c
239 2 1
int s2n_record_writev()
in tls/s2n_record_write.c
169 36 6
static size_t crypto_hashblocks_sha512()
in pq-crypto/kyber_90s_r2/sha2_c.c
159 2 3
static S2N_RESULT process_state()
in utils/s2n_asn1_time.c
145 35 3
static size_t crypto_hashblocks_sha256()
in pq-crypto/kyber_90s_r2/sha2_c.c
142 2 3
static void fpinv_chain_mont()
in pq-crypto/sike_r3/sikep434r3_fpx.c
140 35 1
118 28 4
int s2n_connection_wipe()
in tls/s2n_connection.c
110 4 1
unsigned int rej_uniform_avx2()
in pq-crypto/kyber_r3/kyber512r3_rejsample_avx2.c
110 10 2
void fpinv_chain_mont()
in pq-crypto/sike_r1/fpx_r1.c
98 46 1
size_t KeccakF1600times4_FastLoop_Absorb()
in pq-crypto/kyber_r3/KeccakP-1600-times4-SIMD256_avx2.c
96 5 6
size_t KeccakP1600times4_12rounds_FastLoop_Absorb()
in pq-crypto/kyber_r3/KeccakP-1600-times4-SIMD256_avx2.c
96 5 6
static int s2n_handshake_read_io()
in tls/s2n_handshake_io.c
82 22 1
74 17 5
S2N_RESULT s2n_inet_ntop()
in utils/s2n_rfc5952.c
70 17 3
ssize_t s2n_recv_impl()
in tls/s2n_recv.c
69 18 4
def build_project()
in codebuild/create_project.py
67 8 1