microsoft / powerbi-visuals-utils-colorutils
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 42 units with 914 lines of code in units (195.3% of code).
    • 2 very long units (439 lines of code)
    • 1 long units (57 lines of code)
    • 6 medium size units (171 lines of code)
    • 4 small units (63 lines of code)
    • 29 very small units (184 lines of code)
48% | 6% | 18% | 6% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts48% | 6% | 18% | 6% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src48% | 6% | 18% | 6% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
R: parseInt()
in src/colorUtils.ts
220 34 2
G: parseInt()
in src/colorUtils.ts
219 34 2
function hsvToRgb()
in src/colorUtils.ts
57 8 1
function rgbToHsv()
in src/colorUtils.ts
42 7 1
31 10 3
R: parseInt()
in src/colorUtils.ts
26 4 2
G: parseInt()
in src/colorUtils.ts
25 4 2
B: parseInt()
in src/colorUtils.ts
24 4 2
A: parseFloat()
in src/colorUtils.ts
23 4 1
20 5 1
R: channelBlend()
in src/colorUtils.ts
16 4 3
G: channelBlend()
in src/colorUtils.ts
15 4 3
12 5 3
R: parseInt()
in src/colorUtils.ts
10 4 2
public getColorForMeasure()
in src/colorHelper.ts
9 5 3
9 2 2
export function rotate()
in src/colorUtils.ts
9 2 2
R: parseInt()
in src/colorUtils.ts
9 4 2
G: parseInt()
in src/colorUtils.ts
9 4 2
public getColorForSeriesValue()
in src/colorHelper.ts
8 5 3