aws-samples / aws-reinvent21-inf1-workshop
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 13 units with 144 lines of code in units (24.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 9 small units (120 lines of code)
    • 4 very small units (24 lines of code)
0% | 0% | 0% | 83% | 16%
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% | 0% | 83% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
job/bert0% | 0% | 0% | 95% | 4%
job/resnet0% | 0% | 0% | 66% | 33%
job0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
def benchmark()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-gpu.py
16 7 5
def benchmark()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-inf.py
16 6 4
def benchmark()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-gpu.py
15 6 5
def benchmark()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-inf.py
15 6 4
def task()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-gpu.py
13 1 2
def task()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-inf.py
12 1 2
def load_model()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-gpu.py
11 2 2
def extract_values_from_list()
in 2-dl-container/Container-Root/job/report.py
11 1 1
def load_model()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-gpu.py
11 2 2
def task()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-gpu.py
10 1 2
def task()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-inf.py
8 1 2
def load_model()
in 2-dl-container/Container-Root/job/resnet/direct_benchmark-inf.py
3 1 1
def load_model()
in 2-dl-container/Container-Root/job/bert/direct_benchmark-inf.py
3 1 1