aws-samples / aws-appsync-presence-api
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 14 units with 252 lines of code in units (35.1% of code).
    • 1 very long units (151 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (45 lines of code)
    • 1 small units (19 lines of code)
    • 11 very small units (37 lines of code)
59% | 0% | 17% | 7% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts65% | 0% | 19% | 8% | 6%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib65% | 0% | 19% | 8% | 6%
presencedemo/src/graphql0% | 0% | 0% | 0% | 100%
src/functions/on_disconnect0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
constructor()
in lib/presence-stack.ts
151 3 3
45 1 0
private addFunction()
in lib/presence-stack.ts
19 3 2
private createResolver()
in lib/presence-stack.ts
8 2 3
disconnected()
in src/functions/on_disconnect/on_disconnect.js
4 1 1
private getFn()
in lib/presence-stack.ts
3 1 1
3 1 2
query getStatus()
in presencedemo/src/graphql/operations.js
3 1 1
query heartbeat()
in presencedemo/src/graphql/operations.js
3 1 1
mutation connectPlayer()
in presencedemo/src/graphql/operations.js
3 1 1
mutation disconnectPlayer()
in presencedemo/src/graphql/operations.js
3 1 1
subscription statusChanged()
in presencedemo/src/graphql/operations.js
3 1 1
schema: PresenceSchema()
in lib/presence-stack.ts
2 1 0
mutation disconnected()
in src/functions/on_disconnect/on_disconnect.js
2 1 1