aws-solutions / workspaces-cost-optimizer
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 47 units with 741 lines of code in units (81.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 4 simple units (93 lines of code)
    • 43 very simple units (648 lines of code)
0% | 0% | 0% | 12% | 87%
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% | 0% | 12% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ecs0% | 0% | 0% | 15% | 84%
ecs/utils0% | 0% | 0% | 0% | 100%
lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_user_sessions()
in source/ecs/metrics_helper.py
28 10 3
def get_termination_status()
in source/ecs/workspaces_helper.py
29 8 4
def compare_usage_metrics_for_always_on()
in source/ecs/workspaces_helper.py
21 8 5
def compare_usage_metrics_for_auto_stop()
in source/ecs/workspaces_helper.py
15 6 5
def set_stack_parameters()
in source/ecs/workspaces_app.py
28 5 0
def get_valid_workspaces_regions()
in source/ecs/workspaces_app.py
17 5 1
def check_for_skip_tag()
in source/ecs/workspaces_helper.py
8 5 2
def compare_usage_metrics()
in source/ecs/workspaces_helper.py
22 5 5
def get_cloudwatch_metric_data_points()
in source/ecs/metrics_helper.py
24 4 4
def create_s3_key()
in source/ecs/utils/s3_utils.py
16 4 3
def modify_workspace_properties()
in source/ecs/workspaces_helper.py
18 4 3
def check_if_workspace_needs_to_be_terminated()
in source/ecs/workspaces_helper.py
11 4 2
def process_directory()
in source/ecs/directory_reader.py
50 4 4
def get_partition()
in source/ecs/workspaces_app.py
13 3 0
def get_workspaces_directories()
in source/ecs/workspaces_app.py
23 3 1
def process_directories()
in source/ecs/workspaces_app.py
22 3 1
def get_user_connected_hours()
in source/ecs/metrics_helper.py
11 3 3
def default()
in source/ecs/utils/decimal_encoder.py
7 3 2
def get_workspaces_for_directory()
in source/ecs/workspaces_helper.py
21 3 2
def check_workspace_usage_for_current_month()
in source/ecs/workspaces_helper.py
13 3 2