aws-samples / serverless-patterns
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 158 units with 4,949 lines of code in units (28.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (42 lines of code)
    • 3 simple units (126 lines of code)
    • 154 very simple units (4,781 lines of code)
0% | 0% | <1% | 2% | 96%
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% | 2% | 7% | 90%
ts0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
cs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sqs-lambda-eb-cdk-python0% | 0% | 35% | 0% | 64%
cognito-restapi-vpclink0% | 0% | 0% | 59% | 40%
xray-lambdalayers-cdk-python0% | 0% | 0% | 77% | 22%
cdk-eventbridge-appsync-oauth0% | 0% | 0% | 0% | 100%
apig-waf0% | 0% | 0% | 0% | 100%
apigw-s3-cdk0% | 0% | 0% | 0% | 100%
cdk-codecommit-codepipeline-sfn-athena-glue0% | 0% | 0% | 0% | 100%
ta-eventbridge-lambda-s30% | 0% | 0% | 0% | 100%
cdk-cloudfront-to-s3-and-lambda0% | 0% | 0% | 0% | 100%
apigw-to-private-apig-cdk0% | 0% | 0% | 0% | 100%
apigw-http-api-lambda-rds-proxy-cdk0% | 0% | 0% | 0% | 100%
parallel-e2e-pipeline-cdk0% | 0% | 0% | 0% | 100%
private-apigw-lambda-cdk0% | 0% | 0% | 0% | 100%
apigw-canary-deployment-cdk0% | 0% | 0% | 0% | 100%
cdk-vpc-lambda-sfn0% | 0% | 0% | 0% | 100%
fargate-sns-sqs-cdk0% | 0% | 0% | 0% | 100%
aurora-serverless-s3-ingestion0% | 0% | 0% | 0% | 100%
apigw-lambda-dynamodb-cdk0% | 0% | 0% | 0% | 100%
appsync-dynamodb-singletable-cdk0% | 0% | 0% | 0% | 100%
cdk-eventbridge-appsync0% | 0% | 0% | 0% | 100%
fargate-s3-cdk0% | 0% | 0% | 0% | 100%
apigw-http-api-eventbridge-dotnet-cdk0% | 0% | 0% | 0% | 100%
apigw-rest-api-dynamodb-cdk0% | 0% | 0% | 0% | 100%
sfn-callback-cdk0% | 0% | 0% | 0% | 100%
apigw-sns-sqs-lambda-cdk0% | 0% | 0% | 0% | 100%
cdk-eventbridge-stepfunction0% | 0% | 0% | 0% | 100%
fargate-sfn-cdk0% | 0% | 0% | 0% | 100%
fargate-sqs-cdk0% | 0% | 0% | 0% | 100%
apigw-http-api-lambda-cdk0% | 0% | 0% | 0% | 100%
apigw-http-api-eventbridge-cdk0% | 0% | 0% | 0% | 100%
lambda-efs-cdk0% | 0% | 0% | 0% | 100%
apigw-fargate-cdk0% | 0% | 0% | 0% | 100%
auroraserverless-secretsmanager0% | 0% | 0% | 0% | 100%
fargate-dynamodb-cdk0% | 0% | 0% | 0% | 100%
fargate-aurora-serverless-cdk0% | 0% | 0% | 0% | 100%
sfn-inside-sfn-cdk-python0% | 0% | 0% | 0% | 100%
cfn-custom-resource-s3-create0% | 0% | 0% | 0% | 100%
fargate-eventbridge-cdk0% | 0% | 0% | 0% | 100%
fargate-sns-cdk0% | 0% | 0% | 0% | 100%
sfn-glue-sync-cdk0% | 0% | 0% | 0% | 100%
appsync-express-workflow0% | 0% | 0% | 0% | 100%
sfn-log-export0% | 0% | 0% | 0% | 100%
iot-lambda-cdk0% | 0% | 0% | 0% | 100%
lambda-cloudwatch-cdk0% | 0% | 0% | 0% | 100%
lambda-sns-cdk0% | 0% | 0% | 0% | 100%
appsync-notify-subscribers-of-database-updates0% | 0% | 0% | 0% | 100%
lambda-dynamodb-cdk0% | 0% | 0% | 0% | 100%
lambda-sns-sms-cdk0% | 0% | 0% | 0% | 100%
sqs-lambda-cdk-python0% | 0% | 0% | 0% | 100%
appsync-eventbridge0% | 0% | 0% | 0% | 100%
sqs-lambda-cdk0% | 0% | 0% | 0% | 100%
apigw-http-api-lambda-rds-proxy0% | 0% | 0% | 0% | 100%
cdk-lambda-appsync0% | 0% | 0% | 0% | 100%
lambda-sqs-cdk0% | 0% | 0% | 0% | 100%
cloudfront-lambda-edge-cdk-python0% | 0% | 0% | 0% | 100%
msk-lambda-cdk0% | 0% | 0% | 0% | 100%
fargate-secretsmanager0% | 0% | 0% | 0% | 100%
sfn-dynamodb-cdk0% | 0% | 0% | 0% | 100%
sqs-lambda-dynamodb-cdk0% | 0% | 0% | 0% | 100%
cloudfront-cff-s3-cdk-python0% | 0% | 0% | 0% | 100%
eventbridge-lambda-cdk0% | 0% | 0% | 0% | 100%
sns-lambda-cdk0% | 0% | 0% | 0% | 100%
appsync-direct-lambda-resolver0% | 0% | 0% | 0% | 100%
cdk-appsync-sns0% | 0% | 0% | 0% | 100%
eventbridge-cloudwatch-cdk0% | 0% | 0% | 0% | 100%
cdk-appsync-sqs0% | 0% | 0% | 0% | 100%
eventbridge-scheduled-lambda-cdk-typescript0% | 0% | 0% | 0% | 100%
eventbridge-sqs-cdk0% | 0% | 0% | 0% | 100%
fargate-cdk0% | 0% | 0% | 0% | 100%
eventbridge-sns-cdk0% | 0% | 0% | 0% | 100%
dynamodb-lambda-cdk0% | 0% | 0% | 0% | 100%
s3-lambda-cdk0% | 0% | 0% | 0% | 100%
rabbitmq-lambda0% | 0% | 0% | 0% | 100%
sns-sqs-cdk0% | 0% | 0% | 0% | 100%
lambda-aurora-serverless0% | 0% | 0% | 0% | 100%
sfn-sqs-cdk0% | 0% | 0% | 0% | 100%
apigw-lambda-cdk0% | 0% | 0% | 0% | 100%
amplify_cognito_apigateway_lambda_envvariables0% | 0% | 0% | 0% | 100%
lambda-lambda0% | 0% | 0% | 0% | 100%
sfn-comprehend-sdk0% | 0% | 0% | 0% | 100%
dynamodb-kinesis-cdk0% | 0% | 0% | 0% | 100%
systems-manager-automation-to-lambda0% | 0% | 0% | 0% | 100%
apigw-lambda-qldb0% | 0% | 0% | 0% | 100%
s3-sqs-cdk0% | 0% | 0% | 0% | 100%
apigw-lambda-dynamodb0% | 0% | 0% | 0% | 100%
lambda-s30% | 0% | 0% | 0% | 100%
sfn-glue-sam0% | 0% | 0% | 0% | 100%
eventbridge-scheduled-lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def handler()
in sqs-lambda-eb-cdk-python/lambda/submit_job.py
42 11 2
def __init__()
in xray-lambdalayers-cdk-python/lambda_layer_x_ray_stack/lambda_layer_x_ray_stack_stack.py
51 7 4
def on_create()
in cognito-restapi-vpclink/AuxLambdaFunctionSecGrp/index.py
32 6 2
def handler()
in cognito-restapi-vpclink/AuxLambdaFunctionNLB/index.py
43 6 2
def wake_aurora()
in aurora-serverless-s3-ingestion/cdk/lambda/DataIngest.py
22 5 0
def lambda_handler()
in aurora-serverless-s3-ingestion/cdk/lambda/DataIngest.py
26 5 2
def __init__()
in apigw-canary-deployment-cdk/app.py
38 5 4
def lambda_handler()
in lambda-efs-cdk/lambda_function/lambda_function.py
14 4 2
def handler()
in cdk-eventbridge-appsync-oauth/cdk/lib/authorizer/app.py
32 4 2
def lambda_handler()
in rabbitmq-lambda/src/app.py
19 4 2
def lambda_handler()
in ta-eventbridge-lambda-s3/lambda_functions/refreshTrustedAdvisorCheck/refreshTrustedAdvisorCheck.py
12 4 2
def lambda_handler()
in ta-eventbridge-lambda-s3/lambda_functions/s3openbucket/s3openbucket.py
19 4 2
def __init__()
in fargate-secretsmanager/src/fargate_secretsmanager_stack.py
35 4 4
def __init__()
in sfn-glue-sync-cdk/app.py
44 4 4
def send()
in cognito-restapi-vpclink/AuxLambdaFunctionNLB/cfnresponse.py
25 4 7
constructor()
in apigw-to-private-apig-cdk/src/vpc/index.ts
41 3 2
def handler()
in sfn-log-export/src/functions/export_status_check/index.py
10 3 2
def handler()
in sfn-log-export/src/functions/query_log_groups/index.py
13 3 2
constructor()
in cdk-eventbridge-appsync-oauth/cdk/lib/auth.ts
54 3 3
constructor()
in private-apigw-lambda-cdk/src/vpc/index.ts
41 3 2