aws-samples / amazon-ivs-moderation-with-record-to-s3-web-demo
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 48 units with 800 lines of code in units (24.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (269 lines of code)
    • 1 simple units (64 lines of code)
    • 44 very simple units (467 lines of code)
0% | 0% | 33% | 8% | 58%
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% | 0% | 31% | 11% | 56%
js0% | 0% | 37% | 0% | 62%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
serverless/ivs_moderation0% | 0% | 58% | 0% | 41%
web-ui/src/components0% | 0% | 75% | 0% | 24%
serverless/ivs_moderation/lambdas0% | 0% | 17% | 20% | 61%
web-ui/src/graphql0% | 0% | 0% | 0% | 100%
serverless0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def check_moderate_policies()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
54 24 2
export default function SettingsModal()
in web-ui/src/components/SettingsModal/index.js
97 12 3
def __init__()
in serverless/ivs_moderation/ivs_moderation_stack.py
118 11 4
def stream_moderation_service()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/app.py
64 10 3
def deploy_db_defaults()
in serverless/post_installation_script.py
13 3 2
def suspend_channel()
in serverless/ivs_moderation/lambdas/lambda_api/lib/api_handler.py
12 3 2
def updatedb()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/app.py
7 3 4
def read_file()
in serverless/post_installation_script.py
10 2 1
def main()
in serverless/post_installation_script.py
7 2 0
def create_s3_bucket()
in serverless/ivs_moderation/ivs_moderation_stack.py
3 2 2
def create_api_gw()
in serverless/ivs_moderation/ivs_moderation_stack.py
15 2 3
def get_data_from_db()
in serverless/ivs_moderation/lambdas/lambda_api/lib/api_handler.py
7 2 3
def delete_item_from_db()
in serverless/ivs_moderation/lambdas/lambda_api/lib/api_handler.py
12 2 4
def suspend_channel()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
15 2 2
def get_item_from_db_table()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
7 2 3
def get_playback_url()
in serverless/ivs_moderation/lambdas/lfuncprocessimage/lib/rekognition_service.py
8 2 2
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
async function fetchThresholds()
in web-ui/src/components/SettingsModal/index.js
15 2 0
def create_lambda_function()
in serverless/ivs_moderation/ivs_moderation_stack.py
5 1 4