microsoft / powerbi-visuals-mekkochart
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 143 units with 4,246 lines of code in units (72.2% of code).
    • 6 very long units (1,292 lines of code)
    • 14 long units (984 lines of code)
    • 39 medium size units (1,226 lines of code)
    • 27 small units (407 lines of code)
    • 57 very small units (337 lines of code)
30% | 23% | 28% | 9% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts30% | 23% | 28% | 9% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src29% | 26% | 29% | 8% | 6%
src/columnChart40% | 12% | 28% | 9% | 9%
src/converterStrategy62% | 0% | 0% | 22% | 15%
src/visualStrategy0% | 47% | 42% | 3% | 5%
src/axis0% | 57% | 30% | 11% | 0%
src/behavior0% | 0% | 0% | 59% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static createDataPoints()
in src/columnChart/baseColumnChart.ts
406 89 17
private renderChart()
in src/visual.ts
260 43 10
private render()
in src/visual.ts
210 51 1
private renderLegend()
in src/visual.ts
168 34 0
public getLegend()
in src/converterStrategy/baseConverterStrategy.ts
126 36 5
public static converter()
in src/columnChart/baseColumnChart.ts
122 11 9
87 30 1
86 14 2
public calculateAxesProperties()
in src/columnChart/baseColumnChart.ts
85 17 1
private createAxis()
in src/visualStrategy/baseVisualStrategy.ts
82 10 1
75 23 3
74 14 4
private enumerateDataPoints()
in src/columnChart/baseColumnChart.ts
71 14 1
69 18 9
68 24 1
64 16 1
59 12 7
private static createFormatter()
in src/visualStrategy/baseVisualStrategy.ts
55 7 9
private static drawDefaultShapes()
in src/visualStrategy/baseVisualStrategy.ts
55 3 5
public init()
in src/visual.ts
54 1 1