aws-samples / amazon-sagemaker-monai-examples
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 9 units with 185 lines of code in units (78.1% of code).
    • 1 very long units (122 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (31 lines of code)
    • 6 very small units (32 lines of code)
65% | 0% | 0% | 16% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py65% | 0% | 0% | 16% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source65% | 0% | 0% | 16% | 17%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
def train()
in source/monai_skin_cancer.py
122 22 1
def _get_train_data_loader()
in source/monai_skin_cancer.py
16 2 5
def test()
in source/monai_skin_cancer.py
15 2 3
def _get_test_data_loader()
in source/monai_skin_cancer.py
10 1 4
def model_fn()
in source/monai_skin_cancer.py
10 2 1
def __init__()
in source/skin_cancer_dataset.py
4 1 4
def save_model()
in source/monai_skin_cancer.py
4 1 2
def __len__()
in source/skin_cancer_dataset.py
2 1 1
def __getitem__()
in source/skin_cancer_dataset.py
2 1 2