aws-samples / amazon-chime-sdk-classroom-demo
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 46 units with 1,302 lines of code in units (21.0% of code).
    • 3 very long units (421 lines of code)
    • 6 long units (432 lines of code)
    • 9 medium size units (284 lines of code)
    • 5 small units (75 lines of code)
    • 23 very small units (90 lines of code)
32% | 33% | 21% | 5% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js47% | 0% | 32% | 9% | 9%
ts47% | 26% | 0% | 9% | 16%
tsx18% | 51% | 26% | 2% | 1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
script51% | 0% | 34% | 6% | 7%
app50% | 27% | 0% | 9% | 12%
app/components24% | 58% | 15% | 0% | 1%
app/providers0% | 100% | 0% | 0% | 0%
app/hooks0% | 0% | 86% | 13% | 0%
internals/scripts0% | 0% | 0% | 76% | 23%
app/context0% | 0% | 0% | 0% | 100%
serverless/src0% | 0% | 0% | 0% | 100%
app/chime0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function main()
in script/deploy.js
151 4 0
buildDarwinTemplate()
in app/menu.ts
145 3 0
export default function RemoteVideoGroup()
in app/components/RemoteVideoGroup.tsx
125 19 1
export default function Roster()
in app/components/Roster.tsx
98 13 0
80 3 0
export default function DeviceSwitcher()
in app/components/DeviceSwitcher.tsx
78 13 0
export default function Chat()
in app/components/Chat.tsx
66 3 0
export default function MeetingStatusProvider()
in app/providers/MeetingStatusProvider.tsx
57 4 1
export default function ContentVideo()
in app/components/ContentVideo.tsx
53 8 1
export default function CPUUsage()
in app/components/CPUUsage.tsx
46 7 0
function ensureBucket()
in script/deploy.js
41 7 2
function parseArgs()
in script/deploy.js
39 16 0
export default function LocalVideo()
in app/components/LocalVideo.tsx
33 5 0
export default function useAttendee()
in app/hooks/useAttendee.tsx
29 7 1
export default function useRaisedHandAttendees()
in app/hooks/useRaisedHandAttendees.tsx
27 4 0
export default function useFocusMode()
in app/hooks/useFocusMode.tsx
24 3 0
export default function useDevices()
in app/hooks/useDevices.tsx
23 1 0
function spawnOrFail()
in script/deploy.js
22 3 3
function usage()
in script/deploy.js
18 2 0
export default function useRoster()
in app/hooks/useRoster.tsx
16 2 0