aws-samples / serverless-samples
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 93 units with 2,316 lines of code in units (20.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 11 medium complex units (1,246 lines of code)
    • 13 simple units (478 lines of code)
    • 69 very simple units (592 lines of code)
0% | 0% | 53% | 20% | 25%
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% | 65% | 10% | 23%
js0% | 0% | 0% | 65% | 34%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
serverless-rest-api/python-http-cdk0% | 0% | 67% | 13% | 19%
serverless-rest-api/python-rest-sam0% | 0% | 69% | 6% | 23%
serverless-rest-api/python-http-sam0% | 0% | 68% | 7% | 24%
fargate-rest-api/javascript-rest-nlb-ecs-sam0% | 0% | 0% | 63% | 36%
serverless-rest-api/javascript-http-sam0% | 0% | 0% | 67% | 32%
apigw-private-custom-domain-name/src0% | 0% | 0% | 0% | 100%
lambda-ecs-dual-deploy/3-flask-dual-deployment0% | 0% | 0% | 0% | 100%
lambda-ecs-dual-deploy/2-flask-lambda-container0% | 0% | 0% | 0% | 100%
lambda-ecs-dual-deploy/1-flask-app-container0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in serverless-rest-api/python-http-sam/src/api/bookings.py
81 15 3
def lambda_handler()
in serverless-rest-api/python-rest-sam/src/api/bookings.py
84 15 3
def validate_token()
in serverless-rest-api/python-http-sam/src/api/authorizer.py
34 12 2
def validate_token()
in serverless-rest-api/python-rest-sam/src/api/authorizer.py
34 12 2
def validate_token()
in serverless-rest-api/python-http-cdk/src/api/authorizer.py
34 12 2
def lambda_handler()
in serverless-rest-api/python-http-sam/src/api/resources.py
68 11 3
def lambda_handler()
in serverless-rest-api/python-http-sam/src/api/locations.py
57 11 3
def lambda_handler()
in serverless-rest-api/python-rest-sam/src/api/resources.py
71 11 3
def lambda_handler()
in serverless-rest-api/python-rest-sam/src/api/locations.py
60 11 3
def __init__()
in serverless-rest-api/python-http-cdk/lib/serverless_api_stack.py
642 11 5
def lambda_handler()
in serverless-rest-api/python-http-cdk/src/api/bookings.py
81 11 3
function processAuthRequest()
in serverless-rest-api/javascript-http-sam/src/api/authorizer.js
71 9 5
function processAuthRequest()
in fargate-rest-api/javascript-rest-nlb-ecs-sam/src/api/authorizer/authorizer.js
71 9 5
def lambda_handler()
in serverless-rest-api/python-http-cdk/src/api/resources.py
68 8 3
def lambda_handler()
in serverless-rest-api/python-http-cdk/src/api/locations.py
57 8 3
def _add_method()
in serverless-rest-api/python-http-sam/src/api/authorizer.py
25 7 5
def _add_method()
in serverless-rest-api/python-rest-sam/src/api/authorizer.py
25 7 5
def _add_method()
in serverless-rest-api/python-http-cdk/src/api/authorizer.py
25 7 5
function AuthPolicy()
in serverless-rest-api/javascript-http-sam/src/api/authorizer.js
23 7 3
function addMethod()
in serverless-rest-api/javascript-http-sam/src/api/authorizer.js
24 7 4