aws-samples / aws-alexa-workshop-smarthome-ui
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 17 units with 317 lines of code in units (35.1% of code).
    • 1 very long units (117 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (124 lines of code)
    • 1 small units (18 lines of code)
    • 10 very small units (58 lines of code)
36% | 0% | 39% | 5% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js36% | 0% | 39% | 5% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src47% | 0% | 40% | 7% | 5%
src/graphql0% | 0% | 34% | 0% | 65%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
117 6 0
function registerValidSW()
in src/serviceWorker.js
33 8 2
query ListDevices()
in src/graphql/queries.js
24 1 1
function checkValidServiceWorker()
in src/serviceWorker.js
23 4 2
export function register()
in src/serviceWorker.js
22 5 1
function App()
in src/App.js
22 1 0
18 1 1
export function unregister()
in src/serviceWorker.js
7 2 0
createDevice()
in src/graphql/mutations.js
7 1 2
updateDevice()
in src/graphql/mutations.js
7 1 2
deleteDevice()
in src/graphql/mutations.js
7 1 2
getDevice()
in src/graphql/queries.js
7 1 1
function handleClose()
in src/Device.js
6 2 2
mutation CreateDevice()
in src/graphql/mutations.js
5 1 1
mutation UpdateDevice()
in src/graphql/mutations.js
5 1 1
mutation DeleteDevice()
in src/graphql/mutations.js
5 1 1
query GetDevice()
in src/graphql/queries.js
2 1 1