awslabs / aws-streaming-media-analytics
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 91 units with 1,228 lines of code in units (53.8% of code).
    • 1 very long units (107 lines of code)
    • 2 long units (124 lines of code)
    • 15 medium size units (433 lines of code)
    • 16 small units (221 lines of code)
    • 57 very small units (343 lines of code)
8% | 10% | 35% | 17% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js9% | 6% | 34% | 19% | 30%
py0% | 52% | 47% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
web/reactplayer12% | 8% | 22% | 19% | 37%
lambda-functions/fastly-logs-processor-function0% | 100% | 0% | 0% | 0%
lambda-functions/add-partition-function0% | 0% | 81% | 9% | 9%
lambda-functions/deploy-function0% | 0% | 72% | 27% | 0%
lambda-functions/cloudfront-logs-processor-function0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export var SDK = function()
in web/reactplayer/src/sdk/QoSSDK.js
107 3 1
function getMetricDataFrame()
in web/reactplayer/public/test-harness/js/test-harness.js
73 5 0
def lambda_handler()
in lambda-functions/fastly-logs-processor-function/prep-data.py
51 8 2
componentDidMount()
in web/reactplayer/src/Components/VideoJSPlayer.js
48 3 0
def lambda_handler()
in lambda-functions/cloudfront-logs-processor-function/prep-data.py
47 7 2
function sendResponse()
in lambda-functions/deploy-function/index.js
33 1 4
async function createPlayerLogsPartition()
in lambda-functions/add-partition-function/index.js
33 7 4
async function createCDNLogsPartition()
in lambda-functions/add-partition-function/index.js
33 7 4
function uploadUIAssets()
in lambda-functions/deploy-function/index.js
31 5 1
async function createETLJobPartition()
in lambda-functions/add-partition-function/index.js
31 7 0
step = function()
in web/reactplayer/src/sdk/QoSSDK.js
24 4 3
function uploadVideoAssets()
in lambda-functions/deploy-function/index.js
23 2 1
function uuid()
in web/reactplayer/public/test-harness/js/test-harness.js
23 6 0
export default function register()
in web/reactplayer/src/registerServiceWorker.js
22 5 0
function checkValidServiceWorker()
in web/reactplayer/src/registerServiceWorker.js
22 3 1
function registerValidSW()
in web/reactplayer/src/registerServiceWorker.js
21 3 1
render()
in web/reactplayer/src/Components/SampleVideos.js
21 1 0
onPlay()
in web/reactplayer/src/Components/VideoJSPlayer.js
21 4 1
exports.handler = function()
in lambda-functions/deploy-function/index.js
19 3 2
resetVideo = function()
in web/reactplayer/src/sdk/QoSSDK.js
19 1 1