aws-deepracer / aws-deepracer-simulation-training-notebook
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 1,315 units with 15,944 lines of code in units (76.1% of code).
    • 0 very complex units (0 lines of code)
    • 7 complex units (520 lines of code)
    • 61 medium complex units (2,884 lines of code)
    • 118 simple units (2,959 lines of code)
    • 1,129 very simple units (9,581 lines of code)
0% | 3% | 18% | 18% | 60%
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% | 3% | 18% | 18% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/markov0% | 10% | 36% | 15% | 37%
common/sagemaker_rl/orchestrator0% | 5% | 24% | 13% | 57%
src/markov/boto0% | 7% | 10% | 22% | 59%
src/markov/agent_ctrl0% | 0% | 32% | 25% | 42%
src/markov/multi_agent_coach0% | 0% | 27% | 13% | 59%
src/markov/track_geom0% | 0% | 15% | 26% | 58%
src/markov/domain_randomizations0% | 0% | 51% | 0% | 48%
common/sagemaker_rl0% | 0% | 6% | 18% | 74%
src/lib/model_validator0% | 0% | 48% | 0% | 51%
src/markov/virtual_event0% | 0% | 8% | 7% | 83%
common0% | 0% | 15% | 0% | 84%
src/markov/memories0% | 0% | 15% | 7% | 77%
src/artifacts/rewards0% | 0% | 30% | 59% | 9%
src/lib/scripts0% | 0% | 19% | 24% | 56%
src/markov/environments0% | 0% | 16% | 68% | 15%
src/markov/cameras0% | 0% | 3% | 34% | 62%
src/markov/spawn0% | 0% | 9% | 0% | 90%
src/markov/sensors0% | 0% | 1% | 19% | 79%
src/markov/metrics0% | 0% | 0% | 27% | 72%
src/markov/log_handler0% | 0% | 0% | 37% | 62%
src/markov/architecture0% | 0% | 0% | 53% | 46%
src/markov/gazebo_tracker0% | 0% | 0% | 22% | 77%
src/markov/agents0% | 0% | 0% | 27% | 72%
src/markov/gazebo_utils0% | 0% | 0% | 28% | 71%
src/markov/reset0% | 0% | 0% | 7% | 92%
src/markov/state_machine0% | 0% | 0% | 34% | 65%
src/markov/visual_effects0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
src/lib0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
src/markov/presets0% | 0% | 0% | 0% | 100%
src/markov/filters0% | 0% | 0% | 0% | 100%
src/markov/visualizations0% | 0% | 0% | 0% | 100%
src/markov/exploration_policies0% | 0% | 0% | 0% | 100%
src/markov/auth0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def training_worker()
in src/markov/training_worker.py
85 33 5
def deploy_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
76 32 4
def rollout_worker()
in src/markov/rollout_worker.py
74 30 7
def evaluation_worker()
in src/markov/evaluation_worker.py
54 28 9
def parse_model_metadata()
in src/markov/boto/s3/files/model_metadata.py
101 28 1
def get()
in src/markov/boto/s3/files/checkpoint_files/tensorflow_model.py
47 27 2
def evaluate_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
83 27 4
def main()
in src/markov/rollout_worker.py
229 25 0
def main()
in src/markov/evaluation_worker.py
215 25 0
def train_next_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 25 4
def fetch()
in src/markov/deepracer_memory.py
41 22 2
def copy_best_frozen_graph_to_sm_output_dir()
in src/markov/boto/s3/files/checkpoint_files/tensorflow_model.py
41 22 5
def __init__()
in src/markov/agent_ctrl/rollout_agent_ctrl.py
92 21 4
def initialize_first_model()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
65 21 3
def sync_experiment_state_with_ddb()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
52 20 1
def _update_experiment_db_hosting_workflow_metadata()
in common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
77 19 2
def run()
in src/lib/scripts/cloudwatch_uploader.py
22 18 1
def _judge_action_at_run_phase()
in src/markov/agent_ctrl/rollout_agent_ctrl.py
51 18 3
def get_object_reward_params()
in src/markov/track_geom/track_data.py
56 18 4
def restore_checkpoint()
in src/markov/multi_agent_coach/multi_agent_graph_manager.py
47 17 1