aws-samples / talk-dev-to-me-twitch
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 44 units with 732 lines of code in units (27.9% of code).
    • 1 very long units (153 lines of code)
    • 2 long units (111 lines of code)
    • 6 medium size units (181 lines of code)
    • 15 small units (204 lines of code)
    • 20 very small units (83 lines of code)
20% | 15% | 24% | 27% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js23% | 9% | 28% | 29% | 9%
ts0% | 88% | 0% | 0% | 11%
py0% | 0% | 0% | 39% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
event-driven-developers-tale/infrastructure100% | 0% | 0% | 0% | 0%
event-driven-developers-tale/functions0% | 43% | 23% | 33% | 0%
lambda-powertools-feature-flags/app-config-store0% | 100% | 0% | 0% | 0%
event-driven-developers-tale/src0% | 0% | 41% | 41% | 16%
lambda-powertools-feature-flags/app0% | 0% | 0% | 39% | 60%
hexagonal-architectures/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in event-driven-developers-tale/infrastructure/lib/infrastructure-stack.js
153 1 3
updateVacationRequest: async()
in event-driven-developers-tale/functions/updateVacationRequest/app.js
59 6 1
constructor()
in lambda-powertools-feature-flags/app-config-store/cdk/lib/cdk-stack.ts
52 1 3
function NavBar()
in event-driven-developers-tale/src/components/NavBar.js
39 2 1
function Vacations()
in event-driven-developers-tale/src/pages/Vacations.js
36 5 2
submitVacationRequest: async()
in event-driven-developers-tale/functions/createVacationRequest/app.js
32 3 1
query ListVacationRequests()
in event-driven-developers-tale/src/graphql/queries.js
26 1 1
function subscribeNotifications()
in event-driven-developers-tale/src/components/ProfileLink.js
25 2 0
function AddVacation()
in event-driven-developers-tale/src/components/AddVacation.js
23 1 1
async function addVacation()
in event-driven-developers-tale/src/components/AddVacation.js
17 1 0
function initializeClient()
in event-driven-developers-tale/functions/vacationRequestValidation/app.js
16 1 0
async function executeMutation()
in event-driven-developers-tale/functions/vacationRequestValidation/app.js
16 3 2
async function getVacations()
in event-driven-developers-tale/src/pages/Vacations.js
15 2 0
async function deleteVacations()
in event-driven-developers-tale/src/pages/Vacations.js
14 1 0
onVacationRequestNotification()
in event-driven-developers-tale/src/graphql/subscriptions.js
13 1 1
submitVacationRequest()
in event-driven-developers-tale/src/graphql/mutations.js
13 1 1
updateVacationRequest()
in event-driven-developers-tale/src/graphql/mutations.js
13 1 1
deleteVacationRequest()
in event-driven-developers-tale/src/graphql/mutations.js
13 1 2
getVacationRequest()
in event-driven-developers-tale/src/graphql/queries.js
13 1 1
async function addCategory()
in event-driven-developers-tale/src/components/AddCategory.js
13 1 0