microsoft / powerbi-visuals-utils-chartutils
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 200 units with 3,355 lines of code in units (70.0% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (370 lines of code)
    • 13 medium complex units (730 lines of code)
    • 28 simple units (695 lines of code)
    • 155 very simple units (1,560 lines of code)
0% | 11% | 21% | 20% | 46%
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
ts0% | 11% | 21% | 20% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/axis0% | 20% | 21% | 17% | 41%
src/label0% | 13% | 6% | 22% | 57%
src/dataLabel0% | 10% | 19% | 28% | 41%
src/legend0% | 0% | 36% | 18% | 45%
src/legend/behavior0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
82 41 1
export function getLabelRect()
in src/label/dataLabelRectPositioner.ts
79 41 3
133 29 12
private calculateContentPositionFromPoint()
in src/dataLabel/dataLabelManager.ts
76 29 4
export function createAxis()
in src/axis/axis.ts
89 23 1
export function isValidLabelOverflowing()
in src/label/dataLabelRectPositioner.ts
37 18 3
public drawLegendInternal()
in src/legend/svgLegend.ts
144 18 3
private calculateVerticalLayout()
in src/legend/svgLegend.ts
79 17 4
export function enumerateDataLabels()
in src/dataLabel/dataLabelUtils.ts
48 16 1
31 14 3
24 13 2
private calculateViewport()
in src/legend/svgLegend.ts
25 13 0
22 12 3
export function rotate()
in src/axis/labelLayoutStrategy.ts
63 12 4
constructor()
in src/dataLabel/dataLabelArrangeGrid.ts
60 12 3
33 12 2
75 11 5
export function getLabelRect()
in src/label/dataLabelPointPositioner.ts
32 10 4
export function update()
in src/legend/legendData.ts
26 10 2
21 9 1