aws-samples / amazon-mlops-example-tensorflow
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 22 units with 161 lines of code in units (24.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 5 small units (74 lines of code)
    • 17 very small units (87 lines of code)
0% | 0% | 0% | 45% | 54%
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% | 0% | 45% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
train0% | 0% | 0% | 39% | 60%
inference0% | 0% | 0% | 51% | 48%
preprocess0% | 0% | 0% | 57% | 42%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train_model()
in train/train.py
19 4 2
def define_network()
in train/CustomModel.py
16 2 1
def cleanup()
in inference/etl.py
15 3 2
def input_handler()
in inference/inference.py
13 6 2
def read_data()
in preprocess/input_data_etl.py
11 1 1
def save_tokenizer()
in train/train.py
8 1 1
def npy_to_s3()
in preprocess/input_data_etl.py
8 1 4
def call()
in train/CustomModel.py
7 2 2
def update_state()
in train/CustomModel.py
7 2 4
def build()
in train/CustomModel.py
6 1 2
def output_handler()
in inference/inference.py
6 2 2
def fitandtokenize()
in inference/etl.py
6 1 1
def parse_args()
in train/train.py
5 2 0
def get_tokenizer()
in inference/etl.py
5 1 1
def get_word_index()
in inference/etl.py
5 1 1
def load_training_data()
in train/train.py
4 1 1
def __init__()
in train/CustomModel.py
4 1 3
def __init__()
in train/CustomModel.py
4 1 3
def tokenize()
in inference/etl.py
4 1 2
def save_model()
in train/train.py
3 1 2