aws-samples / aws-iot-core-acmebots-monitoring
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 158 units with 2,567 lines of code in units (52.5% of code).
    • 1 very long units (128 lines of code)
    • 7 long units (505 lines of code)
    • 27 medium size units (852 lines of code)
    • 32 small units (469 lines of code)
    • 91 very small units (613 lines of code)
4% | 19% | 33% | 18% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js4% | 19% | 33% | 18% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend/src10% | 28% | 28% | 14% | 17%
frontend/src0% | 20% | 42% | 23% | 14%
bots/src0% | 0% | 26% | 33% | 40%
bots/scripts0% | 0% | 29% | 0% | 70%
frontend/scripts0% | 0% | 54% | 0% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
handleTelemetryData: function()
in backend/src/iotRules/handleTelemetryData.js
128 7 3
clearEcsCluster: function()
in backend/src/cleanup/clear-ecs-cluster.js
99 11 3
render()
in frontend/src/components/Telemetry.js
97 3 0
render()
in frontend/src/components/Telemetry.js
72 5 0
ecsProvisionBot: function()
in backend/src/bot/ecsProvisionBot.js
66 1 3
ecsDeleteBot: function()
in backend/src/bot/ecsDeleteBot.js
59 7 3
handler: function()
in backend/src/cwEvents/processAcmeBotsStatusEvents.js
56 4 3
handler: function()
in backend/src/cwEvents/processAcmeBotsConnectivityEvents.js
56 4 3
render()
in frontend/src/components/Telemetry.js
48 6 0
clearS3Bucket: function()
in backend/src/cleanup/clear-s3-bucket.js
46 4 3
updateState: function()
in bots/src/bot/core.js
44 12 2
render()
in frontend/src/components/Things.js
44 4 0
clearEcrRepo: function()
in backend/src/cleanup/clear-ecr-repo.js
44 5 3
clearPrincipals: function()
in backend/src/cleanup/detachPrincipals.js
42 5 3
bootstrap: function()
in bots/src/bot/iot.js
37 1 1
function sendResponse()
in backend/src/cleanup/clear-ecr-repo.js
37 3 6
function sendResponse()
in backend/src/cleanup/detachPrincipals.js
37 3 6
function sendResponse()
in backend/src/cleanup/clear-s3-bucket.js
37 3 6
function sendResponse()
in backend/src/cleanup/clear-ecs-cluster.js
37 3 6
render()
in frontend/src/components/Things.js
34 3 0