aws-samples / aws-serverless-ecommerce-platform
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 96 units with 1,710 lines of code in units (20.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (94 lines of code)
    • 8 simple units (249 lines of code)
    • 86 very simple units (1,367 lines of code)
0% | 0% | 5% | 14% | 79%
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
py0% | 0% | 7% | 18% | 74%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
shared0% | 0% | 28% | 21% | 50%
products0% | 0% | 40% | 0% | 59%
warehouse0% | 0% | 0% | 26% | 73%
orders0% | 0% | 0% | 24% | 75%
delivery0% | 0% | 0% | 37% | 62%
payment-3p0% | 0% | 0% | 0% | 100%
payment0% | 0% | 0% | 0% | 100%
platform0% | 0% | 0% | 0% | 100%
users0% | 0% | 0% | 0% | 100%
delivery-pricing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def ddb_to_event()
in shared/src/ecom/ecom/eventbridge.py
58 14 5
def validate_products()
in products/src/validate/main.py
36 12 1
def match()
in shared/lint/rules/custom_rules.py
21 9 2
def match()
in shared/lint/rules/custom_rules.py
23 9 2
def handler()
in orders/src/on_events/main.py
49 9 2
def on_order_modified()
in warehouse/src/on_order_events/main.py
35 8 2
def process_record()
in delivery/src/table_update/main.py
60 8 1
def handler()
in orders/src/get_order/main.py
21 7 2
def parse_record()
in warehouse/src/table_update/main.py
23 6 1
def get_diff()
in warehouse/src/on_order_events/main.py
17 6 2
def delete_products()
in warehouse/src/on_order_events/main.py
27 5 2
def on_order_created()
in warehouse/src/on_order_events/main.py
15 5 1
def handler()
in delivery-pricing/src/pricing/main.py
24 5 2
def default()
in shared/src/ecom/ecom/helpers.py
8 5 2
def match()
in shared/lint/rules/custom_rules.py
14 5 2
def handler()
in delivery/src/table_update/main.py
23 5 2
def compare_product()
in products/src/validate/main.py
11 5 2
def handler()
in products/src/validate/main.py
19 5 2
def handler()
in payment/src/validate/main.py
21 5 2
def validate_delivery()
in orders/src/create_order/main.py
31 5 1