aws-observability / aws-rum-web
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 142 units with 1,173 lines of code in units (20.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (49 lines of code)
    • 45 small units (632 lines of code)
    • 95 very small units (492 lines of code)
0% | 0% | 4% | 53% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 2% | 52% | 44%
js0% | 0% | 12% | 60% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/orchestration0% | 0% | 18% | 58% | 23%
src/loader0% | 0% | 12% | 62% | 24%
src/plugins0% | 0% | 0% | 40% | 59%
src/sessions0% | 0% | 0% | 51% | 48%
src/dispatch0% | 0% | 0% | 70% | 29%
src/event-cache0% | 0% | 0% | 73% | 26%
src0% | 0% | 0% | 46% | 53%
ROOT0% | 0% | 0% | 0% | 100%
src/test-utils0% | 0% | 0% | 0% | 100%
src/errors0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private initPluginManager()
in src/orchestration/Orchestration.ts
26 2 2
export async function run()
in src/loader/utils/scorekeep.js
23 1 0
private createIdForCurrentPage()
in src/plugins/event-plugins/PageViewPlugin.ts
20 10 0
private initDispatch()
in src/orchestration/Orchestration.ts
20 4 1
private constructBuiltinPlugins()
in src/orchestration/Orchestration.ts
20 5 0
private telemetryFunctor()
in src/orchestration/Orchestration.ts
20 1 0
public getSession()
in src/sessions/SessionManager.ts
18 7 0
export function loader()
in src/loader/loader.js
18 1 7
export async function updateGame()
in src/loader/utils/scorekeep.js
18 1 5
export async function updateSession()
in src/loader/utils/scorekeep.js
17 1 3
private recordHttpEventWithError()
in src/plugins/event-plugins/XhrPlugin.ts
17 1 2
private async dispatch()
in src/dispatch/Dispatch.ts
17 3 1
private initializeUser()
in src/sessions/SessionManager.ts
16 4 0
public recordPageView()
in src/sessions/PageManager.ts
16 6 1
private createPageViewEvent()
in src/sessions/PageManager.ts
16 3 0
private getSessionFromCookie()
in src/sessions/SessionManager.ts
15 5 0
15 1 9
private isCurrentUrlAllowed()
in src/event-cache/EventCache.ts
15 5 0
private initCwr()
in src/CommandQueue.ts
15 1 1
protected patches()
in src/plugins/event-plugins/XhrPlugin.ts
14 1 0