microsoft / powerbi-visuals-utils-formattingutils
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 378 units with 25,926 lines of code in units (96.5% of code).
    • 3 very long units (20,826 lines of code)
    • 10 long units (719 lines of code)
    • 78 medium size units (2,278 lines of code)
    • 60 small units (882 lines of code)
    • 227 very small units (1,221 lines of code)
80% | 2% | 8% | 3% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts80% | 2% | 8% | 3% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
globalize88% | 1% | 6% | 1% | 2%
src/formattingService0% | 29% | 37% | 22% | 10%
src0% | 8% | 34% | 29% | 27%
src/number0% | 88% | 0% | 0% | 11%
src/date0% | 0% | 42% | 25% | 32%
src/displayUnitSystem0% | 0% | 23% | 17% | 59%
src/storageService0% | 0% | 0% | 30% | 69%
src/font0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default function injectCultures()
in globalize/globalize.cultures.ts
20529 1 1
formatDate = function()
in globalize/globalize.ts
161 58 3
parseExact = function()
in globalize/globalize.ts
136 77 3
function fuseNumberWithCustomFormatLeft()
in src/formattingService/formattingService.ts
96 31 4
Globalize.parseFloat = function()
in globalize/globalize.ts
84 17 3
78 21 1
function formatNumberCustom()
in src/formattingService/formattingService.ts
78 18 4
getParseRegExp = function()
in globalize/globalize.ts
76 36 2
export function create()
in src/valueFormatter.ts
69 16 1
function formatNumberStandard()
in src/formattingService/formattingService.ts
68 25 3
formatNumber = function()
in globalize/globalize.ts
64 26 3
expandNumber = function()
in globalize/globalize.ts
53 14 3
static expandNumber()
in src/number/numberFormatter.ts
53 14 3
export function getCustomFormatMetadata()
in src/formattingService/formattingService.ts
48 13 4
function toNonScientific()
in src/formattingService/formattingService.ts
44 11 2
40 14 3
export function splitByWidth()
in src/wordBreaker.ts
39 10 6
extend = function()
in globalize/globalize.ts
38 20 1
export function getTailoredTextOrDefault()
in src/textMeasurementService.ts
38 7 2
parseNegativePattern = function()
in globalize/globalize.ts
37 13 3