aws-samples / amazon-ivs-clip-web-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 31 units with 454 lines of code in units (44.8% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (143 lines of code)
    • 3 medium size units (96 lines of code)
    • 8 small units (119 lines of code)
    • 18 very small units (96 lines of code)
0% | 31% | 21% | 26% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 32% | 31% | 27% | 8%
ts0% | 83% | 0% | 16% | 0%
js0% | 0% | 15% | 30% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
clips0% | 88% | 0% | 0% | 11%
cdk/lib0% | 83% | 0% | 16% | 0%
clips/hls0% | 0% | 34% | 57% | 8%
clips/remux0% | 0% | 100% | 0% | 0%
web-ui0% | 0% | 15% | 30% | 55%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func clip()
in clips/clips.go
77 8 2
constructor()
in cdk/lib/backend-stack.ts
66 1 3
func downloadSegments()
in clips/hls/hls.go
39 9 1
func Remux()
in clips/remux/remux.go
36 10 2
21 2 1
func downloadSegment()
in clips/hls/hls.go
18 4 2
func getMasterManifest()
in clips/hls/hls.go
17 4 1
func getPlaylist()
in clips/hls/hls.go
17 4 1
function()
in web-ui/clip.js
16 4 1
let startApp = function()
in web-ui/clip.js
15 1 0
constructor()
in cdk/lib/ui-stack.ts
13 1 3
func GetSegments()
in clips/hls/hls.go
12 3 1
11 1 2
function()
in web-ui/clip.js
9 2 1
function()
in web-ui/clip.js
9 2 1
func extractTopVariant()
in clips/hls/hls.go
9 3 1
7 1 1
7 1 1
7 1 1
call.onload = function()
in web-ui/clip.js
6 1 0