microsoft / arcade-machine-react
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 97 units with 1,054 lines of code in units (61.0% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (104 lines of code)
    • 11 medium size units (315 lines of code)
    • 19 small units (294 lines of code)
    • 65 very small units (341 lines of code)
0% | 9% | 29% | 27% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 12% | 34% | 27% | 26%
tsx0% | 0% | 11% | 30% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/focus0% | 31% | 20% | 35% | 12%
src/input0% | 0% | 75% | 0% | 25%
src0% | 0% | 35% | 30% | 33%
src/scroll0% | 0% | 57% | 12% | 29%
src/components0% | 0% | 11% | 30% | 58%
src/state0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function isForForm()
in src/focus/is-for-form.ts
53 27 2
public findNextFocus()
in src/focus/focus-by-raycast.ts
51 13 4
public find()
in src/focus/focus-by-distance.ts
39 12 0
public scrollTo()
in src/scroll/smooth-scrolling-algorithm.ts
37 5 3
constructor()
in src/input/xbox-gamepad.ts
34 6 1
private bubbleEvent()
in src/focus-service.ts
29 7 3
public findNextFocus()
in src/focus/focus-by-registry.ts
29 10 2
public attempt()
in src/input/directional-debouncer.ts
28 7 1
public sendButton()
in src/focus-service.ts
26 7 1
public scrollTo()
in src/scroll/native-smooth-scrolling.ts
25 7 3
private createArcEvent()
in src/focus-service.ts
24 4 2
public componentDidMount()
in src/components/arc-exclude.tsx
22 5 0
private pollGamepad()
in src/input/gamepad-input.ts
22 8 2
private recreateResolved()
in src/state/element-state-record.ts
20 6 0
public componentDidMount()
in src/components/arc-focus-area.tsx
19 6 0
private defaultFires()
in src/focus-service.ts
19 7 1
public find()
in src/focus/index.ts
19 3 2
public setServices()
in src/singleton.ts
19 4 1
public setDefaultFocus()
in src/focus-service.ts
18 7 0
public calcPrimaryDistance()
in src/focus/focus-by-distance.ts
18 5 2