microsoft / powerbi-visuals-utils-typeutils
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 142 units with 1,141 lines of code in units (69.8% of code).
    • 2 very long units (233 lines of code)
    • 1 long units (60 lines of code)
    • 5 medium size units (141 lines of code)
    • 13 small units (181 lines of code)
    • 121 very small units (526 lines of code)
20% | 5% | 12% | 15% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts20% | 5% | 12% | 15% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src20% | 9% | 7% | 17% | 46%
src/numericSequence41% | 0% | 37% | 5% | 15%
src/extensions0% | 0% | 0% | 23% | 76%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function log10()
in src/double.ts
130 35 1
public static calculate()
in src/numericSequence/numericSequence.ts
103 26 6
60 47 1
public static calculateUnits()
in src/numericSequence/numericSequence.ts
35 6 4
public static calculate()
in src/numericSequence/numericSequenceRange.ts
35 12 5
constructor()
in src/valueType.ts
25 8 4
private _ensureNotEmpty()
in src/numericSequence/numericSequenceRange.ts
23 5 0
function toExtendedType()
in src/valueType.ts
23 8 2
export function sequenceEqual()
in src/extensions/arrayExtensions.ts
19 8 4
16 5 3
export function pow10()
in src/double.ts
15 5 1
15 6 1
14 5 2
export function insertSorted()
in src/extensions/arrayExtensions.ts
14 4 2
14 5 2
13 5 2
export function getBitCount()
in src/extensions/enumExtensions.ts
13 4 1
public static calculateFixedRange()
in src/numericSequence/numericSequenceRange.ts
13 1 3
12 5 3
12 5 5