awslabs / spot-tagging-bot-for-digital-assets
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 63 units with 1,034 lines of code in units (30.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (43 lines of code)
    • 4 simple units (157 lines of code)
    • 58 very simple units (834 lines of code)
0% | 0% | 4% | 15% | 80%
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% | 4% | 15% | 80%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/sam_spot_bot_create_job0% | 0% | 4% | 16% | 78%
source/sam_spot_bot_api_receiver0% | 0% | 0% | 0% | 100%
source/sam_spot_bot_function0% | 0% | 0% | 0% | 100%
source/sam_spot_bot_get_job_status0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def bot_cleanup()
in source/sam_spot_bot_create_job/sagemaker_controller.py
43 13 1
def create_compute_environment()
in source/sam_spot_bot_create_job/batch_controller.py
47 8 1
def deploy_sync()
in source/sam_spot_bot_create_job/sagemaker_controller.py
39 6 5
def create_job_queue()
in source/sam_spot_bot_create_job/batch_controller.py
31 6 1
def __init__()
in source/sam_spot_bot_create_job/config.py
40 6 1
def lambda_handler()
in source/sam_spot_bot_function/app.py
34 5 2
def get_file_list()
in source/sam_spot_bot_create_job/s_three_dao.py
15 5 1
def multi_endpoint_deploy_sync()
in source/sam_spot_bot_create_job/sagemaker_controller.py
14 4 1
def delete_endpoint()
in source/sam_spot_bot_create_job/sagemaker_controller.py
21 4 2
def is_endpoint_running()
in source/sam_spot_bot_create_job/sagemaker_controller.py
8 4 2
def periodically_check()
in source/sam_spot_bot_create_job/sagemaker_controller.py
12 4 2
def create_or_get_ecs_role()
in source/sam_spot_bot_create_job/iam_helper.py
13 4 1
def lambda_handler()
in source/sam_spot_bot_create_job/app.py
21 4 2
def processing()
in source/sam_spot_bot_create_job/app.py
31 4 7
def connect_es()
in source/sam_spot_bot_create_job/elasticsearch_helper.py
17 3 1
def create_default_bots()
in source/sam_spot_bot_create_job/bot_dao.py
55 3 1
def __init__()
in source/sam_spot_bot_create_job/stepfunction_controller.py
85 3 1
def respond()
in source/sam_spot_bot_create_job/app.py
8 3 2
def search_file_list_for_bot()
in source/sam_spot_bot_create_job/job_dao.py
35 3 4
def respond()
in source/sam_spot_bot_api_receiver/app.py
8 3 2