microsoft / powerbi-visuals-utils-formattingutils
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 378 units with 25,926 lines of code in units (96.5% of code).
    • 2 very complex units (297 lines of code)
    • 3 complex units (236 lines of code)
    • 16 medium complex units (803 lines of code)
    • 56 simple units (1,533 lines of code)
    • 301 very simple units (23,057 lines of code)
1% | <1% | 3% | 5% | 88%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
ts1% | <1% | 3% | 5% | 88%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
globalize1% | <1% | 1% | 4% | 92%
src/formattingService0% | 11% | 32% | 25% | 30%
src0% | 0% | 16% | 26% | 57%
src/date0% | 0% | 18% | 23% | 57%
src/number0% | 0% | 88% | 0% | 11%
src/displayUnitSystem0% | 0% | 0% | 18% | 81%
src/storageService0% | 0% | 0% | 0% | 100%
src/font0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
parseExact = function()
in globalize/globalize.ts
136 77 3
formatDate = function()
in globalize/globalize.ts
161 58 3
getParseRegExp = function()
in globalize/globalize.ts
76 36 2
function fuseNumberWithCustomFormatLeft()
in src/formattingService/formattingService.ts
96 31 4
formatNumber = function()
in globalize/globalize.ts
64 26 3
function formatNumberStandard()
in src/formattingService/formattingService.ts
68 25 3
78 21 1
extend = function()
in globalize/globalize.ts
38 20 1
function formatNumberCustom()
in src/formattingService/formattingService.ts
78 18 4
Globalize.parseFloat = function()
in globalize/globalize.ts
84 17 3
export function create()
in src/valueFormatter.ts
69 16 1
constructor()
in src/formattingService/formattingService.ts
32 15 1
expandNumber = function()
in globalize/globalize.ts
53 14 3
40 14 3
static expandNumber()
in src/number/numberFormatter.ts
53 14 3
parseNegativePattern = function()
in globalize/globalize.ts
37 13 3
export function getCustomFormatMetadata()
in src/formattingService/formattingService.ts
48 13 4
static format()
in src/date/dateFormatter.ts
37 12 3
yy: String()
in src/date/dateFormatter.ts
21 12 1
function toNonScientific()
in src/formattingService/formattingService.ts
44 11 2