awslabs / aws-lc
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 5,594 units with 144,576 lines of code in units (28.4% of code).
    • 20 very complex units (11,023 lines of code)
    • 99 complex units (11,116 lines of code)
    • 444 medium complex units (24,771 lines of code)
    • 759 simple units (27,682 lines of code)
    • 4,272 very simple units (69,984 lines of code)
7% | 7% | 17% | 19% | 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
go45% | 11% | 17% | 11% | 14%
c3% | 9% | 23% | 20% | 44%
cc4% | 14% | 24% | 25% | 30%
pl<1% | <1% | 6% | 21% | 71%
py0% | 0% | 6% | 31% | 61%
h0% | 0% | 0% | <1% | 99%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
util41% | 9% | 16% | 12% | 19%
crypto2% | 5% | 15% | 18% | 58%
ssl5% | 15% | 24% | 24% | 29%
tool3% | 19% | 22% | 30% | 23%
decrepit0% | 9% | 15% | 36% | 37%
fuzz0% | 0% | 57% | 0% | 42%
include0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in util/fipstools/delocate/delocate.peg.go
6113 771 1
func()
in util/fipstools/acvp/acvptool/parser.peg.go
1036 134 1
bool SSL_apply_handback()
in ssl/handoff.cc
247 98 2
199 88 3
func main()
in util/fipstools/acvp/acvptool/acvp.go
319 76 0
221 76 3
147 72 2
sub re()
in crypto/perlasm/x86_64-xlate.pl
213 70 0
const STACK_OF()
in crypto/pkcs8/pkcs8_x509.c
150 69 1
func()
in util/fipstools/delocate/delocate.go
255 64 1
197 62 7
static int asn1_item_ex_d2i()
in crypto/asn1/tasn_dec.c
219 61 9
int X509_verify_cert()
in crypto/x509/x509_vfy.c
226 59 1
int BN_mod_exp_mont_consttime()
in crypto/fipsmodule/bn/exponentiation.c
236 57 6
bool Speed()
in tool/speed.cc
109 57 1
int boringssl_fips_self_test()
in crypto/fipsmodule/self_check/self_check.c
540 56 1
bool tls13_add_certificate()
in ssl/tls13_both.cc
145 55 1
int X509_print_ex()
in crypto/x509/t_x509.c
139 53 4
int x509v3_cache_extensions()
in crypto/x509v3/v3_purp.c
160 53 1
152 52 4