aws-samples / sagemaker-rl-energy-storage-system
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 314 units with 4,166 lines of code in units (77.1% of code).
    • 2 very long units (233 lines of code)
    • 10 long units (726 lines of code)
    • 48 medium size units (1,417 lines of code)
    • 65 small units (924 lines of code)
    • 189 very small units (866 lines of code)
5% | 17% | 34% | 22% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 17% | 34% | 22% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/sagemaker_rl/orchestrator/utils81% | 0% | 0% | 6% | 11%
src/sagemaker_rl/orchestrator/workflow5% | 33% | 34% | 18% | 7%
src/sagemaker_rl/orchestrator0% | 16% | 51% | 18% | 13%
src/sagemaker_rl0% | 0% | 34% | 37% | 27%
src/energy_storage_system0% | 0% | 62% | 20% | 16%
src/smnb_utils0% | 0% | 68% | 25% | 6%
src/energy_storage_system/utils0% | 0% | 27% | 38% | 34%
src/source_dir0% | 0% | 0% | 84% | 15%
src/sagemaker_rl/orchestrator/clients0% | 0% | 0% | 0% | 100%
notebooks0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_cloudwatch_dashboard_json_for_experiment_id()
in src/sagemaker_rl/orchestrator/utils/cloudwatch_logger.py
132 1 3
def evaluate_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
101 27 4
def deploy_model()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
95 32 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 _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 sync_experiment_state_with_ddb()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 20 1
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 _update_model_in_endpoint()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
51 8 4
def step()
in src/energy_storage_system/envs.py
47 6 2
def _update_model_table_training_states()
in src/sagemaker_rl/orchestrator/workflow/manager/model_manager.py
47 11 1
def __init__()
in src/energy_storage_system/envs.py
44 8 2
def ingest_joined_data()
in src/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
44 11 3
def set_up_checkpoint()
in src/sagemaker_rl/ray_launcher.py
44 10 2
def _build_mpi_command()
in src/sagemaker_rl/mpi_launcher.py
40 8 1
def start_dummy_join()
in src/sagemaker_rl/orchestrator/workflow/manager/join_manager.py
40 5 3
def ray_init_config()
in src/sagemaker_rl/ray_launcher.py
37 4 1