aws-solutions / real-time-web-analytics-with-kinesis
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 82 units with 1,228 lines of code in units (12.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (135 lines of code)
    • 20 medium size units (685 lines of code)
    • 13 small units (166 lines of code)
    • 47 very small units (242 lines of code)
0% | 10% | 55% | 13% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 11% | 60% | 12% | 14%
py0% | 0% | 0% | 21% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/wasa0% | 55% | 23% | 0% | 21%
source/web_site/js0% | 10% | 61% | 12% | 15%
source/custom-resource/lib0% | 0% | 79% | 9% | 10%
source/custom-resource0% | 0% | 36% | 51% | 11%
source/wasa/lib0% | 0% | 100% | 0% | 0%
source/load-testing0% | 0% | 0% | 21% | 78%
source/web_site0% | 0% | 0% | 21% | 78%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function amendMetric()
in source/wasa/index.js
78 13 2
var getLatestMetrics = function()
in source/web_site/js/dash.js
57 14 0
kinesisAnalyticsAppHelper.prototype.startApplication = function()
in source/custom-resource/lib/kinesis-helper.js
44 5 3
function makeAllEventsLineChart()
in source/web_site/js/dash.js
44 6 1
let createAppVariables = function()
in source/custom-resource/lib/website-helper.js
43 2 9
let uploadFile = function()
in source/custom-resource/lib/website-helper.js
42 11 5
$()
in source/web_site/js/dash.js
42 15 1
function makeBarChart()
in source/web_site/js/dash.js
40 7 2
function init()
in source/web_site/js/dash.js
38 1 0
function makeVisitorLineChart()
in source/web_site/js/dash.js
36 5 2
dynamoHelper.prototype.seedData = function()
in source/custom-resource/lib/dynamo-helper.js
34 4 3
let sendResponse = function()
in source/custom-resource/index.js
34 1 5
amiHelper.prototype.getAMIByName = function()
in source/custom-resource/lib/ami-helper.js
33 5 3
function upsert()
in source/wasa/index.js
33 6 2
function makeAmomalyBarChart()
in source/web_site/js/dash.js
33 4 2
metricsHelper.prototype.sendAnonymousMetric = function()
in source/custom-resource/lib/metrics-helper.js
31 2 2
31 2 2
function makePieChart()
in source/web_site/js/dash.js
30 3 2
function makeHorizontalBarChart()
in source/web_site/js/dash.js
30 3 2
onSuccess: function()
in source/web_site/js/dash.js
24 2 1