awslabs / aws-well-architected-labs
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 318 units with 6,669 lines of code in units (15.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (343 lines of code)
    • 14 medium complex units (1,103 lines of code)
    • 37 simple units (1,219 lines of code)
    • 265 very simple units (4,004 lines of code)
0% | 5% | 16% | 18% | 60%
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% | 6% | 18% | 18% | 56%
java0% | 0% | 47% | 26% | 25%
cs0% | 0% | 0% | 52% | 47%
ts0% | 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
static/watool0% | 9% | 22% | 9% | 58%
static/Reliability0% | 5% | 18% | 30% | 46%
static/Security0% | 0% | 86% | 0% | 13%
static/Cost0% | 0% | 0% | 19% | 80%
static/Common0% | 0% | 0% | 8% | 91%
static/Sustainability0% | 0% | 0% | 0% | 100%
static/Operations0% | 0% | 0% | 0% | 100%
static/wapartners0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lensTabCreation()
in static/watool/utilities/Code/exportAnswersToXLSX.py
206 28 8
def lambda_handler()
in static/Reliability/200_Testing_Backup_and_Restore_of_Data/Code/lambda_function.py
137 26 2
def lambda_handler()
in static/watool/200_Manage_Workload_Risks_with_OpsCenter/Code/risk_tracking.py
122 25 2
def main()
in static/watool/utilities/Code/exportImportWAFR.py
80 22 0
def deploy_dms()
in static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/Python/DMSLambda/deploy_dms_lambda.py
109 22 1
def lambda_handler()
in static/Security/200_Automated_IAM_User_Cleanup/Code/lambda-iam-user-cleanup.py
117 21 2
def main()
in static/watool/utilities/Code/exportAnswersToXLSX.py
58 20 0
def main()
in static/watool/utilities/Code/duplicateWAFR.py
61 19 0
public void failover()
in static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/FailureSimulations/java/appresiliency/src/main/java/com/app/resiliency/AZFailover.java
79 18 0
def lambda_handler()
in static/watool/200_Manage_Workload_Risks_with_OpsCenter/Code/update_workload.py
72 17 2
def deploy_web_servers()
in static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/Python/WebAppLambda/deploy_web_lambda.py
96 13 1
def deploy_read_replica()
in static/Reliability/300_Testing_for_Resiliency_of_EC2_RDS_and_S3/Code/Python/ReadReplicaLambda/deploy_read_replica_lambda.py
84 13 1
def UpdateWorkload()
in static/watool/utilities/Code/duplicateWAFR.py
52 12 10
def do_GET()
in static/Reliability/300_Health_Checks_and_Dependencies/Code/Python/server_healthcheck.py
61 12 1
def do_GET()
in static/Reliability/100_Deploy_CloudFormation/Code/Python/server_healthcheck.py
61 12 1
def UpdateWorkload()
in static/watool/utilities/Code/exportImportWAFR.py
51 11 9
def lambda_handler()
in static/Cost/300_Optimization_Data_Collection/Code/source/ecs/ecs.py
68 10 2
def getImprovementPlanHTMLDescription()
in static/watool/utilities/Code/exportAnswersToXLSX.py
35 10 2
def call_getRecommendation()
in static/Reliability/300_Health_Checks_and_Dependencies/Code/Python/server_basic.py
19 10 2
def call_getRecommendation()
in static/Reliability/300_Health_Checks_and_Dependencies/Code/Python/server_errorhandling.py
19 10 2