aws-solutions / aws-ops-automator
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 997 units with 13,043 lines of code in units (71.8% of code).
    • 2 very complex units (338 lines of code)
    • 12 complex units (1,345 lines of code)
    • 77 medium complex units (3,287 lines of code)
    • 128 simple units (2,678 lines of code)
    • 778 very simple units (5,395 lines of code)
2% | 10% | 25% | 20% | 41%
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
py2% | 10% | 25% | 20% | 41%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
code/handlers7% | 4% | 28% | 20% | 38%
code/configuration14% | 8% | 24% | 12% | 38%
code/actions0% | 24% | 30% | 22% | 23%
code/builders0% | 49% | 13% | 13% | 23%
code/services0% | 5% | 12% | 23% | 59%
code/scheduling0% | 7% | 24% | 32% | 36%
code/testing0% | 0% | 24% | 19% | 56%
code0% | 0% | 35% | 23% | 41%
code/tagging0% | 0% | 42% | 13% | 43%
code/outputs0% | 0% | 25% | 13% | 61%
code/boto_retry0% | 0% | 17% | 15% | 67%
code/helpers0% | 0% | 24% | 38% | 37%
code/metrics0% | 0% | 0% | 34% | 65%
ecs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def handle_request()
in source/code/handlers/select_resources_handler.py
216 84 1
def _verify_configuration_item()
in source/code/configuration/task_configuration.py
122 58 2
def is_completed()
in source/code/actions/ec2_replace_instance_action.py
78 38 2
def _setup_common_parameters()
in source/code/builders/action_template_builder.py
305 37 1
def _create_replacement_instance()
in source/code/actions/ec2_replace_instance_action.py
156 37 1
def is_completed()
in source/code/actions/ec2_create_snapshot_action.py
129 37 2
def is_completed()
in source/code/actions/ec2_copy_snapshot_action.py
145 36 2
def verify_task_parameters()
in source/code/configuration/task_configuration.py
75 35 4
def handle_request()
in source/code/handlers/task_tracking_handler.py
121 30 1
def __init__()
in source/code/scheduling/setbuilder.py
49 28 11
def compress_template()
in source/code/builders/cross_account_role_builder.py
91 27 1
def process_and_select_resource()
in source/code/actions/ec2_copy_snapshot_action.py
74 27 7
def describe()
in source/code/services/aws_service.py
58 27 12
def is_completed()
in source/code/actions/ec2_resize_instance_action.py
64 26 2
def build_tags_from_template()
in source/code/tagging/__init__.py
81 25 9
def handle_scheduler_tasks()
in source/code/handlers/schedule_handler.py
67 24 2
def _setup_action_parameters()
in source/code/builders/action_template_builder.py
51 23 1
def _get_tags_for_resource()
in source/code/services/rds_service.py
42 22 3
def execute()
in source/code/actions/ec2_create_snapshot_action.py
57 21 1
def handle_request()
in source/code/handlers/event_handler_base.py
75 21 2