aws-samples / aws-lex-v2-bot-analytics
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 35 units with 713 lines of code in units (24.2% of code).
    • 1 very long units (174 lines of code)
    • 3 long units (208 lines of code)
    • 3 medium size units (98 lines of code)
    • 10 small units (150 lines of code)
    • 18 very small units (83 lines of code)
24% | 29% | 13% | 21% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py34% | 11% | 13% | 23% | 16%
js0% | 72% | 13% | 14% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/lambda_functions/bot_tester84% | 0% | 0% | 9% | 5%
src/lambda_functions/cw_custom_widget_nodejs/widgets0% | 72% | 13% | 14% | 0%
src/lambda_functions/cw_custom_widget_python/widgets0% | 57% | 42% | 0% | 0%
src/lambda_functions/cw_custom_widget_python0% | 0% | 100% | 0% | 0%
src/lambda_functions/banker_bot0% | 0% | 0% | 65% | 34%
src/lambda_functions/cw_custom_widget_python/lib0% | 0% | 0% | 42% | 57%
src/lambda_functions/resource_name_cfn_cr0% | 0% | 0% | 80% | 19%
src/lambda_functions/cw_metric_filter_cr0% | 0% | 0% | 48% | 51%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_bot_conversations()
in src/lambda_functions/bot_tester/bot_conversations.py
174 2 1
function displaySankey()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/conversationPath.js
89 5 2
function displayHeatMap()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/heatmap.js
62 1 4
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 displayHeatmapSessionHourOfDay()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/heatmap.js
28 2 2
def handler()
in src/lambda_functions/bot_tester/lambda_function.py
20 1 2
value: Number()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/heatmap.js
19 1 1
def get_logger()
in src/lambda_functions/cw_custom_widget_python/lib/logger.py
18 4 1
def create_or_update_resource_name()
in src/lambda_functions/resource_name_cfn_cr/lambda_function.py
17 3 2
def create_or_update_metric_filter_dimension()
in src/lambda_functions/cw_metric_filter_cr/lambda_function.py
16 3 2
def close()
in src/lambda_functions/banker_bot/lambda_function.py
14 2 4
def CheckBalance()
in src/lambda_functions/banker_bot/lambda_function.py
12 1 1
def FollowupCheckBalance()
in src/lambda_functions/banker_bot/lambda_function.py
12 1 1
def elicit_intent()
in src/lambda_functions/banker_bot/lambda_function.py
11 3 3
function getTitle()
in src/lambda_functions/cw_custom_widget_nodejs/widgets/conversationPath.js
11 2 1
def get_bot_conversation()
in src/lambda_functions/bot_tester/bot_conversations.py
9 3 2
def get_query_results_as_df()
in src/lambda_functions/cw_custom_widget_python/lib/cw_logs.py
9 1 0
def dispatch()
in src/lambda_functions/banker_bot/lambda_function.py
8 1 1