awslabs / aws-media-replay-engine
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 420 units with 13,147 lines of code in units (58.0% of code).
    • 1 very complex units (200 lines of code)
    • 6 complex units (797 lines of code)
    • 33 medium complex units (2,494 lines of code)
    • 67 simple units (4,156 lines of code)
    • 313 very simple units (5,500 lines of code)
1% | 6% | 18% | 31% | 41%
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
py1% | 5% | 19% | 32% | 41%
js0% | 32% | 0% | 0% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
controlplaneapi/runtime4% | 9% | 23% | 16% | 45%
dataplaneapi/runtime0% | 9% | 35% | 30% | 24%
frontend/src0% | 32% | 0% | 0% | 67%
controlplaneapi/infrastructure0% | 1% | 12% | 53% | 31%
lib/MediaReplayEnginePluginHelper0% | 0% | 18% | 9% | 72%
dataplaneapi/infrastructure0% | 0% | 16% | 4% | 79%
lib/MediaReplayEngineWorkflowHelper0% | 0% | 0% | 0% | 100%
frontend/cdk0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def profile_state_definition_helper()
in source/controlplaneapi/runtime/app.py
200 67 2
def update_profile()
in source/controlplaneapi/runtime/app.py
105 37 1
def store_plugin_result()
in source/dataplaneapi/runtime/app.py
168 36 0
def register_plugin()
in source/controlplaneapi/runtime/app.py
186 30 0
def update_event()
in source/controlplaneapi/runtime/app.py
127 30 2
body: getFormValues()
in source/frontend/src/containers/Replay/ReplayCreate.js
113 29 0
def create_optimized_MP4_clips()
in source/controlplaneapi/infrastructure/lambda/EventClipGenerator/mre-event-clip-generator.py
98 27 3
def create_profile()
in source/controlplaneapi/runtime/app.py
92 25 0
def GenerateClips()
in source/controlplaneapi/infrastructure/lambda/EventClipGenerator/mre-event-clip-generator.py
146 23 2
def add_or_update_medialive_output_group()
in source/controlplaneapi/runtime/app.py
215 22 4
def _create_replay()
in source/controlplaneapi/infrastructure/lambda/Replay/shared/ReplayEngine.py
95 22 1
def get_all_event_segments()
in source/dataplaneapi/runtime/app.py
75 21 0
def getfeatures_by_program_event()
in source/controlplaneapi/runtime/app.py
73 20 2
def get_clip_metadata()
in source/dataplaneapi/runtime/app.py
67 20 7
def get_dependent_plugins_configuration()
in source/lib/MediaReplayEnginePluginHelper/MediaReplayEnginePluginHelper/__init__.py
20 19 1
def create_event()
in source/controlplaneapi/runtime/app.py
100 19 0
def generate_profile_state_definition()
in source/controlplaneapi/runtime/chalicelib/__init__.py
425 17 8
def __process_future_events()
in source/controlplaneapi/infrastructure/lambda/EventScheduler/mre_event_scheduler.py
15 17 2
def get_segment_state_for_optimization()
in source/dataplaneapi/runtime/app.py
73 17 0
def delete_event()
in source/controlplaneapi/runtime/app.py
78 16 2