aws-samples / amazon-lex-v2-dialogaction
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 14 units with 418 lines of code in units (84.3% of code).
    • 1 very long units (138 lines of code)
    • 1 long units (79 lines of code)
    • 4 medium size units (105 lines of code)
    • 5 small units (80 lines of code)
    • 3 very small units (16 lines of code)
33% | 18% | 25% | 19% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js34% | 19% | 26% | 16% | 3%
ts0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lex-validate-lambda/searchHotel34% | 19% | 26% | 16% | 3%
lib0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
async function validateSearchHotel()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
138 16 4
async function searchHotel()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
79 10 4
module.exports.elicitSlotResponse = function()
in lex-validate-lambda/searchHotel/ResponseHandler.js
27 1 5
module.exports.closeResponse = function()
in lex-validate-lambda/searchHotel/ResponseHandler.js
27 1 4
query ByCustomerName()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
26 1 1
module.exports.confirmIntentResponse = function()
in lex-validate-lambda/searchHotel/ResponseHandler.js
25 1 4
async function handleRequest()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
19 4 1
module.exports.elicitIntentResponse = function()
in lex-validate-lambda/searchHotel/ResponseHandler.js
19 1 2
module.exports.delegateResponse = function()
in lex-validate-lambda/searchHotel/ResponseHandler.js
16 1 3
constructor()
in lib/lex_validate_lambda-stack.ts
15 1 3
async function handleDialogCodeHook()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
11 1 1
function handleFulfillmentCodeHook()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
9 1 1
en: require()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
4 1 1
ko: require()
in lex-validate-lambda/searchHotel/CodeHookHandler.js
3 1 1