aws-samples / aws-deepracer-workshops
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 1,147 units with 17,385 lines of code in units (61.7% of code).
    • 15 very long units (2,255 lines of code)
    • 46 long units (3,098 lines of code)
    • 150 medium size units (4,527 lines of code)
    • 261 small units (3,774 lines of code)
    • 675 very small units (3,731 lines of code)
12% | 17% | 26% | 21% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 17% | 26% | 21% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Advanced workshops/reInvent2019-400/customize50% | 0% | 25% | 10% | 13%
Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO9% | 22% | 23% | 23% | 21%
Advanced workshops/reInvent2019-400/src21% | 17% | 22% | 19% | 18%
Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN6% | 22% | 25% | 23% | 22%
Advanced workshops/reInvent2019-4000% | 0% | 54% | 23% | 21%
Advanced workshops/AI Driving Olympics 2019/challenge_eval_submit0% | 0% | 41% | 27% | 31%
log-analysis0% | 0% | 52% | 21% | 25%
Advanced workshops/reInvent2019-400/common0% | 0% | 30% | 28% | 41%
Alternative Visuals
Longest Units
Top 20 longest 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 get_cloudwatch_dashboard_json_for_experiment_id()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/common/sagemaker_rl/orchestrator/utils/cloudwatch_logger.py
158 1 3
def get_cloudwatch_dashboard_json_for_experiment_id()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/common/sagemaker_rl/orchestrator/utils/cloudwatch_logger.py
158 1 3
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 infer_reward_state()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/markov/environments/deepracer_racetrack_env.py
114 18 3
def infer_reward_state()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/environments/deepracer_racetrack_env_cv2.py
114 18 3
def infer_reward_state()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/environments/deepracer_racetrack_env.py
114 18 3
def infer_reward_state()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/environments/deepracer_racetrack_env_original.py
114 18 3
def main()
in Advanced workshops/reInvent2019-400/src/training_worker.py
106 8 0
def main()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/training_worker.py
106 8 0
def main()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/training_worker.py
106 8 0
def main()
in Advanced workshops/reInvent2019-400/src/markov/rollout_worker.py
94 4 0
def main()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/markov/rollout_worker.py
92 4 0
def main()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/rollout_worker.py
92 4 0
def __init__()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/markov/environments/deepracer_racetrack_env.py
90 11 1
def __init__()
in Advanced workshops/AI Driving Olympics 2019/challenge_train_w_PPO/src/markov/environments/deepracer_racetrack_env_cv2.py
90 11 1