aws-samples / amazon-ivs-moderation-with-record-to-s3-web-demo
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 48 units with 800 lines of code in units (24.2% of code).
    • 1 very long units (118 lines of code)
    • 3 long units (215 lines of code)
    • 3 medium size units (143 lines of code)
    • 11 small units (155 lines of code)
    • 30 very small units (169 lines of code)
14% | 26% | 17% | 19% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py21% | 21% | 8% | 19% | 28%
js0% | 37% | 37% | 18% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
serverless/ivs_moderation58% | 0% | 0% | 13% | 28%
serverless/ivs_moderation/lambdas0% | 38% | 14% | 21% | 25%
web-ui/src/components0% | 75% | 0% | 24% | 0%
web-ui/src/graphql0% | 0% | 74% | 12% | 12%
serverless0% | 0% | 0% | 43% | 56%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in serverless/ivs_moderation/ivs_moderation_stack.py
118 11 4
export default function SettingsModal()
in web-ui/src/components/SettingsModal/index.js
97 12 3
def stream_moderation_service()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/app.py
64 10 3
def check_moderate_policies()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
54 24 2
listSettingss()
in web-ui/src/graphql/queries.js
50 1 3
updateSettings()
in web-ui/src/graphql/mutations.js
47 1 2
def manage_channel()
in serverless/ivs_moderation/lambdas/lambda_api/app.py
46 1 0
listChannelss()
in web-ui/src/graphql/queries.js
17 1 3
def grab_settings()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
16 2 2
async function handleSave()
in web-ui/src/components/ModerationForm/index.js
16 2 1
def create_api_gw()
in serverless/ivs_moderation/ivs_moderation_stack.py
15 2 3
def suspend_channel()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
15 2 2
async function fetchThresholds()
in web-ui/src/components/SettingsModal/index.js
15 2 0
def deploy_db_defaults()
in serverless/post_installation_script.py
13 3 2
def create_user_pool()
in serverless/ivs_moderation/ivs_moderation_stack.py
12 1 2
def suspend_channel()
in serverless/ivs_moderation/lambdas/lambda_api/lib/api_handler.py
12 3 2
def delete_item_from_db()
in serverless/ivs_moderation/lambdas/lambda_api/lib/api_handler.py
12 2 4
def create_moderation_job()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
12 1 3
def read_file()
in serverless/post_installation_script.py
10 2 1
def create_dynamo_db_table()
in serverless/ivs_moderation/ivs_moderation_stack.py
8 1 2