aws-samples / aws-iot-kickstart
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 696 units with 7,665 lines of code in units (31.5% of code).
    • 4 very long units (642 lines of code)
    • 14 long units (872 lines of code)
    • 71 medium size units (2,120 lines of code)
    • 119 small units (1,765 lines of code)
    • 488 very small units (2,266 lines of code)
8% | 11% | 27% | 23% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js30% | 19% | 28% | 13% | 7%
ts0% | 5% | 29% | 28% | 35%
py0% | 19% | 18% | 17% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/services/devices56% | 13% | 22% | 4% | 2%
source/services/deployments41% | 42% | 0% | 13% | 2%
source/services/just-in-time-on-boarding100% | 0% | 0% | 0% | 0%
source/console/src0% | 5% | 29% | 28% | 35%
source/cf/defaults0% | 19% | 18% | 17% | 44%
source/services/systems0% | 65% | 25% | 0% | 9%
source/services/admin0% | 0% | 55% | 19% | 25%
source/resources/cf-helper-s30% | 0% | 69% | 25% | 5%
source/resources/utils0% | 0% | 34% | 47% | 18%
source/resources/usage-metrics0% | 0% | 94% | 0% | 5%
source/services/settings0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in source/services/deployments/lib/addDeployment.js
195 22 2
function handler()
in source/services/just-in-time-on-boarding/index.js
161 10 3
module.exports = function()
in source/services/devices/lib/deleteDevice.js
158 4 2
module.exports = function()
in source/services/devices/lib/updateDevice.js
128 11 2
ngOnInit()
in source/console/src/app/common/modules/graph-line/graph-line.component.ts
91 7 0
module.exports = function()
in source/services/deployments/lib/createGreengrassXDefinitionVersion.js
77 8 3
module.exports = function()
in source/services/devices/lib/createCertificate.js
70 2 2
function extend()
in source/services/deployments/lib/merge-sputnik-specs.js
68 17 3
function processDeviceList()
in source/services/systems/lib/refresh-system.js
65 7 2
module.exports = function()
in source/services/systems/lib/refresh-system.js
65 6 2
def camera_handler()
in source/cf/defaults/lambdas/sputnik-gg-ml-inference-squeezenet-demo-python/lambda_function.py
60 6 0
submit()
in source/console/src/app/secure/systems/systems.modal.component.ts
57 8 0
def __init__()
in source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py
56 6 5
def greengrass_run()
in source/cf/defaults/lambdas/sputnik-simple-greengrass-device-demo-python/lambda_function.py
55 8 0
createdAt: moment()
in source/services/deployments/lib/addDeployment.js
55 2 0
def __init__()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/sense_hat/sense_hat.py
51 7 3
ngOnInit()
in source/console/src/app/secure/child-views/devices/default-device/default-device.component.ts
51 7 0
public createCertificate()
in source/console/src/app/services/device.service.ts
51 2 3
public deploy()
in source/console/src/app/secure/systems/system.component.ts
50 2 0
createMap()
in source/console/src/app/secure/maps/maps.component.ts
50 3 0