microsoft / vott-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 16 units with 141 lines of code in units (17.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (31 lines of code)
    • 2 small units (30 lines of code)
    • 13 very small units (80 lines of code)
0% | 0% | 21% | 21% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx0% | 0% | 43% | 26% | 29%
ts0% | 0% | 0% | 15% | 84%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/components0% | 0% | 43% | 26% | 29%
src/common0% | 0% | 0% | 15% | 84%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
public render()
in src/components/tagEditorModal/tagEditorModal.tsx
31 4 0
public render()
in src/components/tagsInput/tagsInput.tsx
19 3 0
11 3 2
public static flushUi()
in src/common/mockFactory.ts
8 2 1
private static randomColor()
in src/common/mockFactory.ts
8 1 0
8 2 1
public static createTestTags()
in src/common/mockFactory.ts
7 2 1
public componentDidUpdate()
in src/components/tagsInput/tagsInput.tsx
7 2 1
public static emtpy()
in src/common/guard.ts
6 4 3
public static null()
in src/common/guard.ts
6 3 3
public static expression()
in src/common/guard.ts
6 4 2
public static createTestTag()
in src/common/mockFactory.ts
6 1 1
public componentDidMount()
in src/components/tagsInput/tagsInput.tsx
5 1 0
currentTagColorIndex: randomIntInRange()
in src/components/tagsInput/tagsInput.tsx
5 2 2
private static randomColorSegment()
in src/common/mockFactory.ts
4 1 0
private getTagIdFromClick()
in src/components/tagsInput/tagsInput.tsx
4 2 1