aws-solutions / aws-qnabot
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 461 units with 8,650 lines of code in units (35.2% of code).
    • 7 very long units (1,122 lines of code)
    • 21 long units (1,410 lines of code)
    • 101 medium size units (3,031 lines of code)
    • 131 small units (1,986 lines of code)
    • 201 very small units (1,101 lines of code)
12% | 16% | 35% | 22% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js14% | 17% | 32% | 22% | 11%
py0% | 8% | 50% | 23% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/es-proxy-layer21% | 23% | 29% | 18% | 6%
templates42% | 19% | 29% | 8% | 1%
lambda/cfn20% | 0% | 30% | 24% | 25%
lambda/import100% | 0% | 0% | 0% | 0%
lambda/export24% | 0% | 36% | 36% | 2%
lambda/fulfillment0% | 24% | 31% | 32% | 11%
templates/master0% | 38% | 39% | 11% | 10%
utility_scripts0% | 42% | 49% | 7% | 0%
utility_scripts/csv2json_converter0% | 32% | 38% | 12% | 16%
lambda/lex-build0% | 20% | 18% | 44% | 16%
lambda/lexv2-build0% | 0% | 48% | 30% | 21%
lambda/testall0% | 0% | 76% | 23% | 0%
lambda/qnabot-common-layer0% | 0% | 46% | 34% | 18%
lambda/kendra-webcrawler0% | 0% | 58% | 23% | 17%
lambda/kendra-webcrawler-schedule-updater0% | 0% | 52% | 28% | 19%
lambda/connect0% | 0% | 100% | 0% | 0%
templates/lib0% | 0% | 100% | 0% | 0%
templates/dev0% | 0% | 60% | 28% | 11%
lambda/kendra-webcrawler-status0% | 0% | 48% | 0% | 51%
lambda/genesys0% | 0% | 100% | 0% | 0%
lambda/js_lambda_hook_sdk0% | 0% | 0% | 33% | 66%
website/js0% | 0% | 0% | 73% | 26%
lambda/proxy-es0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
282 1 0
async function routeKendraRequest()
in lambda/es-proxy-layer/lib/kendra.js
250 56 2
exports.step=function()
in lambda/import/index.js
134 15 3
Update()
in lambda/cfn/lib/lex.js
133 17 4
async function createFAQ()
in lambda/export/createFAQ.js
113 18 1
Create()
in lambda/cfn/lib/lex.js
109 11 2
async function get_hit()
in lambda/es-proxy-layer/lib/query.js
101 18 2
function update_res_with_hit()
in lambda/es-proxy-layer/lib/query.js
90 22 3
function build_query()
in lambda/es-proxy-layer/lib/esbodybuilder.js
89 5 1
def process_stacks()
in utility_scripts/configureCMK.py
88 16 1
async function processResponse()
in lambda/fulfillment/lib/middleware/lexRouter.js
86 18 4
module.exports=function()
in templates/master/routes/util/lambda.js
84 6 1
exports.cfnNag = function()
in templates/util.js
77 1 1
async function routeKendraRequest()
in lambda/es-proxy-layer/lib/kendraQuery.js
76 9 1
module.exports=function()
in templates/master/dashboard/elasticsearch.js
75 1 1
async function processResponse()
in lambda/fulfillment/lib/middleware/specialtyBotRouter.js
69 21 4
async function evaluateConditionalChaining()
in lambda/es-proxy-layer/lib/query.js
67 8 4
String.prototype.csvToArray = function()
in utility_scripts/csv2json_converter/js/csvToArray.v2.1.js
64 20 1
async function handleRequest()
in lambda/fulfillment/lib/middleware/lexRouter.js
58 28 4
async function handleRequest()
in lambda/fulfillment/lib/middleware/specialtyBotRouter.js
58 8 4