amazon-connect / video-call-escalation
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 137 units with 2,790 lines of code in units (34.9% of code).
    • 7 very long units (966 lines of code)
    • 3 long units (215 lines of code)
    • 26 medium size units (819 lines of code)
    • 25 small units (368 lines of code)
    • 76 very small units (422 lines of code)
34% | 7% | 29% | 13% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts71% | 6% | 17% | 3% | <1%
js9% | 9% | 34% | 20% | 26%
py0% | 0% | 91% | 0% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk-stacks/lib/api81% | 0% | 18% | 0% | 0%
cdk-stacks/lib/recording81% | 0% | 18% | 0% | 0%
demo-website/src15% | 6% | 37% | 19% | 20%
cdk-stacks/lib77% | 0% | 22% | 0% | 0%
cdk-stacks/lib/infrastructure90% | 0% | 0% | 9% | 0%
agent-app/src0% | 100% | 0% | 0% | 0%
cdk-stacks/lib/pipeline0% | 76% | 0% | 20% | 3%
cdk-stacks/lambdas/custom-resources0% | 0% | 91% | 0% | 8%
cdk-stacks/docker/recording0% | 0% | 75% | 14% | 10%
cdk-stacks0% | 0% | 28% | 13% | 59%
agent-app/src/hooks0% | 0% | 37% | 49% | 12%
cdk-stacks/lib/frontend0% | 0% | 74% | 26% | 0%
agent-app/src/containers0% | 0% | 0% | 100% | 0%
agent-app/src/components0% | 0% | 0% | 75% | 25%
agent-app/src/providers0% | 0% | 0% | 0% | 100%
agent-app/src/utils0% | 0% | 0% | 0% | 100%
cdk-stacks/lambdas/lib0% | 0% | 0% | 0% | 100%
cdk-stacks/lambdas/services0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk-stacks/lib/recording/recording-stack.ts
157 2 3
initEventListeners()
in demo-website/src/meeting.js
148 12 0
constructor()
in cdk-stacks/lib/api/recordingAPI-stack.ts
148 1 3
constructor()
in cdk-stacks/lib/api/chimeAPI-stack.ts
139 1 3
constructor()
in cdk-stacks/lib/api/connectAPI-stack.ts
136 4 3
constructor()
in cdk-stacks/lib/cdk-backend-stack.ts
120 2 3
constructor()
in cdk-stacks/lib/infrastructure/cognito-stack.ts
118 3 3
function App()
in agent-app/src/App.js
87 16 2
constructor()
in cdk-stacks/lib/pipeline/cdk-pipeline-stack.ts
70 6 3
setupSubscribeToAttendeeIdPresenceHandler()
in demo-website/src/meeting.js
58 13 0
export default function useNotificationHelper()
in agent-app/src/hooks/useNotificationHelper.js
49 3 0
layoutVideoTilesActiveSpeaker()
in demo-website/src/meeting.js
46 5 2
async function start()
in cdk-stacks/docker/recording/recording-app/src/js/app.js
45 6 0
updateTilePlacement()
in demo-website/src/meeting.js
40 2 5
updateRoster()
in demo-website/src/meeting.js
39 10 0
constructor()
in cdk-stacks/lib/api/chatAPI-stack.ts
37 1 3
constructor()
in cdk-stacks/lib/frontend/frontend-config-stack.ts
37 1 3
constructor()
in cdk-stacks/lib/api/routingAPI-stack.ts
36 1 3
constructor()
in cdk-stacks/lib/cdk-frontend-stack.ts
35 2 3
constructor()
in cdk-stacks/lib/recording/cdk-chime-event-bridge-stack.ts
35 1 3