aws-samples / live-streaming-with-media-services-and-appsync
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 36 units with 1,084 lines of code in units (72.6% of code).
    • 1 very long units (604 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (160 lines of code)
    • 14 small units (239 lines of code)
    • 17 very small units (81 lines of code)
55% | 0% | 14% | 22% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
js0% | 0% | 33% | 49% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk-media-services/lib100% | 0% | 0% | 0% | 0%
amplify-video-frontend/src0% | 0% | 75% | 10% | 13%
amplify-video-frontend/src/components0% | 0% | 47% | 33% | 18%
amplify-video-frontend/src/graphql0% | 0% | 12% | 70% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk-media-services/lib/cdk-media-services-stack.ts
604 1 3
render()
in amplify-video-frontend/src/components/VideoChat.js
49 1 0
render()
in amplify-video-frontend/src/App.js
42 1 0
async componentDidMount()
in amplify-video-frontend/src/App.js
35 1 0
query ListMessagesByChannel()
in amplify-video-frontend/src/graphql/queries.js
34 1 1
constructor()
in amplify-video-frontend/src/components/VideoChat.js
19 1 1
onCreateMessage()
in amplify-video-frontend/src/graphql/subscriptions.js
18 1 1
createChannel()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
updateChannel()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
deleteChannel()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
createMessage()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
updateMessage()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
deleteMessage()
in amplify-video-frontend/src/graphql/mutations.js
18 1 2
getChannel()
in amplify-video-frontend/src/graphql/queries.js
18 1 1
getMessage()
in amplify-video-frontend/src/graphql/queries.js
18 1 1
listMessages()
in amplify-video-frontend/src/graphql/queries.js
18 1 3
async componentDidMount()
in amplify-video-frontend/src/components/VideoChat.js
16 2 0
listChannels()
in amplify-video-frontend/src/graphql/queries.js
13 1 3
constructor()
in amplify-video-frontend/src/App.js
11 1 1
Specify the channel name and your playback url()
in amplify-video-frontend/src/App.js
9 1 1