aws-samples / aws-deepracer-workshops
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,147 units with 17,385 lines of code in units (61.7% of code).
    • 0 very complex units (0 lines of code)
    • 7 complex units (1,053 lines of code)
    • 68 medium complex units (3,964 lines of code)
    • 95 simple units (2,650 lines of code)
    • 977 very simple units (9,718 lines of code)
0% | 6% | 22% | 15% | 55%
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% | 6% | 22% | 15% | 55%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Advanced workshops/reInvent2019-400/customize0% | 31% | 27% | 14% | 26%
Advanced workshops/reInvent2019-400/src0% | 10% | 20% | 21% | 47%
Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO0% | 2% | 25% | 14% | 57%
Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN0% | 2% | 21% | 15% | 59%
Advanced workshops/AI Driving Olympics 2019/challenge_eval_submit0% | 0% | 15% | 4% | 79%
Advanced workshops/reInvent2019-400/common0% | 0% | 17% | 0% | 82%
Advanced workshops/reInvent2019-4000% | 0% | 9% | 5% | 84%
log-analysis0% | 0% | 17% | 10% | 71%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def infer_reward_state()
in Advanced workshops/reInvent2019-400/src/markov/environments/deepracer_racetrack_env.py
245 45 3
def infer_reward_state()
in Advanced workshops/reInvent2019-400/customize/deepracer_racetrack_env_lidar_5cars.py
245 45 3
def infer_reward_state()
in Advanced workshops/reInvent2019-400/customize/deepracer_racetrack_env_lidar_3cars.py
245 45 3
def deploy_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
76 32 4
def deploy_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
76 32 4
def evaluate_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
83 27 4
def evaluate_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
83 27 4
def train_next_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 25 4
def train_next_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
67 25 4
def __init__()
in Advanced workshops/reInvent2019-400/src/markov/environments/deepracer_racetrack_env.py
144 21 1
def __init__()
in Advanced workshops/reInvent2019-400/customize/deepracer_racetrack_env_lidar_5cars.py
144 21 1
def __init__()
in Advanced workshops/reInvent2019-400/customize/deepracer_racetrack_env_lidar_3cars.py
142 21 1
def initialize_first_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
65 21 3
def initialize_first_model()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
65 21 3
def rollout_worker()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/markov/rollout_worker.py
45 20 5
def sync_experiment_state_with_ddb()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
52 20 1
def rollout_worker()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/rollout_worker.py
45 20 5
def sync_experiment_state_with_ddb()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
52 20 1
def _update_experiment_db_hosting_workflow_metadata()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
77 19 2
def _update_experiment_db_hosting_workflow_metadata()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
77 19 2