microsoft / chart-parts
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 581 units with 13,595 lines of code in units (81.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (235 lines of code)
    • 2 medium complex units (72 lines of code)
    • 15 simple units (448 lines of code)
    • 563 very simple units (12,840 lines of code)
0% | 1% | <1% | 3% | 94%
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% | 1% | <1% | 2% | 94%
tsx0% | 0% | 0% | 7% | 92%
js0% | 0% | 0% | 20% | 79%
java0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/util-shapes0% | 47% | 0% | 14% | 37%
packages/util-transform0% | 0% | 7% | 7% | 84%
packages/processing-vsvg0% | 0% | 7% | 4% | 88%
packages/util-scales0% | 0% | 0% | 12% | 87%
packages/api-builder0% | 0% | 0% | <1% | 99%
packages/renderer-react-native-svg0% | 0% | 0% | 95% | 4%
packages/renderer-react-svg0% | 0% | 0% | 76% | 24%
packages/docs-site0% | 0% | 0% | 4% | 95%
packages/processing-scenegraph0% | 0% | 0% | 22% | 77%
packages/charts0% | 0% | 0% | 0% | 100%
packages/docs-examples0% | 0% | 0% | 0% | 100%
packages/docs-examples-mobile0% | 0% | 0% | 0% | 100%
packages/api-react0% | 0% | 0% | 0% | 100%
packages/processing-orchestrator0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function renderPath()
in packages/util-shapes/src/render.ts
235 30 5
public build()
in packages/util-transform/src/facade/bin.ts
40 12 2
export function commonProps()
in packages/processing-vsvg/src/element_renderers/util.ts
32 11 1
export function segments()
in packages/util-shapes/src/arc.ts
64 10 9
export function getContext()
in packages/api-builder/src/xform/axes/getContext.ts
36 9 3
function getBoundData()
in packages/api-builder/src/xform/marks/processMark.ts
28 9 2
function walk_examples()
in packages/docs-site/write_sample_boilerplate.js
28 8 3
protected createScale()
in packages/util-scales/src/discrete/BandScale.ts
33 8 1
function checkNode()
in packages/docs-site/src/util/processImagesInMarkdownAst.ts
14 7 1
export default function curves()
in packages/processing-vsvg/src/path/curves.ts
20 7 3
protected processDomainValues()
in packages/util-scales/src/quantitative/LogScale.ts
17 7 1
function initializeMark()
in packages/processing-scenegraph/src/parse.ts
23 6 1
function createElementFor()
in packages/renderer-react-native-svg/src/Renderer.ts
58 6 3
function createElementFor()
in packages/renderer-react-svg/src/Renderer.tsx
57 6 3
protected createScale()
in packages/util-scales/src/discrete/PointScale.ts
22 6 1
public constructor()
in packages/util-shapes/src/Rectangle.ts
7 6 5
public build()
in packages/util-transform/src/facade/countPattern.ts
19 6 2
public build()
in packages/util-transform/src/facade/density/densityBuilder.ts
22 6 3
function getGroupOrigin()
in packages/api-builder/src/xform/axes/buildAxis.ts
16 5 2
export function crossValue()
in packages/api-builder/src/xform/axes/components/domain/crossValue.ts
24 5 2