microsoft / powerbi-visuals-streamgraph
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 28 units with 918 lines of code in units (69.1% of code).
    • 2 very long units (322 lines of code)
    • 3 long units (198 lines of code)
    • 8 medium size units (252 lines of code)
    • 7 small units (96 lines of code)
    • 8 very small units (50 lines of code)
35% | 21% | 27% | 10% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts35% | 21% | 27% | 10% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src35% | 21% | 27% | 10% | 5%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
206 37 4
private renderChart()
in src/visual.ts
116 17 4
private calculateAxes()
in src/visual.ts
76 7 0
public update()
in src/visual.ts
64 13 1
export function createTooltipData()
in src/tooltipBuilder.ts
58 13 4
45 6 0
43 7 0
public init()
in src/visual.ts
39 1 1
31 6 2
export function createTooltipInfo()
in src/tooltipBuilder.ts
26 7 4
private updateViewport()
in src/visual.ts
24 9 0
23 7 1
21 3 3
private renderLegend()
in src/visual.ts
19 4 1
private clearData()
in src/visual.ts
17 1 0
public bindEvents()
in src/behavior.ts
16 1 2
public renderSelection()
in src/behavior.ts
11 3 1
11 1 5
11 2 3
11 1 1