aws-samples / aws-cdk-examples
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 298 units with 6,199 lines of code in units (61.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (37 lines of code)
    • 8 simple units (294 lines of code)
    • 289 very simple units (5,868 lines of code)
0% | 0% | <1% | 4% | 94%
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% | 1% | 9% | 89%
ts0% | 0% | 0% | 0% | 100%
cs0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
go0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
python/lambda-ddb-mysql-etl-pipeline0% | 0% | 14% | 51% | 34%
python/image-content-search0% | 0% | 0% | 11% | 88%
python/docker-app-with-asg-alb0% | 0% | 0% | 41% | 58%
python/rekognition-lambda-s3-trigger0% | 0% | 0% | 50% | 49%
csharp/elasticbeanstalk0% | 0% | 0% | 6% | 93%
typescript/elasticbeanstalk0% | 0% | 0% | 7% | 92%
typescript/ecs0% | 0% | 0% | 0% | 100%
typescript/waf0% | 0% | 0% | 0% | 100%
python/waf0% | 0% | 0% | 0% | 100%
python/static-site0% | 0% | 0% | 0% | 100%
typescript/lambda-manage-s3-event-notification0% | 0% | 0% | 0% | 100%
java/alb-multi-rule-response0% | 0% | 0% | 0% | 100%
go/ecs0% | 0% | 0% | 0% | 100%
python/s3-object-lambda0% | 0% | 0% | 0% | 100%
typescript/lambda-api-ci0% | 0% | 0% | 0% | 100%
typescript/appsync-graphql-dynamodb0% | 0% | 0% | 0% | 100%
python/ecs0% | 0% | 0% | 0% | 100%
typescript/appsync-graphql-eventbridge0% | 0% | 0% | 0% | 100%
python/url-shortener0% | 0% | 0% | 0% | 100%
csharp/appsync-graphql-dynamodb0% | 0% | 0% | 0% | 100%
typescript/s3-object-lambda0% | 0% | 0% | 0% | 100%
java/codebuild0% | 0% | 0% | 0% | 100%
python/codepipeline-docker-build0% | 0% | 0% | 0% | 100%
typescript/api-cors-lambda-crud-dynamodb0% | 0% | 0% | 0% | 100%
python/api-eventbridge-lambda0% | 0% | 0% | 0% | 100%
csharp/static-site0% | 0% | 0% | 0% | 100%
python/new-vpc-alb-asg-mysql0% | 0% | 0% | 0% | 100%
python/my-widget-service0% | 0% | 0% | 0% | 100%
python/batch0% | 0% | 0% | 0% | 100%
typescript/neptune-with-vpc0% | 0% | 0% | 0% | 100%
python/dynamodb-lambda0% | 0% | 0% | 0% | 100%
typescript/lambda-cloudwatch-dashboard0% | 0% | 0% | 0% | 100%
csharp/stepfunctions-job-poller0% | 0% | 0% | 0% | 100%
typescript/stepfunctions-job-poller0% | 0% | 0% | 0% | 100%
typescript/resource-overrides0% | 0% | 0% | 0% | 100%
python/ec2-cloudwatch0% | 0% | 0% | 0% | 100%
python/lambda-cloudwatch-dashboard0% | 0% | 0% | 0% | 100%
python/stepfunctions0% | 0% | 0% | 0% | 100%
python/appsync-graphql-dynamodb0% | 0% | 0% | 0% | 100%
typescript/custom-resource-provider0% | 0% | 0% | 0% | 100%
typescript/fsx-ad0% | 0% | 0% | 0% | 100%
python/api-sqs-lambda0% | 0% | 0% | 0% | 100%
typescript/ec2-instance0% | 0% | 0% | 0% | 100%
typescript/custom-resource0% | 0% | 0% | 0% | 100%
csharp/random-writer0% | 0% | 0% | 0% | 100%
python/custom-resource0% | 0% | 0% | 0% | 100%
go/eks0% | 0% | 0% | 0% | 100%
go/classic-load-balancer0% | 0% | 0% | 0% | 100%
python/api-cors-lambda0% | 0% | 0% | 0% | 100%
typescript/http-proxy-apigateway0% | 0% | 0% | 0% | 100%
csharp/my-widget-service0% | 0% | 0% | 0% | 100%
python/lambda-from-container0% | 0% | 0% | 0% | 100%
typescript/my-widget-service0% | 0% | 0% | 0% | 100%
python/existing-vpc-new-ec2-ebs-userdata0% | 0% | 0% | 0% | 100%
go/lambda-cron0% | 0% | 0% | 0% | 100%
typescript/cognito-api-lambda0% | 0% | 0% | 0% | 100%
python/cross-stack-resources0% | 0% | 0% | 0% | 100%
python/lambda-triggered-by-existing-kinesis-stream0% | 0% | 0% | 0% | 100%
csharp/application-load-balancer0% | 0% | 0% | 0% | 100%
python/ec20% | 0% | 0% | 0% | 100%
csharp/classic-load-balancer0% | 0% | 0% | 0% | 100%
typescript/eks0% | 0% | 0% | 0% | 100%
python/application-load-balancer0% | 0% | 0% | 0% | 100%
typescript/application-load-balancer0% | 0% | 0% | 0% | 100%
python/lambda-cron0% | 0% | 0% | 0% | 100%
python/lambda-layer0% | 0% | 0% | 0% | 100%
python/classic-load-balancer0% | 0% | 0% | 0% | 100%
typescript/classic-load-balancer0% | 0% | 0% | 0% | 100%
csharp/capitalize-string0% | 0% | 0% | 0% | 100%
csharp/lambda-cron0% | 0% | 0% | 0% | 100%
python/rds0% | 0% | 0% | 0% | 100%
java/custom-resource0% | 0% | 0% | 0% | 100%
typescript/lambda-layer0% | 0% | 0% | 0% | 100%
python/lambda-with-existing-s3-code0% | 0% | 0% | 0% | 100%
typescript/lambda-cron0% | 0% | 0% | 0% | 100%
python/lambda-s3-trigger0% | 0% | 0% | 0% | 100%
typescript/amplify-console-app0% | 0% | 0% | 0% | 100%
typescript/custom-logical-names0% | 0% | 0% | 0% | 100%
python/emr0% | 0% | 0% | 0% | 100%
typescript/static-site0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def dynamic_mysql_crud_ops()
in python/lambda-ddb-mysql-etl-pipeline/lambda/dbwrite.py
37 16 3
def handler()
in python/image-content-search/src/imageData/main.py
21 9 2
def get_mysql_attrs()
in python/lambda-ddb-mysql-etl-pipeline/lambda/dbwrite.py
40 8 1
def __init__()
in python/lambda-ddb-mysql-etl-pipeline/etl_pipeline_cdk/etl_pipeline_cdk_stack.py
91 7 4
def get_user_params()
in typescript/elasticbeanstalk/elasticbeanstalk-bg-pipeline/resources/blue_green.py
13 6 1
def get_user_params()
in csharp/elasticbeanstalk/elasticbeanstalk-bg-pipeline/resources/blue_green.py
13 6 1
def handler()
in python/image-content-search/src/imageAnalysis/main.py
35 6 2
def __init__()
in python/docker-app-with-asg-alb/dockerized_app_cdk/asg_stack.py
49 6 5
def __init__()
in python/rekognition-lambda-s3-trigger/rekognition_lambda_s3_trigger/rekognition_lambda_s3_trigger_stack.py
32 6 4
private void load()
in java/alb-multi-rule-response/src/main/java/com/myorg/utils/PropertyLoader.java
25 5 0
function mergeConfigurations()
in typescript/lambda-manage-s3-event-notification/lambda/manage-s3-event-notifications.js
17 5 3
def search_label()
in python/image-content-search/src/imageData/helper/search.py
22 5 3
def main()
in python/url-shortener/lambda/handler.py
15 5 2
def handler()
in python/s3-object-lambda/lambda/retrieve_transformed_object_lambda/index.py
46 5 2
def handler()
in java/custom-resource/lambda/custom-resource-handler.py
17 4 2
def on_event()
in typescript/custom-resource-provider/custom-resource-handler.py
7 4 2
exports.handler = function()
in typescript/ecs/fargate-service-with-efs/lambda.js
55 4 3
def main()
in typescript/custom-resource/custom-resource-handler.py
17 4 2
def __init__()
in python/appsync-graphql-dynamodb/app_sync_cdk/app_sync_cdk_stack.py
55 4 4
def __init__()
in python/api-eventbridge-lambda/api_eventbridge_lambda/api_eventbridge_lambda.py
61 4 4