apple / swift-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 3,233 units with 66,225 lines of code in units (21.7% of code).
    • 8 very complex units (1,830 lines of code)
    • 46 complex units (4,990 lines of code)
    • 238 medium complex units (12,393 lines of code)
    • 367 simple units (10,772 lines of code)
    • 2,574 very simple units (36,240 lines of code)
2% | 7% | 18% | 16% | 54%
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
c3% | 9% | 22% | 19% | 44%
py0% | 0% | 6% | 26% | 67%
h0% | 0% | 0% | <1% | 99%
swift0% | 0% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/CCryptoBoringSSL/crypto2% | 7% | 19% | 16% | 53%
scripts0% | 0% | 6% | 26% | 67%
Sources/crypto-shasum0% | 0% | 0% | 44% | 55%
Sources/Crypto/ASN10% | 0% | 0% | 6% | 93%
Sources/Crypto/Signatures0% | 0% | 0% | 9% | 90%
Sources/Crypto/Keys0% | 0% | 0% | 0% | 100%
Sources/Crypto/Util0% | 0% | 0% | 0% | 100%
Sources/CCryptoBoringSSL/include0% | 0% | 0% | 0% | 100%
Sources/Crypto/AEADs0% | 0% | 0% | 0% | 100%
Sources/_CryptoExtras/RSA0% | 0% | 0% | 0% | 100%
Sources/Crypto/Digests0% | 0% | 0% | 0% | 100%
Sources/CCryptoBoringSSLShims0% | 0% | 0% | 0% | 100%
Sources/_CryptoExtras/Util0% | 0% | 0% | 0% | 100%
Sources/Crypto/Key Agreement0% | 0% | 0% | 0% | 100%
Sources/Crypto/Message Authentication Codes0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
const STACK_OF()
in Sources/CCryptoBoringSSL/crypto/pkcs8/pkcs8_x509.c
150 69 1
int DSA_generate_parameters_ex()
in Sources/CCryptoBoringSSL/crypto/dsa/dsa.c
197 62 7
static int asn1_item_ex_d2i()
in Sources/CCryptoBoringSSL/crypto/asn1/tasn_dec.c
219 61 9
int X509_verify_cert()
in Sources/CCryptoBoringSSL/crypto/x509/x509_vfy.c
226 59 1
int boringssl_fips_self_test()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/self_check/self_check.c
503 58 2
int BN_mod_exp_mont_consttime()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/exponentiation.c
236 57 6
int X509_print_ex()
in Sources/CCryptoBoringSSL/crypto/x509/t_x509.c
139 53 4
int x509v3_cache_extensions()
in Sources/CCryptoBoringSSL/crypto/x509v3/v3_purp.c
160 53 1
int TRUST_TOKEN_ISSUER_redeem()
in Sources/CCryptoBoringSSL/crypto/trust_token/trust_token.c
167 50 10
static int def_load_bio()
in Sources/CCryptoBoringSSL/crypto/conf/conf.c
194 49 3
static int asn1_ex_i2c()
in Sources/CCryptoBoringSSL/crypto/asn1/tasn_enc.c
111 48 5
int ASN1_mbstring_ncopy()
in Sources/CCryptoBoringSSL/crypto/asn1/a_mbstr.c
171 47 7
static STACK_OF()
in Sources/CCryptoBoringSSL/crypto/trust_token/pmbtoken.c
138 47 1
int X509_REQ_print_ex()
in Sources/CCryptoBoringSSL/crypto/x509/t_req.c
145 46 4
static int asn1_ex_c2i()
in Sources/CCryptoBoringSSL/crypto/asn1/tasn_dec.c
111 44 5
static int rsa_generate_key_impl()
in Sources/CCryptoBoringSSL/crypto/fipsmodule/rsa/rsa_impl.c
112 44 4
int asn1_generalizedtime_to_tm()
in Sources/CCryptoBoringSSL/crypto/asn1/a_gentm.c
101 43 2
static int str_copy()
in Sources/CCryptoBoringSSL/crypto/conf/conf.c
142 39 4
int PEM_read_bio()
in Sources/CCryptoBoringSSL/crypto/pem/pem_lib.c
154 39 5
static int pkey_rsa_ctrl()
in Sources/CCryptoBoringSSL/crypto/evp/p_rsa.c
111 38 4