awslabs / amazon-pinpoint-preference-center
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 65 units with 894 lines of code in units (43.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (126 lines of code)
    • 13 medium size units (382 lines of code)
    • 13 small units (199 lines of code)
    • 37 very small units (187 lines of code)
0% | 14% | 42% | 22% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 14% | 42% | 22% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
solution-helper0% | 32% | 40% | 18% | 8%
rest-api-handler0% | 23% | 46% | 25% | 4%
static-assets/js0% | 0% | 37% | 18% | 44%
stream-processor0% | 0% | 62% | 37% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function buildEdgeFunction()
in source/solution-helper/index.js
66 3 3
function upsertEndpoint()
in source/rest-api-handler/index.js
60 9 4
function createSegment()
in source/stream-processor/index.js
48 2 3
function fileSubstitutions()
in source/solution-helper/index.js
42 3 2
let sendResponse = function()
in source/solution-helper/index.js
42 2 4
function registerHelpers()
in source/static-assets/js/main.js
38 8 0
TimeStamp: moment()
in source/rest-api-handler/index.js
28 10 0
function upsertUser()
in source/static-assets/js/main.js
25 2 0
function getMetadata()
in source/static-assets/js/main.js
24 3 0
function getEndpoints()
in source/static-assets/js/main.js
24 3 0
function getMetadata()
in source/rest-api-handler/index.js
23 2 2
function sendAnonymousMetric()
in source/rest-api-handler/index.js
23 1 1
function upsertEndpoints()
in source/rest-api-handler/index.js
22 3 3
getMetadata()
in source/static-assets/js/main.js
22 1 0
function getUserEndpoints()
in source/rest-api-handler/index.js
21 2 2
function getAPIKey()
in source/solution-helper/index.js
20 2 1
function processEvents()
in source/rest-api-handler/index.js
19 2 2
function putMetadata()
in source/solution-helper/index.js
18 2 3
function validateHash()
in source/rest-api-handler/index.js
18 5 3
function readFormData()
in source/static-assets/js/main.js
18 1 0