aws-samples / amazon-sagemaker-analyze-model-predictions
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 221 lines of code in units (47.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (139 lines of code)
    • 4 small units (49 lines of code)
    • 5 very small units (33 lines of code)
0% | 0% | 62% | 22% | 14%
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% | 62% | 22% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 56% | 35% | 9%
code0% | 0% | 56% | 16% | 27%
docker0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
def get_environment()
in docker/evaluation.py
34 2 0
32 11 5
def model_fn()
in code/pretrained_model_with_debugger_hook.py
27 2 1
24 11 2
def transform_fn()
in code/pretrained_model_with_debugger_hook.py
22 2 4
def transform_fn()
in code/pretrained_model.py
14 1 4
13 6 4
def load_model()
in utils.py
11 5 0
11 1 9
def forward_hook()
in code/custom_hook.py
9 3 4
def model_fn()
in code/pretrained_model.py
9 1 1
9 1 0
def __init__()
in code/pretrained_model_with_debugger_hook.py
4 1 4
def image_gradients()
in code/custom_hook.py
2 1 2