microsoft / PowerBI-visuals-PowerKPI
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 270 units with 4,456 lines of code in units (66.2% of code).
    • 6 very long units (811 lines of code)
    • 10 long units (621 lines of code)
    • 41 medium size units (1,232 lines of code)
    • 65 small units (947 lines of code)
    • 148 very small units (845 lines of code)
18% | 13% | 27% | 21% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts18% | 13% | 27% | 21% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/visualComponent18% | 14% | 30% | 20% | 15%
src/converter47% | 14% | 18% | 10% | 9%
src0% | 47% | 14% | 18% | 18%
src/settings0% | 0% | 17% | 39% | 43%
src/dataRepresentation0% | 0% | 56% | 0% | 43%
src/behavior0% | 0% | 75% | 0% | 25%
src/services0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public process()
in src/converter/dataConverter.ts
232 59 1
private showTooltip()
in src/visualComponent/tooltipComponent.ts
126 36 1
public render()
in src/visualComponent/kpi/varianceComponentWithIndicator.ts
119 32 1
export function createScale()
in src/visualComponent/axes/helpers/axisHelper.ts
115 35 1
public render()
in src/visualComponent/plotComponent.ts
114 7 1
export function createAxis()
in src/visualComponent/axes/helpers/axisHelper.ts
105 23 1
82 37 1
private getGradientPoints()
in src/converter/dataConverter.ts
69 10 9
public render()
in src/visualComponent/kpi/varianceComponentWithCustomLabel.ts
67 24 1
export function createFormatter()
in src/visualComponent/axes/helpers/axisHelper.ts
60 9 11
public render()
in src/visualComponent/axes/xAxisComponent.ts
60 7 1
public render()
in src/visualComponent/chartComponent.ts
59 7 1
private renderDynamicComponentByPosition()
in src/visualComponent/svgComponent.ts
58 10 4
export function getRecommendedTickValuesForAQuantitativeRange()
in src/visualComponent/axes/helpers/axisHelper.ts
56 22 4
public render()
in src/visualComponent/kpi/valueKPIComponent.ts
56 26 1
protected renderElement()
in src/visualComponent/kpi/captionKPIComponent.ts
54 8 4
public render()
in src/visualComponent/svgComponent.ts
46 5 1
private pointerMoveEvent()
in src/visualComponent/svgComponent.ts
46 12 1
public preRender()
in src/visualComponent/axes/xAxisComponent.ts
41 5 1
public render()
in src/visualComponent/combo/lineComponent.ts
41 2 1