aws-samples / aws-sagemaker-pytorch-shop-by-style
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 42 units with 426 lines of code in units (19.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (104 lines of code)
    • 4 medium size units (101 lines of code)
    • 7 small units (106 lines of code)
    • 29 very small units (115 lines of code)
0% | 24% | 23% | 24% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 19% | 26% | 28%
js0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
similarity0% | 27% | 13% | 28% | 30%
lambda0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train_sim_model()
in src/similarity/siamese.py
52 7 5
def train_sim_model()
in src/similarity/siamese2.py
52 7 4
def get_training_tuple_tensors()
in src/similarity/index.py
28 6 2
def lambda_handler()
in src/lambda/loader.py
27 1 2
23 2 1
def __init__()
in src/similarity/index.py
23 6 2
def build_model()
in src/similarity/cnn.py
20 8 3
def test_model()
in src/similarity/siamese.py
17 2 2
def predict_fn()
in src/similarity/batch.py
15 2 2
def predict_fn()
in src/similarity/inference.py
15 2 2
def input_fn()
in src/similarity/batch.py
14 2 2
def model_fn()
in src/similarity/batch.py
13 2 1
def model_fn()
in src/similarity/inference.py
12 2 1
def __getitem__()
in src/similarity/siamese.py
9 1 2
def list_files()
in src/similarity/siamese.py
8 3 1
def list_files()
in src/similarity/siamese2.py
8 3 1
def output_fn()
in src/similarity/batch.py
8 3 2
def save()
in src/similarity/index.py
6 1 2
def load()
in src/similarity/index.py
6 1 2
def contrastive_loss()
in src/similarity/siamese.py
5 1 2