aws-samples / amazon-sagemaker-script-mode
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 111 units with 1,153 lines of code in units (61.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (176 lines of code)
    • 8 medium size units (284 lines of code)
    • 14 small units (236 lines of code)
    • 86 very small units (457 lines of code)
0% | 15% | 24% | 20% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 15% | 24% | 20% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tf-distribution-options0% | 19% | 26% | 22% | 31%
tf-batch-inference-script0% | 24% | 18% | 27% | 29%
tf-horovod-inference-pipeline0% | 22% | 19% | 28% | 28%
tf-2-data-parallelism0% | 0% | 55% | 0% | 44%
hugging-face-lambda-step0% | 0% | 72% | 0% | 27%
tf-sentiment-script-mode0% | 0% | 42% | 0% | 58%
tf-2-word-embeddings0% | 0% | 0% | 69% | 30%
deploy-pretrained-model0% | 0% | 0% | 0% | 100%
tf-eager-script-mode0% | 0% | 0% | 0% | 100%
tf-2-workflow-smpipelines0% | 0% | 0% | 0% | 100%
tf-2-workflow0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in tf-distribution-options/code/train_hvd.py
61 10 1
def main()
in tf-batch-inference-script/code/train.py
61 9 1
def main()
in tf-horovod-inference-pipeline/train.py
54 9 1
def keras_model_fn()
in tf-horovod-inference-pipeline/train.py
47 5 6
def get_model()
in tf-distribution-options/code/model_def.py
46 5 7
def get_model()
in tf-batch-inference-script/code/model_def.py
46 5 7
def main()
in tf-distribution-options/code/train_ps.py
34 5 1
def train()
in tf-2-data-parallelism/src/train_resnet_sdp_debug.py
33 3 1
def create_lambda_role()
in hugging-face-lambda-step/iam_helper.py
32 2 1
def get_resnet50()
in tf-2-data-parallelism/src/model_def.py
25 3 1
def get_model()
in tf-sentiment-script-mode/sentiment.py
21 1 1
def process_input()
in tf-distribution-options/code/utilities.py
20 3 5
def process_input()
in tf-batch-inference-script/code/utilities.py
20 3 5
def _input()
in tf-horovod-inference-pipeline/train.py
20 3 4
def main()
in tf-distribution-options/generate_cifar10_tfrecords.py
19 6 1
def main()
in tf-batch-inference-script/generate_cifar10_tfrecords.py
19 6 1
def main()
in tf-horovod-inference-pipeline/generate_cifar10_tfrecords.py
19 6 1
def get_model()
in tf-2-word-embeddings/code/model_def.py
18 1 6
def convert_to_tfrecord()
in tf-distribution-options/generate_cifar10_tfrecords.py
15 3 2
def convert_to_tfrecord()
in tf-batch-inference-script/generate_cifar10_tfrecords.py
15 3 2