aws-samples / amazon-sagemaker-protein-classification
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 14 units with 200 lines of code in units (70.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (71 lines of code)
    • 0 medium size units (0 lines of code)
    • 6 small units (93 lines of code)
    • 7 very small units (36 lines of code)
0% | 35% | 0% | 46% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 35% | 0% | 46% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code0% | 35% | 0% | 46% | 18%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
def train()
in code/train.py
71 13 1
def test()
in code/train.py
19 2 3
def __getitem__()
in code/data_prep.py
19 1 2
def input_fn()
in code/inference.py
17 2 2
15 1 2
def predict_fn()
in code/inference.py
12 2 2
11 1 2
def model_fn()
in code/inference.py
8 2 1
def __init__()
in code/model_def.py
6 1 2
def forward()
in code/model_def.py
6 1 3
def freeze()
in code/train.py
5 3 2
def __init__()
in code/data_prep.py
5 1 5
def save_model()
in code/train.py
4 1 2
def __len__()
in code/data_prep.py
2 1 1