awslabs / aws-media-replay-engine
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 420 units with 13,147 lines of code in units (58.0% of code).
    • 12 very long units (4,147 lines of code)
    • 44 long units (3,074 lines of code)
    • 117 medium size units (3,577 lines of code)
    • 97 small units (1,514 lines of code)
    • 150 very small units (835 lines of code)
31% | 23% | 27% | 11% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py31% | 23% | 27% | 11% | 5%
js32% | 15% | 28% | 3% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
controlplaneapi/infrastructure41% | 21% | 16% | 11% | 9%
controlplaneapi/runtime30% | 20% | 39% | 8% | 1%
dataplaneapi/infrastructure69% | 16% | 5% | 8% | <1%
dataplaneapi/runtime9% | 45% | 34% | 6% | 3%
frontend/src32% | 15% | 28% | 3% | 20%
frontend/cdk0% | 100% | 0% | 0% | 0%
lib/MediaReplayEnginePluginHelper0% | 0% | 44% | 44% | 11%
lib/MediaReplayEngineWorkflowHelper0% | 0% | 0% | 54% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in source/controlplaneapi/infrastructure/stacks/chaliceapp.py
2040 9 4
def generate_profile_state_definition()
in source/controlplaneapi/runtime/chalicelib/__init__.py
425 17 8
def __init__()
in source/dataplaneapi/infrastructure/stacks/chaliceapp.py
298 2 4
def add_or_update_medialive_output_group()
in source/controlplaneapi/runtime/app.py
215 22 4
def profile_state_definition_helper()
in source/controlplaneapi/runtime/app.py
200 67 2
def register_plugin()
in source/controlplaneapi/runtime/app.py
186 30 0
def store_plugin_result()
in source/dataplaneapi/runtime/app.py
168 36 0
def GenerateClips()
in source/controlplaneapi/infrastructure/lambda/EventClipGenerator/mre-event-clip-generator.py
146 23 2
def update_event()
in source/controlplaneapi/runtime/app.py
127 30 2
def get_plugin_state_definition_branch_list()
in source/controlplaneapi/runtime/chalicelib/__init__.py
124 10 5
body: getFormValues()
in source/frontend/src/containers/Replay/ReplayCreate.js
113 29 0
def update_profile()
in source/controlplaneapi/runtime/app.py
105 37 1
def create_event()
in source/controlplaneapi/runtime/app.py
100 19 0
def create_optimized_MP4_clips()
in source/controlplaneapi/infrastructure/lambda/EventClipGenerator/mre-event-clip-generator.py
98 27 3
def _create_replay()
in source/controlplaneapi/infrastructure/lambda/Replay/shared/ReplayEngine.py
95 22 1
def create_profile()
in source/controlplaneapi/runtime/app.py
92 25 0
def register_model()
in source/controlplaneapi/runtime/app.py
90 7 0
def generate_master_playlist()
in source/controlplaneapi/infrastructure/lambda/Replay/replay_lambda.py
90 14 2
def build_input_settings()
in source/controlplaneapi/infrastructure/lambda/EventClipGenerator/mre-event-clip-generator.py
89 14 3
def lambda_handler()
in source/controlplaneapi/infrastructure/lambda/ProbeVideo/lambda_function.py
85 8 2