aws-samples / aws-lex-v2-bot-analytics
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 35 units with 713 lines of code in units (24.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (57 lines of code)
    • 2 simple units (70 lines of code)
    • 32 very simple units (586 lines of code)
0% | 0% | 7% | 9% | 82%
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% | 11% | 13% | 74%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/lambda_functions/cw_custom_widget_python/widgets0% | 0% | 57% | 42% | 0%
src/lambda_functions/cw_custom_widget_python0% | 0% | 0% | 100% | 0%
src/lambda_functions/cw_custom_widget_nodejs/widgets0% | 0% | 0% | 0% | 100%
src/lambda_functions/bot_tester0% | 0% | 0% | 0% | 100%
src/lambda_functions/banker_bot0% | 0% | 0% | 0% | 100%
src/lambda_functions/cw_custom_widget_python/lib0% | 0% | 0% | 0% | 100%
src/lambda_functions/cw_metric_filter_cr0% | 0% | 0% | 0% | 100%
src/lambda_functions/resource_name_cfn_cr0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def render_slots_top_n_widget()
in src/lambda_functions/cw_custom_widget_python/widgets/slots.py
57 18 2
def render_session_attributes_top_n_widget()
in src/lambda_functions/cw_custom_widget_python/widgets/session_attributes.py
42 7 2
def handler()
in src/lambda_functions/cw_custom_widget_python/lambda_function.py
28 6 2
function displaySankey()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/conversationPath.js
89 5 2
def get_logger()
in src/lambda_functions/cw_custom_widget_python/lib/logger.py
18 4 1
def get_slot()
in src/lambda_functions/banker_bot/lambda_function.py
6 4 2
def get_bot_conversation()
in src/lambda_functions/bot_tester/bot_conversations.py
9 3 2
def get_log_level()
in src/lambda_functions/cw_custom_widget_python/lib/logger.py
6 3 0
def elicit_intent()
in src/lambda_functions/banker_bot/lambda_function.py
11 3 3
def create_or_update_metric_filter_dimension()
in src/lambda_functions/cw_metric_filter_cr/lambda_function.py
16 3 2
def delete_metric_filter_dimension()
in src/lambda_functions/cw_metric_filter_cr/lambda_function.py
5 3 2
def create_or_update_resource_name()
in src/lambda_functions/resource_name_cfn_cr/lambda_function.py
17 3 2
def get_bot_conversations()
in src/lambda_functions/bot_tester/bot_conversations.py
174 2 1
def get_client()
in src/lambda_functions/cw_custom_widget_python/lib/client.py
6 2 2
def get_session_attributes()
in src/lambda_functions/banker_bot/lambda_function.py
5 2 1
def close()
in src/lambda_functions/banker_bot/lambda_function.py
14 2 4
function getTitle()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/conversationPath.js
11 2 1
function displayHeatmapSessionHourOfDay()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/heatmap.js
28 2 2
def __init__()
in src/lambda_functions/bot_tester/bot_conversations.py
3 1 2
def handler()
in src/lambda_functions/bot_tester/lambda_function.py
20 1 2