amazon-connect / advanced-usage-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 34 units with 302 lines of code in units (12.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (121 lines of code)
    • 5 small units (67 lines of code)
    • 26 very small units (114 lines of code)
0% | 0% | 40% | 22% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 40% | 22% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Frontend0% | 0% | 42% | 18% | 38%
cloudformation/FrontendStackCustomResources0% | 0% | 0% | 81% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
46 13 3
function init()
in Frontend/main.js
45 2 0
30 12 3
var submitLogs = function()
in Frontend/connect-ccp-metric-worker.js
17 6 0
13 7 3
function checkPreconditions()
in cloudformation/FrontendStackCustomResources/frontendgenerator.js
13 5 1
function storeContactTraceStream()
in Frontend/connect-ccp-metric-worker.js
12 5 2
xhr.onreadystatechange = function()
in Frontend/connect-ccp-metric-worker.js
12 2 0
req.onsuccess = function()
in Frontend/connect-ccp-metric-worker.js
10 1 1
currentContactsPendingRequest.onsuccess = function()
in Frontend/connect-ccp-metric-worker.js
10 2 0
xhr.onreadystatechange = function()
in Frontend/connect-ccp-metric-worker.js
10 2 0
req.onupgradeneeded = function()
in Frontend/connect-ccp-metric-worker.js
9 2 1
self.onmessage = function()
in Frontend/connect-ccp-metric-worker.js
9 5 1
completeCountRequest.onsuccess = function()
in Frontend/connect-ccp-metric-worker.js
4 1 0
currentContactsCompleteRequest.onsuccess = function()
in Frontend/connect-ccp-metric-worker.js
4 1 0
completeCountRequest.onerror = function()
in Frontend/connect-ccp-metric-worker.js
4 1 0
currentContactsCompleteRequest.onerror = function()
in Frontend/connect-ccp-metric-worker.js
4 1 0
currentContactsPendingRequest.onerror = function()
in Frontend/connect-ccp-metric-worker.js
4 1 0
transaction.oncomplete = function()
in Frontend/connect-ccp-metric-worker.js
4 1 1
transaction.onerror = function()
in Frontend/connect-ccp-metric-worker.js
4 1 1