apple / swift-nio-ssl
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 4,214 units with 85,665 lines of code in units (26.9% of code).
    • 14 very complex units (2,941 lines of code)
    • 76 complex units (8,134 lines of code)
    • 342 medium complex units (17,499 lines of code)
    • 569 simple units (15,888 lines of code)
    • 3,213 very simple units (41,203 lines of code)
3% | 9% | 20% | 18% | 48%
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%
cc5% | 15% | 25% | 24% | 29%
py0% | 0% | 12% | 33% | 53%
swift0% | 0% | 0% | 14% | 85%
h0% | 0% | 0% | <1% | 99%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/CNIOBoringSSL/crypto2% | 7% | 19% | 16% | 53%
Sources/CNIOBoringSSL/ssl5% | 15% | 24% | 24% | 29%
scripts0% | 0% | 6% | 17% | 76%
Sources/NIOSSL0% | 0% | 0% | 16% | 83%
Sources/NIOSSLHTTP1Client0% | 0% | 0% | 40% | 59%
Sources/CNIOBoringSSL/include0% | 0% | 0% | 0% | 100%
Sources/NIOSSLPerformanceTester0% | 0% | 0% | 0% | 100%
Sources/CNIOBoringSSLShims0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Sources/NIOTLSServer0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool SSL_apply_handback()
in Sources/CNIOBoringSSL/ssl/handoff.cc
247 98 2
static int SSL_SESSION_to_bytes_full()
in Sources/CNIOBoringSSL/ssl/ssl_asn1.cc
199 88 3
UniquePtr SSL_SESSION_parse()
in Sources/CNIOBoringSSL/ssl/ssl_asn1.cc
221 76 3
bool SSL_serialize_handback()
in Sources/CNIOBoringSSL/ssl/handoff.cc
147 72 2
const STACK_OF()
in Sources/CNIOBoringSSL/crypto/pkcs8/pkcs8_x509.c
150 69 1
int DSA_generate_parameters_ex()
in Sources/CNIOBoringSSL/crypto/dsa/dsa.c
197 62 7
static int asn1_item_ex_d2i()
in Sources/CNIOBoringSSL/crypto/asn1/tasn_dec.c
219 61 9
int X509_verify_cert()
in Sources/CNIOBoringSSL/crypto/x509/x509_vfy.c
226 59 1
int boringssl_fips_self_test()
in Sources/CNIOBoringSSL/crypto/fipsmodule/self_check/self_check.c
503 58 2
int BN_mod_exp_mont_consttime()
in Sources/CNIOBoringSSL/crypto/fipsmodule/bn/exponentiation.c
236 57 6
bool tls13_add_certificate()
in Sources/CNIOBoringSSL/ssl/tls13_both.cc
145 55 1
int X509_print_ex()
in Sources/CNIOBoringSSL/crypto/x509/t_x509.c
139 53 4
int x509v3_cache_extensions()
in Sources/CNIOBoringSSL/crypto/x509v3/v3_purp.c
160 53 1
static bool ssl_cipher_process_rulestr()
in Sources/CNIOBoringSSL/ssl/ssl_cipher.cc
152 52 4
int TRUST_TOKEN_ISSUER_redeem()
in Sources/CNIOBoringSSL/crypto/trust_token/trust_token.c
167 50 10
static enum ssl_hs_wait_t do_send_server_hello()
in Sources/CNIOBoringSSL/ssl/tls13_server.cc
116 50 1
static int def_load_bio()
in Sources/CNIOBoringSSL/crypto/conf/conf.c
194 49 3
static int asn1_ex_i2c()
in Sources/CNIOBoringSSL/crypto/asn1/tasn_enc.c
111 48 5
int ASN1_mbstring_ncopy()
in Sources/CNIOBoringSSL/crypto/asn1/a_mbstr.c
171 47 7
static STACK_OF()
in Sources/CNIOBoringSSL/crypto/trust_token/pmbtoken.c
138 47 1