aws / aws-iot-device-sdk-js
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 67 units with 1,239 lines of code in units (87.6% of code).
    • 1 very long units (258 lines of code)
    • 4 long units (235 lines of code)
    • 13 medium size units (397 lines of code)
    • 11 small units (163 lines of code)
    • 38 very small units (186 lines of code)
20% | 18% | 32% | 13% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js20% | 18% | 32% | 13% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
device43% | 0% | 26% | 16% | 13%
thing0% | 45% | 30% | 8% | 16%
common/lib0% | 95% | 0% | 0% | 4%
jobs0% | 0% | 71% | 9% | 18%
device/lib0% | 0% | 0% | 65% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function DeviceClient()
in device/index.js
258 58 1
69 18 3
module.exports = function()
in common/lib/tls-reader.js
61 22 1
53 7 2
52 16 4
function signUrl()
in device/index.js
49 8 14
46 12 4
36 9 0
33 11 2
function jobsClient()
in jobs/index.js
31 2 1
31 8 3
30 8 3
this.subscribe = function()
in device/index.js
27 5 3
25 13 2
24 5 1
function _wrapper()
in device/index.js
22 7 1
function()
in thing/index.js
22 8 2
this.publish = function()
in device/index.js
21 7 4
20 3 3
18 5 3