aws-samples / aws-serverless-shopping-cart
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 27 units with 473 lines of code in units (19.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 5 simple units (246 lines of code)
    • 22 very simple units (227 lines of code)
0% | 0% | 0% | 52% | 47%
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% | 0% | 64% | 35%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
backend/shopping-cart-service0% | 0% | 0% | 76% | 23%
frontend/src0% | 0% | 0% | 0% | 100%
backend/layers0% | 0% | 0% | 0% | 100%
backend/product-mock-service0% | 0% | 0% | 0% | 100%
frontend/scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in backend/shopping-cart-service/db_stream_handler.py
33 8 2
def lambda_handler()
in backend/shopping-cart-service/add_to_cart.py
75 8 2
def lambda_handler()
in backend/shopping-cart-service/migrate_cart.py
44 7 2
def lambda_handler()
in backend/shopping-cart-service/update_cart.py
62 7 2
def lambda_handler()
in backend/shopping-cart-service/list_cart.py
32 7 2
async function getHeaders()
in frontend/src/backend/api.js
21 4 1
def lambda_handler()
in backend/shopping-cart-service/checkout_cart.py
28 4 2
function getUser()
in frontend/src/router.js
11 3 0
function formatParams()
in frontend/scripts/fetchconfig.js
8 3 1
def lambda_handler()
in backend/product-mock-service/get_product.py
12 3 2
def handle_decimal_type()
in backend/layers/shared.py
7 3 1
def lambda_handler()
in backend/shopping-cart-service/delete_from_cart.py
10 2 2
def dynamodb_to_python()
in backend/shopping-cart-service/db_stream_handler.py
2 2 1
def get_product_from_external_service()
in backend/shopping-cart-service/utils.py
8 2 1
def get_user_sub()
in backend/layers/shared.py
8 2 1
def get_cart_id()
in backend/layers/shared.py
10 2 1
export async function getCart()
in frontend/src/backend/api.js
7 1 0
export async function postCart()
in frontend/src/backend/api.js
12 1 2
export async function putCart()
in frontend/src/backend/api.js
12 1 2
export async function getProducts()
in frontend/src/backend/api.js
7 1 0