microsoft / powerbi-visuals-utils-chartutils
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 200 units with 3,355 lines of code in units (70.0% of code).
    • 2 very long units (277 lines of code)
    • 11 long units (774 lines of code)
    • 31 medium size units (891 lines of code)
    • 54 small units (756 lines of code)
    • 102 very small units (657 lines of code)
8% | 23% | 26% | 22% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts8% | 23% | 26% | 22% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/legend16% | 30% | 22% | 19% | 10%
src/axis12% | 26% | 18% | 27% | 15%
src/dataLabel0% | 18% | 38% | 22% | 20%
src/label0% | 13% | 27% | 18% | 40%
src/legend/behavior0% | 0% | 83% | 0% | 16%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public drawLegendInternal()
in src/legend/svgLegend.ts
144 18 3
133 29 12
export function createAxis()
in src/axis/axis.ts
89 23 1
82 41 1
export function getLabelRect()
in src/label/dataLabelRectPositioner.ts
79 41 3
private calculateVerticalLayout()
in src/legend/svgLegend.ts
79 17 4
private calculateContentPositionFromPoint()
in src/dataLabel/dataLabelManager.ts
76 29 4
75 11 5
private calculateHorizontalLayout()
in src/legend/svgLegend.ts
67 9 3
export function rotate()
in src/axis/labelLayoutStrategy.ts
63 12 4
constructor()
in src/dataLabel/dataLabelArrangeGrid.ts
60 12 3
private drawLegendItems()
in src/legend/interactiveLegend.ts
53 1 1
51 9 11
export function willLabelsWordBreak()
in src/axis/labelLayoutStrategy.ts
48 5 7
export function enumerateDataLabels()
in src/dataLabel/dataLabelUtils.ts
48 16 1
function selectLabels()
in src/dataLabel/dataLabelUtils.ts
39 9 5
37 9 8
export function isValidLabelOverflowing()
in src/label/dataLabelRectPositioner.ts
37 18 3
export function drawDefaultLabels()
in src/label/newDataLabelUtils.ts
37 6 4
export function getLabelLeaderLineEndingPoint()
in src/label/dataLabelPointPositioner.ts
35 9 3