aws-samples / amazon-sagemaker-unity-game-simulation
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 339 units with 4,435 lines of code in units (49.4% of code).
    • 2 very long units (235 lines of code)
    • 12 long units (839 lines of code)
    • 48 medium size units (1,398 lines of code)
    • 71 small units (998 lines of code)
    • 206 very small units (965 lines of code)
5% | 18% | 31% | 22% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 18% | 31% | 22% | 21%
cs0% | 29% | 30% | 22% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common/sagemaker_rl/orchestrator/utils81% | 0% | 0% | 6% | 11%
common/sagemaker_rl/orchestrator/workflow5% | 34% | 34% | 18% | 7%
common/sagemaker_rl/orchestrator0% | 16% | 51% | 18% | 13%
src0% | 29% | 62% | 0% | 7%
RollerBall/Assets0% | 29% | 30% | 22% | 17%
common/sagemaker_rl0% | 0% | 34% | 37% | 27%
common0% | 0% | 9% | 47% | 43%
common/sagemaker_rl/orchestrator/clients0% | 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 common/sagemaker_rl/orchestrator/utils/cloudwatch_logger.py
132 1 3
def evaluate_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
103 27 4
def deploy_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def train_next_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
87 25 4
def initialize_first_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
83 21 3
def _update_experiment_db_hosting_workflow_metadata()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
79 19 2
def join()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
72 16 5
def _update_experiment_db_training_workflow_metadata()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
70 15 2
def sync_experiment_state_with_ddb()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 20 1
def _update_model_table_evaluation_states()
in common/sagemaker_rl/orchestrator/workflow/manager/model_manager.py
63 14 1
def _usable_shared_cf_stack_exists()
in common/sagemaker_rl/orchestrator/resource_manager.py
62 13 1
def run()
in src/evaluate-unity.py
57 10 2
def _update_model_in_endpoint()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
52 8 4
public void SaveLog()
in RollerBall/Assets/RollerAgent.cs
51 6 1
def _update_model_table_training_states()
in common/sagemaker_rl/orchestrator/workflow/manager/model_manager.py
47 11 1
def ingest_joined_data()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
44 11 3
def set_up_checkpoint()
in common/sagemaker_rl/ray_launcher.py
44 10 2
def _build_mpi_command()
in common/sagemaker_rl/mpi_launcher.py
40 8 1
def start_dummy_join()
in common/sagemaker_rl/orchestrator/workflow/manager/join_manager.py
40 5 3
def get_eval_score()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
37 10 3