aws / amazon-sagemaker-examples
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 10,278 units with 134,889 lines of code in units (71.4% of code).
    • 76 very long units (10,702 lines of code)
    • 323 long units (22,763 lines of code)
    • 1,327 medium size units (39,688 lines of code)
    • 2,171 small units (31,127 lines of code)
    • 6,381 very small units (30,609 lines of code)
7% | 16% | 29% | 23% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 16% | 29% | 23% | 22%
R0% | 0% | 63% | 11% | 24%
java0% | 0% | 0% | 54% | 45%
c0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
reinforcement_learning5% | 17% | 30% | 23% | 22%
sagemaker-training-compiler89% | 0% | 0% | 5% | 4%
training26% | 14% | 16% | 20% | 21%
sagemaker-python-sdk21% | 16% | 18% | 21% | 23%
advanced_functionality12% | 21% | 22% | 17% | 25%
sagemaker_neo_compilation_jobs26% | 8% | 31% | 15% | 18%
ground_truth_labeling_jobs12% | 4% | 35% | 22% | 25%
sagemaker-debugger4% | 33% | 31% | 19% | 11%
end_to_end26% | 0% | 25% | 16% | 31%
introduction_to_amazon_algorithms10% | 20% | 23% | 17% | 28%
aws_sagemaker_studio0% | 24% | 29% | 26% | 18%
hyperparameter_tuning0% | 14% | 22% | 31% | 31%
sagemaker-pipelines0% | 36% | 51% | 2% | 8%
sagemaker_batch_transform0% | 23% | 12% | 33% | 30%
frameworks0% | 22% | 16% | 28% | 33%
sagemaker-experiments0% | 25% | 22% | 18% | 33%
step-functions-data-science-sdk0% | 39% | 14% | 29% | 17%
sagemaker_processing0% | 31% | 0% | 40% | 27%
patterns0% | 44% | 0% | 29% | 26%
contrib0% | 0% | 58% | 8% | 32%
sagemaker_model_monitor0% | 0% | 51% | 32% | 16%
aws_marketplace0% | 0% | 24% | 50% | 25%
use-cases0% | 0% | 68% | 16% | 15%
sagemaker-script-mode0% | 0% | 42% | 22% | 35%
introduction_to_applying_machine_learning0% | 0% | 52% | 37% | 10%
sagemaker-clarify0% | 0% | 47% | 44% | 8%
sagemaker-fundamentals0% | 0% | 44% | 41% | 13%
r_examples0% | 0% | 65% | 0% | 34%
sagemaker_edge_manager0% | 0% | 53% | 22% | 24%
prep_data0% | 0% | 71% | 0% | 28%
scientific_details_of_algorithms0% | 0% | 0% | 60% | 39%
sagemaker-lineage0% | 0% | 0% | 54% | 45%
utils0% | 0% | 0% | 100% | 0%
autopilot0% | 0% | 0% | 26% | 73%
sagemaker-jumpstart0% | 0% | 0% | 0% | 100%
sagemaker-inference-recommender0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/rollout_worker.py
309 25 0
def main()
in reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/evaluation_worker.py
288 25 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_multiple_node/scripts/run_mlm.py
274 74 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_single_node/scripts/run_mlm.py
272 74 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_multiple_node/scripts/run_clm.py
266 70 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_single_node/scripts/run_clm.py
258 70 0
def main()
in training/distributed_training/pytorch/model_parallel/bert/bert_example/sagemaker_smp_pretrain.py
256 54 0
def main()
in training/distributed_training/pytorch/model_parallel/gpt2/train_gpt_simple.py
219 56 0
def main()
in reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/training_worker.py
212 17 0
def parse_args()
in training/distributed_training/pytorch/model_parallel/gpt2/train_gpt_simple.py
199 1 0
def builder()
in reinforcement_learning/rl_network_compression_ray_custom/src/tensorflow_resnet/compressor/resnet.py
186 40 4
def train()
in sagemaker_neo_compilation_jobs/gluoncv_yolo/train_yolo.py
182 30 6
def train()
in sagemaker-python-sdk/mxnet_horovod_maskrcnn/source/train_mask_rcnn.py
169 48 8
def parse_arguments()
in training/distributed_training/pytorch/model_parallel/bert/bert_example/sagemaker_smp_pretrain.py
166 4 0
def parse_args()
in sagemaker-python-sdk/mxnet_horovod_maskrcnn/source/train_mask_rcnn.py
164 19 0
def parse_args()
in sagemaker-python-sdk/mxnet_horovod_fasterrcnn/source/train_faster_rcnn.py
164 19 0
def annotation_consolidation_config()
in ground_truth_labeling_jobs/multi_modal_parallel_sagemaker_labeling_workflows_with_step_functions/src/lambda_src/shared/label_arn.py
147 1 2
def pre_human_task_lambda_arn()
in ground_truth_labeling_jobs/multi_modal_parallel_sagemaker_labeling_workflows_with_step_functions/src/lambda_src/shared/label_arn.py
144 1 2
def train()
in sagemaker-python-sdk/mxnet_horovod_fasterrcnn/source/train_faster_rcnn.py
141 43 8
def train()
in sagemaker-python-sdk/dgl_gcmc/train.py
140 13 1