apple / swift-nio-ssl
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 4,214 units with 85,665 lines of code in units (26.9% of code).
    • 73 very long units (20,401 lines of code)
    • 233 long units (15,698 lines of code)
    • 765 medium size units (24,074 lines of code)
    • 910 small units (13,490 lines of code)
    • 2,233 very small units (12,002 lines of code)
23% | 18% | 28% | 15% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h92% | 0% | 1% | <1% | 5%
c14% | 21% | 31% | 17% | 15%
cc15% | 20% | 32% | 17% | 14%
swift0% | 6% | 15% | 41% | 36%
py0% | 0% | 18% | 38% | 43%
rb0% | 0% | 0% | 77% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/CNIOBoringSSL/crypto27% | 17% | 27% | 14% | 13%
Sources/CNIOBoringSSL/ssl15% | 20% | 32% | 17% | 14%
Sources/NIOSSL0% | 8% | 20% | 32% | 37%
scripts0% | 0% | 9% | 57% | 33%
Sources/NIOSSLPerformanceTester0% | 0% | 0% | 68% | 31%
Sources/NIOSSLHTTP1Client0% | 0% | 0% | 66% | 33%
ROOT0% | 0% | 0% | 100% | 0%
Sources/CNIOBoringSSL/include0% | 0% | 0% | 0% | 100%
Sources/CNIOBoringSSLShims0% | 0% | 0% | 0% | 100%
Sources/NIOTLSServer0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static const alignas()
in Sources/CNIOBoringSSL/crypto/fipsmodule/ec/p256-x86_64-table.h
9473 1 1
int boringssl_fips_self_test()
in Sources/CNIOBoringSSL/crypto/fipsmodule/self_check/self_check.c
503 58 2
static void sc_muladd()
in Sources/CNIOBoringSSL/crypto/curve25519/curve25519.c
456 1 4
void x25519_sc_reduce()
in Sources/CNIOBoringSSL/crypto/curve25519/curve25519.c
311 1 1
bool SSL_apply_handback()
in Sources/CNIOBoringSSL/ssl/handoff.cc
247 98 2
int BN_mod_exp_mont_consttime()
in Sources/CNIOBoringSSL/crypto/fipsmodule/bn/exponentiation.c
236 57 6
int X509_verify_cert()
in Sources/CNIOBoringSSL/crypto/x509/x509_vfy.c
226 59 1
UniquePtr SSL_SESSION_parse()
in Sources/CNIOBoringSSL/ssl/ssl_asn1.cc
221 76 3
static int asn1_item_ex_d2i()
in Sources/CNIOBoringSSL/crypto/asn1/tasn_dec.c
219 61 9
static size_t poly1305_combine()
in Sources/CNIOBoringSSL/crypto/poly1305/poly1305_vec.c
216 2 3
static int SSL_SESSION_to_bytes_full()
in Sources/CNIOBoringSSL/ssl/ssl_asn1.cc
199 88 3
int DSA_generate_parameters_ex()
in Sources/CNIOBoringSSL/crypto/dsa/dsa.c
197 62 7
static int def_load_bio()
in Sources/CNIOBoringSSL/crypto/conf/conf.c
194 49 3
bool tls13_process_certificate()
in Sources/CNIOBoringSSL/ssl/tls13_both.cc
182 47 3
static void poly1305_blocks()
in Sources/CNIOBoringSSL/crypto/poly1305/poly1305_vec.c
173 2 3
int ASN1_mbstring_ncopy()
in Sources/CNIOBoringSSL/crypto/asn1/a_mbstr.c
171 47 7
int TRUST_TOKEN_ISSUER_redeem()
in Sources/CNIOBoringSSL/crypto/trust_token/trust_token.c
167 50 10
static enum ssl_hs_wait_t do_read_client_key_exchange()
in Sources/CNIOBoringSSL/ssl/handshake_server.cc
162 42 1
static int get_cert_by_subject()
in Sources/CNIOBoringSSL/crypto/x509/by_dir.c
160 33 4
int x509v3_cache_extensions()
in Sources/CNIOBoringSSL/crypto/x509v3/v3_purp.c
160 53 1