aws-samples / aws-serverless-feedback-app
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 13 units with 267 lines of code in units (22.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (65 lines of code)
    • 4 medium size units (117 lines of code)
    • 4 small units (61 lines of code)
    • 4 very small units (24 lines of code)
0% | 24% | 43% | 22% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 63% | 36% | 0% | 0%
js0% | 0% | 48% | 36% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
feedback-app-backend/cicd-pipeline0% | 100% | 0% | 0% | 0%
feedback-app-frontend/src0% | 0% | 70% | 26% | 2%
feedback-app-frontend/amplify-infra-code0% | 0% | 100% | 0% | 0%
feedback-app-backend/webhooknotification-service0% | 0% | 0% | 59% | 40%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
constructor()
in feedback-app-backend/cicd-pipeline/lib/cicd-pipeline-stack.ts
65 1 3
constructor()
in feedback-app-frontend/amplify-infra-code/lib/amplify-infra-code-stack.ts
37 1 3
function registerValidSW()
in feedback-app-frontend/src/serviceWorker.js
33 8 2
function checkValidServiceWorker()
in feedback-app-frontend/src/serviceWorker.js
25 4 2
export function register()
in feedback-app-frontend/src/serviceWorker.js
22 5 1
constructor()
in feedback-app-frontend/src/components/PublicFeedback.js
19 1 1
async function makeHttpCall()
in feedback-app-backend/webhooknotification-service/app.js
17 2 2
function formatMessage()
in feedback-app-backend/webhooknotification-service/app.js
14 1 1
export function unregister()
in feedback-app-frontend/src/serviceWorker.js
11 2 0
fd_date: dateFormat()
in feedback-app-backend/webhooknotification-service/app.js
10 2 2
await makeHttpCall()
in feedback-app-backend/webhooknotification-service/app.js
8 1 2
render()
in feedback-app-frontend/src/components/PublicFeedback.js
3 1 0
function()
in feedback-app-backend/webhooknotification-service/app.js
3 1 1