aws-samples / incremental-training-mlops
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 43 units with 627 lines of code in units (80.0% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (209 lines of code)
    • 6 medium size units (199 lines of code)
    • 8 small units (114 lines of code)
    • 26 very small units (105 lines of code)
0% | 33% | 31% | 18% | 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% | 33% | 31% | 18% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
01-byoc/code0% | 29% | 34% | 23% | 12%
03-lambda-api/process_a2i_results0% | 81% | 0% | 0% | 18%
02-increment-train/invoke_endpoint_a2i0% | 0% | 88% | 0% | 11%
02-increment-train0% | 0% | 0% | 0% | 100%
01-byoc/invoke_endpoint0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train_model()
in 01-byoc/code/workflow.py
87 17 4
def lambda_handler()
in 03-lambda-api/process_a2i_results/lambda_function.py
63 7 2
def main()
in 01-byoc/code/test.py
59 7 0
def main()
in 01-byoc/code/train.py
50 5 0
def plot_confusion_matrix()
in 01-byoc/code/utils.py
32 9 6
def lambda_handler()
in 02-increment-train/invoke_endpoint_a2i/lambda_function.py
32 2 2
def __init__()
in 01-byoc/code/config.py
30 1 25
def __init__()
in 01-byoc/code/models.py
29 1 2
def read_data()
in 01-byoc/code/dataset.py
26 8 2
def preprocessing()
in 01-byoc/code/dataset.py
20 6 3
def _split_sampler()
in 01-byoc/code/dataloader.py
19 3 2
def __init__()
in 01-byoc/code/dataloader.py
15 1 8
def read_data()
in 01-byoc/code/dataset.py
13 2 2
def __init__()
in 01-byoc/code/dataset.py
12 2 2
def spec_to_image()
in 01-byoc/code/dataset.py
12 2 3
def __init__()
in 01-byoc/code/dataset.py
12 2 2
def prepare_model()
in 01-byoc/code/workflow.py
11 4 1
def lambda_handler()
in 01-byoc/invoke_endpoint/lambda_function.py
9 1 2
def create_endpoint_config()
in 02-increment-train/deploy_model.py
9 1 2
def get_folder_name()
in 01-byoc/code/workflow.py
8 2 1