aws-solutions / aws-instance-scheduler
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 339 units with 5,193 lines of code in units (81.9% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (565 lines of code)
    • 23 medium complex units (785 lines of code)
    • 41 simple units (851 lines of code)
    • 267 very simple units (2,992 lines of code)
0% | 10% | 15% | 16% | 57%
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% | 13% | 19% | 20% | 46%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/lambda/configuration0% | 23% | 31% | 14% | 30%
source/lambda/schedulers0% | 17% | 12% | 26% | 43%
source/lambda/util0% | 0% | 24% | 25% | 50%
source/lambda/requesthandlers0% | 0% | 7% | 25% | 66%
source/lambda/boto_retry0% | 0% | 15% | 9% | 74%
source/cli/scheduler_cli0% | 0% | 0% | 20% | 79%
source/lib0% | 0% | 0% | 0% | 100%
source/lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_desired_state()
in source/lambda/configuration/instance_schedule.py
79 47 5
def stop_instances()
in source/lambda/schedulers/ec2_service.py
76 44 2
def _process_account()
in source/lambda/schedulers/instance_scheduler.py
87 38 2
def _validate_schedule()
in source/lambda/configuration/config_admin.py
83 31 2
def get_desired_state()
in source/lambda/configuration/running_period.py
62 28 3
def __init__()
in source/lambda/configuration/setbuilders/setbuilder.py
49 28 11
def _validate_period()
in source/lambda/configuration/config_admin.py
76 26 2
def start_instances()
in source/lambda/schedulers/ec2_service.py
53 26 2
def configuration_as_dict()
in source/lambda/configuration/scheduler_config_builder.py
68 24 1
def __str__()
in source/lambda/configuration/instance_schedule.py
33 22 1
def _process_new_desired_state()
in source/lambda/schedulers/instance_scheduler.py
62 22 8
def calculate_schedule_usage_for_period()
in source/lambda/configuration/config_admin.py
66 19 5
def flush()
in source/lambda/util/logger.py
57 19 1
def _build_schedule()
in source/lambda/configuration/scheduler_config_builder.py
49 17 5
def update_config()
in source/lambda/configuration/config_admin.py
58 16 2
def _format_item()
in source/lambda/configuration/setbuilders/setbuilder.py
19 16 2
def configuration_from_dict()
in source/lambda/configuration/scheduler_config_builder.py
62 15 1
def _get_weekday()
in source/lambda/configuration/setbuilders/monthday_setbuilder.py
11 15 2
def _get_set_items()
in source/lambda/configuration/setbuilders/setbuilder.py
21 14 2
def call()
in source/lambda/boto_retry/aws_service_retry.py
35 14 4