aws-samples / aws-smart-ad-breaks
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 58 units with 1,250 lines of code in units (65.9% of code).
    • 2 very long units (413 lines of code)
    • 4 long units (263 lines of code)
    • 8 medium size units (294 lines of code)
    • 10 small units (138 lines of code)
    • 34 very small units (142 lines of code)
33% | 21% | 23% | 11% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py33% | 21% | 23% | 11% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
video_transcoding_start100% | 0% | 0% | 0% | 0%
vmap_generation/vast_xml45% | 0% | 17% | 11% | 25%
video_transcoding_check0% | 100% | 0% | 0% | 0%
slot_detection0% | 33% | 34% | 19% | 12%
mediatailor0% | 100% | 0% | 0% | 0%
input0% | 100% | 0% | 0% | 0%
vmap_generation0% | 0% | 72% | 23% | 4%
cloudfront0% | 0% | 100% | 0% | 0%
vmap_generation/vmap_xml0% | 0% | 43% | 35% | 21%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in video_transcoding_start/app.py
245 7 2
def toElement()
in vmap_generation/vast_xml/vast.py
168 50 2
def lambda_handler()
in video_transcoding_check/app.py
77 10 2
def lambda_handler()
in slot_detection/app.py
71 9 2
def lambda_handler()
in mediatailor/app.py
63 13 2
def lambda_handler()
in input/app.py
52 1 2
def __write_vmap()
in vmap_generation/app.py
44 5 3
def lambda_handler()
in cloudfront/app.py
41 9 2
def lambda_handler()
in vmap_generation/app.py
40 9 2
def __init__()
in vmap_generation/vast_xml/creative.py
37 13 3
def calculate_scores()
in slot_detection/score.py
37 14 3
def __get_context_metadata()
in slot_detection/score.py
36 12 2
def toElement()
in vmap_generation/vmap_xml/vmap.py
33 8 2
def attachMediaFile()
in vmap_generation/vast_xml/creative.py
26 9 3
def __init__()
in vmap_generation/vast_xml/ad.py
20 2 2
def detect_silences()
in slot_detection/silence.py
20 5 2
def __select_ad()
in vmap_generation/app.py
16 3 1
def __init__()
in vmap_generation/vmap_xml/adbreak.py
16 6 2
def __init__()
in vmap_generation/vast_xml/icon.py
11 3 2
def __init__()
in vmap_generation/vast_xml/companionad.py
11 1 3