aws-samples / sagemaker-101-workshop
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 35 units with 467 lines of code in units (67.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (257 lines of code)
    • 9 small units (131 lines of code)
    • 18 very small units (79 lines of code)
0% | 0% | 55% | 28% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 55% | 28% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
builtin_algorithm_hpo_tabular/util0% | 0% | 89% | 10% | 0%
pytorch_alternatives/custom_pytorch_nlp/util0% | 0% | 37% | 55% | 6%
custom_tensorflow_keras_nlp/util0% | 0% | 51% | 39% | 8%
pytorch_alternatives/custom_pytorch_nlp/src0% | 0% | 29% | 24% | 46%
pytorch_alternatives/migration_challenge_pytorch_image/util0% | 0% | 100% | 0% | 0%
custom_tensorflow_keras_nlp/src0% | 0% | 0% | 52% | 47%
pytorch_alternatives/migration_challenge_pytorch_image/src0% | 0% | 0% | 0% | 100%
migration_challenge_keras_image/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def plot_confusion_matrix()
in builtin_algorithm_hpo_tabular/util/classification_report.py
38 8 7
def get_word_embeddings()
in pytorch_alternatives/custom_pytorch_nlp/util/preprocessing.py
35 7 3
def get_word_embeddings()
in custom_tensorflow_keras_nlp/util/preprocessing.py
35 8 3
def generate_classification_report()
in builtin_algorithm_hpo_tabular/util/classification_report.py
33 4 6
def train()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
32 4 1
def plot_roc_curve()
in builtin_algorithm_hpo_tabular/util/classification_report.py
31 6 4
def upload_in_background()
in pytorch_alternatives/migration_challenge_pytorch_image/util/nb.py
30 4 2
def plot_precision_recall_curve()
in builtin_algorithm_hpo_tabular/util/classification_report.py
23 6 4
def download_dataset()
in pytorch_alternatives/custom_pytorch_nlp/util/preprocessing.py
20 3 0
def tokenize_and_pad_docs()
in pytorch_alternatives/custom_pytorch_nlp/util/preprocessing.py
19 3 3
def plot_text()
in builtin_algorithm_hpo_tabular/util/classification_report.py
14 4 2
def test()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
14 2 3
def tokenize_and_pad_docs()
in custom_tensorflow_keras_nlp/util/preprocessing.py
14 3 3
def wait_for_file_stable()
in pytorch_alternatives/custom_pytorch_nlp/util/preprocessing.py
13 5 3
def wait_for_file_stable()
in custom_tensorflow_keras_nlp/util/preprocessing.py
13 5 3
def parse_args()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
12 2 0
def parse_args()
in custom_tensorflow_keras_nlp/src/main.py
12 2 0
def __init__()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
9 1 4
def forward()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
8 1 2
def save_model()
in pytorch_alternatives/custom_pytorch_nlp/src/main.py
7 1 3