microsoft / PowerBI-visuals-sampleBarChart-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 17 units with 106 lines of code in units (9.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (21 lines of code)
    • 2 small units (30 lines of code)
    • 14 very small units (55 lines of code)
0% | 0% | 19% | 28% | 51%
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% | 30% | 0% | 69%
ts0% | 0% | 0% | 78% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/components0% | 0% | 61% | 0% | 38%
src0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
render()
in src/components/Tooltip.tsx
21 2 0
viewport: mapViewport()
in src/optionsMapper.ts
19 1 1
11 1 1
value: Number()
in src/optionsMapper.ts
8 1 1
public static update()
in src/reactUtils.tsx
5 1 1
public constructor()
in src/reactUtils.tsx
5 1 1
constructor()
in src/visual.tsx
5 1 1
constructor()
in src/components/Tooltip.tsx
4 1 1
private static subscribe()
in src/reactUtils.tsx
4 1 1
componentWillMount()
in src/components/Tooltip.tsx
3 1 0
mouseMoveHandler()
in src/components/Tooltip.tsx
3 1 1
componentWillUnmount()
in src/components/Tooltip.tsx
3 1 0
public update()
in src/reactUtils.tsx
3 1 1
public componentWillMount()
in src/reactUtils.tsx
3 1 0
public componentWillUnmount()
in src/reactUtils.tsx
3 1 0
showTooltipAction()
in src/visual.tsx
3 1 1
hideTooltipAction()
in src/visual.tsx
3 1 0