aws-samples / aws-amplify-appsync-graphql-real-time-canvas
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 19 units with 330 lines of code in units (37.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 6 medium size units (192 lines of code)
    • 3 small units (35 lines of code)
    • 9 very small units (51 lines of code)
0% | 15% | 58% | 10% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 15% | 58% | 10% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 17% | 63% | 11% | 7%
src/graphql0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 19 longest units
Unit# linesMcCabe index# params
componentDidMount()
in src/Canvas.js
52 6 0
render()
in src/RCD.js
44 11 0
35 18 8
componentDidMount()
in src/RCD.js
35 2 0
function registerValidSW()
in src/serviceWorker.js
33 8 2
function checkValidServiceWorker()
in src/serviceWorker.js
23 4 2
export function register()
in src/serviceWorker.js
22 5 1
constructor()
in src/RCD.js
12 1 1
12 4 1
brushColor: rand()
in src/Canvas.js
11 1 0
listCanvass()
in src/graphql/queries.js
8 1 3
export function unregister()
in src/serviceWorker.js
7 2 0
brushColor: rand()
in src/Canvas.js
7 1 0
6 1 2
createCanvas()
in src/graphql/mutations.js
5 1 1
updateCanvas()
in src/graphql/mutations.js
5 1 1
deleteCanvas()
in src/graphql/mutations.js
5 1 1
getCanvas()
in src/graphql/queries.js
5 1 1
function rand()
in src/Canvas.js
3 1 0