aws-samples / aws-alexa-workshop-smarthome
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 13 units with 160 lines of code in units (55.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (73 lines of code)
    • 4 small units (55 lines of code)
    • 6 very small units (32 lines of code)
0% | 0% | 45% | 34% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 45% | 34% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 60% | 33% | 6%
alexa/skills/smarthome0% | 0% | 32% | 35% | 31%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
constructor()
in alexa/skills/smarthome/AlexaResponse.js
28 6 1
24 1 0
21 4 1
createPayloadEndpoint()
in alexa/skills/smarthome/AlexaResponse.js
15 3 1
createPayloadEndpointCapability()
in alexa/skills/smarthome/AlexaResponse.js
15 3 1
13 1 2
12 1 1
createContextProperty()
in alexa/skills/smarthome/AlexaResponse.js
9 1 1
5 1 1
checkValue()
in alexa/skills/smarthome/AlexaResponse.js
5 4 2
addContextProperty()
in alexa/skills/smarthome/AlexaResponse.js
5 2 1
addPayloadEndpoint()
in alexa/skills/smarthome/AlexaResponse.js
5 2 1
get()
in alexa/skills/smarthome/AlexaResponse.js
3 1 0