aws-samples / aws-smart-ad-breaks
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 58 units with 1,250 lines of code in units (65.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (168 lines of code)
    • 4 medium complex units (173 lines of code)
    • 11 simple units (582 lines of code)
    • 42 very simple units (327 lines of code)
0% | 13% | 13% | 46% | 26%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 13% | 13% | 46% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
vmap_generation/vast_xml0% | 45% | 10% | 7% | 37%
slot_detection0% | 0% | 34% | 43% | 22%
mediatailor0% | 0% | 100% | 0% | 0%
video_transcoding_start0% | 0% | 0% | 100% | 0%
video_transcoding_check0% | 0% | 0% | 100% | 0%
vmap_generation0% | 0% | 0% | 43% | 56%
vmap_generation/vmap_xml0% | 0% | 0% | 64% | 35%
cloudfront0% | 0% | 0% | 100% | 0%
input0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def toElement()
in vmap_generation/vast_xml/vast.py
168 50 2
def calculate_scores()
in slot_detection/score.py
37 14 3
def __init__()
in vmap_generation/vast_xml/creative.py
37 13 3
def lambda_handler()
in mediatailor/app.py
63 13 2
def __get_context_metadata()
in slot_detection/score.py
36 12 2
def lambda_handler()
in video_transcoding_check/app.py
77 10 2
def attachMediaFile()
in vmap_generation/vast_xml/creative.py
26 9 3
def lambda_handler()
in vmap_generation/app.py
40 9 2
def lambda_handler()
in slot_detection/app.py
71 9 2
def lambda_handler()
in cloudfront/app.py
41 9 2
def toElement()
in vmap_generation/vmap_xml/vmap.py
33 8 2
def lambda_handler()
in video_transcoding_start/app.py
245 7 2
def __update_and_merge_lists()
in vmap_generation/app.py
11 7 2
def __update_and_merge_lists()
in slot_detection/app.py
11 7 2
def __init__()
in vmap_generation/vmap_xml/adbreak.py
16 6 2
def __get_asset_metadata()
in slot_detection/app.py
11 6 1
def __write_vmap()
in vmap_generation/app.py
44 5 3
def detect_silences()
in slot_detection/silence.py
20 5 2
def __labels_from_result()
in slot_detection/score.py
10 5 2
def setResource()
in vmap_generation/vast_xml/icon.py
9 4 4