microsoft / powerbi-visuals-dualkpi
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 38 units with 954 lines of code in units (60.9% of code).
    • 2 very long units (300 lines of code)
    • 1 long units (93 lines of code)
    • 12 medium size units (357 lines of code)
    • 8 small units (111 lines of code)
    • 15 very small units (93 lines of code)
31% | 9% | 37% | 11% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts31% | 9% | 37% | 11% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src31% | 9% | 37% | 11% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public update()
in src/visual.ts
152 24 1
private drawChart()
in src/visual.ts
148 36 1
93 33 3
43 9 5
40 1 1
private init()
in src/visual.ts
35 2 1
private showHoverData()
in src/visual.ts
31 7 6
30 12 1
29 2 2
29 3 5
26 6 2
25 1 5
24 2 4
23 1 1
22 1 1
18 2 1
17 9 1
export function minMax()
in src/helper.ts
16 10 3
16 3 3
11 1 0