aws-samples / detecting-data-drift-in-nlp-using-amazon-sagemaker-custom-model-monitor
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 10 units with 250 lines of code in units (63.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (84 lines of code)
    • 4 medium size units (118 lines of code)
    • 2 small units (29 lines of code)
    • 3 very small units (19 lines of code)
0% | 33% | 47% | 11% | 7%
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% | 47% | 11% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code0% | 41% | 38% | 14% | 5%
docker0% | 0% | 83% | 0% | 16%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def train()
in code/train_deploy.py
84 15 1
def get_environment()
in docker/evaluation.py
41 2 0
def _get_train_data_loader()
in code/train_deploy.py
29 7 3
def _get_test_data_loader()
in code/train_deploy.py
25 6 2
def input_fn()
in code/train_deploy.py
23 10 2
def test()
in code/train_deploy.py
15 2 3
def predict_fn()
in code/train_deploy.py
14 2 2
def download_embeddings_file()
in docker/evaluation.py
8 1 0
def model_fn()
in code/train_deploy.py
7 2 1
def flat_accuracy()
in code/train_deploy.py
4 1 2