awslabs / aws-c-io
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 679 units with 15,764 lines of code in units (65.7% of code).
    • 1 very complex units (99 lines of code)
    • 1 complex units (183 lines of code)
    • 52 medium complex units (4,703 lines of code)
    • 82 simple units (3,819 lines of code)
    • 543 very simple units (6,960 lines of code)
<1% | 1% | 29% | 24% | 44%
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
c<1% | 1% | 30% | 24% | 43%
h0% | 0% | 0% | 7% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source1% | 0% | 25% | 20% | 53%
source/windows0% | 3% | 31% | 31% | 33%
source/posix0% | 0% | 38% | 28% | 32%
source/darwin0% | 0% | 44% | 14% | 41%
source/s2n0% | 0% | 38% | 25% | 36%
source/bsd0% | 0% | 22% | 19% | 57%
source/linux0% | 0% | 25% | 0% | 74%
include/aws0% | 0% | 0% | 7% | 92%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
99 94 1
int aws_import_key_pair_to_cert_context()
in source/windows/windows_pki_utils.c
183 27 8
static int s_determine_socket_error()
in source/windows/iocp/socket.c
40 22 1
int aws_import_public_and_private_keys_to_identity()
in source/darwin/darwin_pki_utils.c
124 21 6
static int s_drive_negotiation()
in source/darwin/secure_transport_tls_channel_handler.c
137 21 1
static int s_do_server_side_negotiation_step_2()
in source/windows/secure_channel_tls_handler.c
132 21 1
static int s_do_client_side_negotiation_step_2()
in source/windows/secure_channel_tls_handler.c
145 21 1
83 20 3
119 20 1
static void s_s2n_pkcs11_async_pkey_task()
in source/s2n/s2n_tls_channel_handler.c
144 19 3
static int s_process_read_message()
in source/windows/secure_channel_tls_handler.c
83 19 3
static void resolver_thread_fn()
in source/host_resolver.c
157 18 1
36 18 1
int aws_socket_connect()
in source/posix/socket.c
153 18 5
int aws_pipe_init()
in source/windows/iocp/pipe.c
117 18 5
static int s_standard_retry_acquire_token()
in source/standard_retry_strategy.c
123 16 5
static void s_socket_accept_event()
in source/posix/socket.c
104 16 4
static void s_event_thread_main()
in source/bsd/kqueue_event_loop.c
115 16 1
static void s_incoming_pipe_connection_event()
in source/windows/iocp/socket.c
138 16 4
int aws_load_cert_from_system_cert_store()
in source/windows/windows_pki_utils.c
102 16 3