aws-samples / amazon-ivs-basic-web-sample
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 22 units with 291 lines of code in units (26.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (56 lines of code)
    • 3 medium size units (107 lines of code)
    • 4 small units (56 lines of code)
    • 14 very small units (72 lines of code)
0% | 19% | 36% | 19% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 19% | 36% | 19% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
custom-player-controls0% | 44% | 0% | 22% | 33%
multiple-players0% | 0% | 78% | 0% | 22%
videojs-integration0% | 0% | 73% | 26% | 0%
simple-quiz0% | 0% | 50% | 23% | 25%
ambiance-canvas0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
(function (IVSPlayer)()
in custom-player-controls/script.js
56 2 1
let createPlayers = function()
in multiple-players/script.js
39 2 2
const readyCallback = function()
in videojs-integration/script.js
38 3 0
(function (IVSPlayer)()
in simple-quiz/script.js
30 1 1
function()
in custom-player-controls/script.js
16 4 1
(function ()()
in videojs-integration/script.js
14 1 1
function triggerQuiz()
in simple-quiz/script.js
14 2 1
let createQualityOptions = function()
in custom-player-controls/script.js
12 1 2
function()
in custom-player-controls/script.js
9 2 1
function()
in custom-player-controls/script.js
9 2 1
let createAnswers = function()
in simple-quiz/script.js
8 2 2
let handlePlayerReady = function()
in multiple-players/script.js
6 1 2
let closeSettingsMenu = function()
in custom-player-controls/script.js
5 1 0
(function (IVSPlayer)()
in multiple-players/script.js
5 2 1
setTimeout()
in simple-quiz/script.js
4 1 1
let setBtnPaused = function()
in custom-player-controls/script.js
4 1 0
let setBtnPlay = function()
in custom-player-controls/script.js
4 1 0
let setBtnMute = function()
in custom-player-controls/script.js
4 1 0
let setBtnUnmute = function()
in custom-player-controls/script.js
4 1 0
function can()
in ambiance-canvas/script.js
4 1 0