aws-samples / sagemaker-distributed-training-digital-pathology-images
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 30 units with 393 lines of code in units (73.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (85 lines of code)
    • 4 medium size units (95 lines of code)
    • 9 small units (124 lines of code)
    • 16 very small units (89 lines of code)
0% | 21% | 24% | 31% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 21% | 24% | 31% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 29% | 32% | 29% | 9%
ROOT0% | 0% | 0% | 39% | 61%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in src/train.py
85 17 1
def _input()
in src/train.py
26 8 5
def model_def()
in src/train.py
24 5 3
24 6 5
def sort_jpegs()
in src/script.py
21 6 4
def main()
in src/script.py
20 2 1
14 1 1
14 4 5
def push()
in docker_utils.py
14 4 3
def _check_output()
in docker_utils.py
14 4 3
def image_example()
in src/script.py
13 2 3
def _dataset_parser()
in src/train.py
12 1 1
12 4 2
def _execute()
in docker_utils.py
11 4 2
def _ecr_login()
in docker_utils.py
9 1 2
def create_tiles()
in src/script.py
8 3 1
def _push()
in docker_utils.py
8 1 3
def _ecr_login_if_needed()
in docker_utils.py
8 4 1
def _stream_output()
in docker_utils.py
8 3 1
7 2 3