aws-samples / ml-gameday-tutorial
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 41 units with 528 lines of code in units (64.1% of code).
    • 1 very long units (107 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (176 lines of code)
    • 7 small units (109 lines of code)
    • 28 very small units (136 lines of code)
20% | 0% | 33% | 20% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py20% | 0% | 33% | 20% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Shoot/CNN28% | 0% | 20% | 24% | 26%
Layout/2vs30% | 0% | 82% | 0% | 18%
Layout/random-20% | 0% | 78% | 0% | 21%
Shoot/line0% | 0% | 74% | 0% | 25%
Shoot/random0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in containers/Shoot/CNN/train.py
107 19 4
def transform_fn()
in containers/Shoot/CNN/host.py
43 7 4
def transform_fn()
in containers/Layout/2vs3/host.py
41 15 4
def get_data()
in containers/Shoot/CNN/train.py
34 10 3
def transform_fn()
in containers/Layout/random-2/host.py
32 11 4
def transform_fn()
in containers/Shoot/line/host.py
26 4 4
def model_fn()
in containers/Shoot/CNN/host.py
19 2 1
def create_board()
in containers/Shoot/CNN/train.py
18 4 3
def transform_fn()
in containers/Shoot/random/host.py
18 2 4
def __init__()
in containers/Shoot/CNN/unet.py
16 1 8
def __init__()
in containers/Shoot/CNN/unet.py
14 1 6
def hybrid_forward()
in containers/Shoot/CNN/unet.py
13 1 3
def __init__()
in containers/Shoot/CNN/unet.py
11 2 7
def __init__()
in containers/Shoot/CNN/unet.py
10 3 5
def hybrid_forward()
in containers/Shoot/CNN/train.py
9 1 5
def __init__()
in containers/Shoot/CNN/unet.py
9 2 6
def __init__()
in containers/Shoot/CNN/unet.py
9 3 6
def hybrid_forward()
in containers/Shoot/CNN/unet.py
9 2 3
def __init__()
in containers/Shoot/CNN/cnn.py
9 1 5
def __init__()
in containers/Shoot/CNN/cnn.py
8 3 4