aws-samples / amazon-sagemaker-managed-spot-training
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 47 units with 536 lines of code in units (59.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 3 medium size units (121 lines of code)
    • 13 small units (183 lines of code)
    • 30 very small units (169 lines of code)
0% | 11% | 22% | 34% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 22% | 34% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pytorch_managed_spot_training_checkpointing/source_dir0% | 54% | 0% | 11% | 34%
tensorflow_managed_spot_training_checkpointing/source_dir0% | 0% | 47% | 37% | 14%
mxnet_managed_spot_training_checkpointing/source_dir0% | 0% | 33% | 30% | 35%
tensorflow_managed_spot_training_checkpointing0% | 0% | 0% | 64% | 35%
tensorflow_2_managed_spot_training_checkpointing0% | 0% | 0% | 57% | 42%
xgboost_script_mode_managed_spot_training_checkpointing0% | 0% | 0% | 76% | 23%
pytorch_managed_spot_training_checkpointing0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _train()
in pytorch_managed_spot_training_checkpointing/source_dir/cifar10.py
63 11 1
def keras_model_fn()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
43 3 4
def train()
in mxnet_managed_spot_training_checkpointing/source_dir/mnist.py
41 8 10
def main()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
37 3 1
def main()
in tensorflow_managed_spot_training_checkpointing/generate_cifar10_tfrecords.py
19 6 1
def _input()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
19 3 4
def convert_to_tfrecord()
in tensorflow_managed_spot_training_checkpointing/generate_cifar10_tfrecords.py
15 3 2
def _dataset_parser()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
15 1 1
def save_model()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
15 1 2
def load_model_from_checkpoints()
in mxnet_managed_spot_training_checkpointing/source_dir/mnist.py
14 4 1
def _load_checkpoint()
in pytorch_managed_spot_training_checkpointing/source_dir/cifar10.py
13 1 3
def _xgb_train()
in xgboost_script_mode_managed_spot_training_checkpointing/abalone.py
13 2 7
def load_model_from_checkpoints()
in tensorflow_managed_spot_training_checkpointing/source_dir/cifar10_keras_main.py
13 4 1
def load_model_from_checkpoints()
in tensorflow_2_managed_spot_training_checkpointing/mnist.py
13 4 1
def parse_args()
in mxnet_managed_spot_training_checkpointing/source_dir/mnist.py
12 1 0
def neo_postprocess()
in mxnet_managed_spot_training_checkpointing/source_dir/mnist.py
11 1 1
def model()
in tensorflow_2_managed_spot_training_checkpointing/mnist.py
11 1 4
def _save_checkpoint()
in pytorch_managed_spot_training_checkpointing/source_dir/cifar10.py
10 1 5
def model_fn()
in pytorch_managed_spot_training_checkpointing/source_dir/cifar10.py
10 3 1
def _parse_args()
in tensorflow_2_managed_spot_training_checkpointing/mnist.py
10 2 0