aws-samples / sagemaker-rl-energy-storage-system
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 314 units with 4,166 lines of code in units (77.1% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (196 lines of code)
    • 13 medium complex units (758 lines of code)
    • 22 simple units (615 lines of code)
    • 277 very simple units (2,597 lines of code)
0% | 4% | 18% | 14% | 62%
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% | 4% | 18% | 14% | 62%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/sagemaker_rl/orchestrator/workflow0% | 10% | 32% | 15% | 41%
src/sagemaker_rl0% | 0% | 6% | 19% | 74%
src/sagemaker_rl/orchestrator0% | 0% | 16% | 9% | 73%
src/energy_storage_system0% | 0% | 0% | 33% | 66%
src/sagemaker_rl/orchestrator/clients0% | 0% | 0% | 0% | 100%
src/sagemaker_rl/orchestrator/utils0% | 0% | 0% | 0% | 100%
src/energy_storage_system/utils0% | 0% | 0% | 0% | 100%
src/smnb_utils0% | 0% | 0% | 0% | 100%
src/source_dir0% | 0% | 0% | 0% | 100%
notebooks0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def deploy_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
95 32 4
def evaluate_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
101 27 4
def train_next_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
86 25 4
def initialize_first_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
82 21 3
def sync_experiment_state_with_ddb()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 20 1
def _update_experiment_db_hosting_workflow_metadata()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
79 19 2
def join()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
71 16 5
def _update_experiment_db_training_workflow_metadata()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
70 15 2
def _update_model_table_evaluation_states()
in src/sagemaker_rl/orchestrator/workflow/manager/model_manager.py
63 14 1
def _usable_shared_cf_stack_exists()
in src/sagemaker_rl/orchestrator/resource_manager.py
62 13 1
def copy_checkpoints_to_model_output()
in src/sagemaker_rl/ray_launcher.py
31 13 1
def get_config_args()
in src/sagemaker_rl/coach_launcher.py
31 11 2
def ingest_joined_data()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
44 11 3
def _update_join_table_states()
in src/sagemaker_rl/orchestrator/workflow/manager/join_manager.py
25 11 2
def _update_model_table_training_states()
in src/sagemaker_rl/orchestrator/workflow/manager/model_manager.py
47 11 1
def _update_metrics_from_latest_eval_job()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
32 10 2
def get_eval_score()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
36 10 3
def set_up_checkpoint()
in src/sagemaker_rl/ray_launcher.py
44 10 2
def __init__()
in src/energy_storage_system/envs.py
44 8 2
def get_graph_manager_from_args()
in src/sagemaker_rl/coach_launcher.py
11 8 2