awslabs / aws-c-common
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 1,158 units with 15,158 lines of code in units (65.2% of code).
    • 2 very complex units (290 lines of code)
    • 4 complex units (423 lines of code)
    • 28 medium complex units (1,488 lines of code)
    • 117 simple units (3,347 lines of code)
    • 1,007 very simple units (9,610 lines of code)
1% | 2% | 9% | 22% | 63%
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
inl11% | 4% | 3% | 10% | 69%
c0% | 2% | 10% | 24% | 62%
h0% | 0% | 37% | 0% | 62%
py0% | 0% | 70% | 29% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
include/aws/common11% | 4% | 3% | 10% | 69%
source0% | 4% | 11% | 30% | 52%
source/posix0% | 0% | 27% | 8% | 63%
source/windows0% | 0% | 22% | 10% | 66%
verification/cbmc/proofs0% | 0% | 4% | 23% | 71%
include/aws/testing0% | 0% | 51% | 0% | 48%
source/arch/intel0% | 0% | 0% | 27% | 72%
source/android0% | 0% | 0% | 44% | 55%
verification/cbmc/stubs0% | 0% | 0% | 6% | 93%
verification/cbmc/sources0% | 0% | 0% | 2% | 97%
verification/cbmc/include0% | 0% | 0% | 0% | 100%
source/arch/arm0% | 0% | 0% | 0% | 100%
source/arch/generic0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
inl
static uint32_t hashlittle()
in include/aws/common/private/lookup3.inl
142 60 3
inl
static void hashlittle2()
in include/aws/common/private/lookup3.inl
148 60 4
inl
static uint32_t hashbig()
in include/aws/common/private/lookup3.inl
101 44 3
static int s_parse_rfc_822()
in source/date_time.c
123 43 3
static int s_parse_iso_8601()
in source/date_time.c
107 37 2
92 30 2
int aws_thread_launch()
in source/posix/thread.c
111 25 2
int aws_directory_traverse()
in source/posix/file.c
75 20 5
56 19 3
80 18 4
int aws_base64_decode()
in source/encoding.c
52 17 2
int aws_format_standard_log_line()
in source/log_formatter.c
94 17 2
int aws_xml_node_traverse()
in source/xml_parser.c
73 16 4
int aws_directory_traverse()
in source/windows/file.c
117 16 5
inl
void driver2()
in include/aws/common/private/lookup3.inl
62 15 0
int s_parse_symbol()
in source/posix/system_info.c
42 14 3
int aws_thread_launch()
in source/windows/thread.c
91 14 2
44 14 3
def main()
in verification/cbmc/proofs/scripts/move_proofs.py
38 14 0
int aws_cli_getopt_long()
in source/command_line_parser.c
56 13 5