awslabs / aws-cloudformation-templates
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 146 units with 2,614 lines of code in units (11.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (135 lines of code)
    • 6 medium complex units (254 lines of code)
    • 38 simple units (951 lines of code)
    • 101 very simple units (1,274 lines of code)
0% | 5% | 9% | 36% | 48%
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% | 11% | 42% | 39%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws/solutions/StackSetsResource0% | 21% | 23% | 45% | 9%
aws/services/CloudFormation0% | 0% | 14% | 34% | 51%
aws/solutions/lambda-backed-cloudformation-custom-resources0% | 0% | 4% | 47% | 48%
aws/solutions/PrefixListResource0% | 0% | 0% | 64% | 35%
community/custom_resources/python_custom_resource_helper0% | 0% | 0% | 95% | 4%
community/solutions/StaticWebSiteWithPipeline0% | 0% | 0% | 0% | 100%
aws/solutions/DirectoryServiceSettings0% | 0% | 0% | 0% | 100%
aws/solutions/Fetch-AMI-From-Parameter-Store0% | 0% | 0% | 0% | 100%
aws/solutions/ADConnector0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def update()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
135 27 2
def expand_role()
in aws/services/CloudFormation/MacrosExamples/ExecutionRoleBuilder/lambda/index.py
39 14 1
def create()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
84 14 2
def delete()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
49 13 2
def handle_template()
in aws/services/CloudFormation/MacrosExamples/S3Objects/lambda/macro.py
39 11 2
def change_requires_update()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
13 11 3
def cloudformation_create()
in aws/solutions/lambda-backed-cloudformation-custom-resources/get_latest_ami_id/lambda_function.py
30 11 2
def walk_resource()
in aws/services/CloudFormation/MacrosExamples/Explode/lambda/explode.py
22 10 2
def cfn_handler()
in aws/solutions/StackSetsResource/FunctionCode/crhelper.py
26 10 7
def cfn_handler()
in aws/solutions/PrefixListResource/FunctionCode/crhelper.py
29 10 7
def cfn_handler()
in community/custom_resources/python_custom_resource_helper/crhelper.py
28 10 7
def handler()
in aws/services/CloudFormation/MacrosExamples/S3Objects/lambda/resource.py
44 9 2
def create_stacks()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
48 9 6
def update_stacks()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
48 9 6
def delete_stacks()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
45 9 5
def log_config()
in aws/solutions/StackSetsResource/FunctionCode/crhelper.py
19 8 3
def send()
in aws/solutions/StackSetsResource/FunctionCode/crhelper.py
31 8 7
def update_stack_set()
in aws/solutions/StackSetsResource/FunctionCode/lambda_function.py
36 8 8
def validate_inputs()
in aws/solutions/lambda-backed-cloudformation-custom-resources/update_endpoint_policy/lambda_function.py
15 8 2
def cloudformation_update()
in aws/solutions/lambda-backed-cloudformation-custom-resources/update_endpoint_policy/lambda_function.py
18 8 3