apple / swift-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 3,233 units with 66,225 lines of code in units (21.7% of code).
    • 52 very long units (17,284 lines of code)
    • 170 long units (11,565 lines of code)
    • 553 medium size units (17,481 lines of code)
    • 693 small units (10,312 lines of code)
    • 1,765 very small units (9,583 lines of code)
26% | 17% | 26% | 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
h93% | 0% | <1% | <1% | 4%
c14% | 21% | 31% | 17% | 15%
py0% | 27% | 18% | 27% | 26%
swift0% | 0% | 8% | 44% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/CCryptoBoringSSL/crypto27% | 17% | 27% | 14% | 13%
scripts0% | 27% | 18% | 27% | 26%
Sources/Crypto/ASN10% | 0% | 15% | 40% | 44%
Sources/crypto-shasum0% | 0% | 44% | 34% | 20%
Sources/Crypto/Signatures0% | 0% | 15% | 24% | 60%
Sources/Crypto/AEADs0% | 0% | 22% | 53% | 24%
Sources/Crypto/Util0% | 0% | 5% | 47% | 47%
Sources/Crypto/Keys0% | 0% | 0% | 62% | 37%
Sources/_CryptoExtras/RSA0% | 0% | 0% | 74% | 25%
Sources/_CryptoExtras/Util0% | 0% | 0% | 53% | 46%
Sources/CCryptoBoringSSLShims0% | 0% | 0% | 19% | 80%
Sources/CCryptoBoringSSL/include0% | 0% | 0% | 0% | 100%
Sources/Crypto/Digests0% | 0% | 0% | 0% | 100%
Sources/Crypto/Key Agreement0% | 0% | 0% | 0% | 100%
Sources/Crypto/Message Authentication Codes0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static const alignas()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/ec/p256-x86_64-table.h
9473 1 1
int boringssl_fips_self_test()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/self_check/self_check.c
503 58 2
static void sc_muladd()
in Sources/CCryptoBoringSSL/crypto/curve25519/curve25519.c
456 1 4
void x25519_sc_reduce()
in Sources/CCryptoBoringSSL/crypto/curve25519/curve25519.c
311 1 1
int BN_mod_exp_mont_consttime()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/exponentiation.c
236 57 6
int X509_verify_cert()
in Sources/CCryptoBoringSSL/crypto/x509/x509_vfy.c
226 59 1
static int asn1_item_ex_d2i()
in Sources/CCryptoBoringSSL/crypto/asn1/tasn_dec.c
219 61 9
static size_t poly1305_combine()
in Sources/CCryptoBoringSSL/crypto/poly1305/poly1305_vec.c
216 2 3
int DSA_generate_parameters_ex()
in Sources/CCryptoBoringSSL/crypto/dsa/dsa.c
197 62 7
static int def_load_bio()
in Sources/CCryptoBoringSSL/crypto/conf/conf.c
194 49 3
static void poly1305_blocks()
in Sources/CCryptoBoringSSL/crypto/poly1305/poly1305_vec.c
173 2 3
int ASN1_mbstring_ncopy()
in Sources/CCryptoBoringSSL/crypto/asn1/a_mbstr.c
171 47 7
int TRUST_TOKEN_ISSUER_redeem()
in Sources/CCryptoBoringSSL/crypto/trust_token/trust_token.c
167 50 10
static int get_cert_by_subject()
in Sources/CCryptoBoringSSL/crypto/x509/by_dir.c
160 33 4
int x509v3_cache_extensions()
in Sources/CCryptoBoringSSL/crypto/x509v3/v3_purp.c
160 53 1
int PEM_read_bio()
in Sources/CCryptoBoringSSL/crypto/pem/pem_lib.c
154 39 5
int BN_div()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/div.c
152 35 5
const STACK_OF()
in Sources/CCryptoBoringSSL/crypto/pkcs8/pkcs8_x509.c
150 69 1
int X509_REQ_print_ex()
in Sources/CCryptoBoringSSL/crypto/x509/t_req.c
145 46 4
static void poly_mul_vec_aux()
in Sources/CCryptoBoringSSL/crypto/hrss/hrss.c
143 11 5