aws-solutions / real-time-iot-device-monitoring-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 58 units with 1,109 lines of code in units (15.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (302 lines of code)
    • 14 medium size units (461 lines of code)
    • 14 small units (204 lines of code)
    • 26 very small units (142 lines of code)
0% | 27% | 41% | 18% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 25% | 44% | 17% | 12%
py0% | 40% | 16% | 28% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/web_site/js0% | 42% | 28% | 17% | 11%
source/update_ddb_from_stream0% | 40% | 16% | 28% | 14%
source/custom-resource/lib0% | 0% | 83% | 5% | 11%
source/custom-resource0% | 0% | 43% | 30% | 26%
deployment/manifest-generator0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
var getLatestRecord = function()
in source/web_site/js/dash.js
93 15 0
function init()
in source/web_site/js/dash.js
89 1 0
$()
in source/web_site/js/dash.js
69 15 1
def lambda_handler()
in source/update_ddb_from_stream/update_ddb_from_stream.py
51 10 2
kinesisAnalyticsAppHelper.prototype.startApplication = function()
in source/custom-resource/lib/kinesis-helper.js
44 5 3
let uploadFile = function()
in source/custom-resource/lib/website-helper.js
42 11 5
var updateLineChart = function()
in source/web_site/js/dash.js
41 10 6
var generateLineChartConfig = function()
in source/web_site/js/dash.js
39 1 1
37 1 1
kinesisAnalyticsAppHelper.prototype.stopApplication = function()
in source/custom-resource/lib/kinesis-helper.js
36 5 3
websiteHelper.prototype.configureWebsite = function()
in source/custom-resource/lib/website-helper.js
35 4 5
let sendResponse = function()
in source/custom-resource/index.js
34 1 5
metricsHelper.prototype.sendAnonymousMetric = function()
in source/custom-resource/lib/metrics-helper.js
31 2 2
$()
in source/web_site/js/dash.js
28 5 1
bucketEncryptionHelper.prototype.enableDefaultBucketEncryption = function()
in source/custom-resource/lib/s3-bucket-encryption-helper.js
27 3 4
onSuccess: function()
in source/web_site/js/dash.js
24 2 1
let downloadWebsiteManifest = function()
in source/custom-resource/lib/website-helper.js
22 4 4
def sendAnonymousData()
in source/update_ddb_from_stream/update_ddb_from_stream.py
21 1 2
def put_record_with_retry()
in source/update_ddb_from_stream/update_ddb_from_stream.py
19 4 6
var updateHorizontalBarChart = function()
in source/web_site/js/dash.js
17 4 5