awslabs / aws-crt-python
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 333 units with 3,495 lines of code in units (42.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (129 lines of code)
    • 6 medium complex units (335 lines of code)
    • 25 simple units (785 lines of code)
    • 301 very simple units (2,246 lines of code)
0% | 3% | 9% | 22% | 64%
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
c0% | 6% | 12% | 25% | 55%
py0% | 0% | 5% | 19% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source0% | 6% | 12% | 25% | 55%
awscrt0% | 0% | 5% | 23% | 70%
ROOT0% | 0% | 11% | 17% | 70%
awscrt/eventstream0% | 0% | 0% | 6% | 93%
continuous-delivery0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static bool s_add_native_header()
in source/event_stream_headers.c
129 34 2
def __init__()
in awscrt/mqtt.py
62 14 21
26 12 0
61 12 2
static void s_ws_handshake_transform()
in source/mqtt_client_connection.c
69 11 4
static int s_s3_request_on_body()
in source/s3_meta_request.c
58 11 4
static void s_s3_request_on_finish()
in source/s3_meta_request.c
59 11 3
def new()
in awscrt/http.py
49 10 7
def __init__()
in awscrt/s3.py
43 9 9
53 9 3
42 9 2
def __init__()
in awscrt/auth.py
51 8 14
static void s_suback_multi_callback()
in source/mqtt_client_connection.c
44 8 5
33 8 2
39 8 2
40 8 3
def subscribe()
in awscrt/mqtt.py
32 7 4
15 7 2
def awscrt_ext()
in setup.py
29 7 0
bool s_set_will()
in source/mqtt_client_connection.c
35 7 2