microsoft / roosterjs
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 813 units with 10,987 lines of code in units (63.1% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (249 lines of code)
    • 62 medium complex units (2,396 lines of code)
    • 117 simple units (2,825 lines of code)
    • 631 very simple units (5,517 lines of code)
0% | 2% | 21% | 25% | 50%
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% | 2% | 22% | 26% | 48%
js0% | 0% | 9% | 19% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/roosterjs-editor-dom0% | 4% | 30% | 30% | 34%
packages/roosterjs-editor-plugins0% | 1% | 21% | 25% | 50%
packages/roosterjs-editor-api0% | 0% | 18% | 24% | 56%
packages/roosterjs-editor-core0% | 0% | 7% | 18% | 74%
tools/buildTools0% | 0% | 10% | 22% | 66%
tools0% | 0% | 0% | 0% | 100%
packages/roosterjs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
edit()
in packages/roosterjs-editor-dom/lib/table/VTable.ts
125 32 1
onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/ImageEdit.ts
62 27 1
function adjustInsertPositionForStructuredNode()
in packages/roosterjs-editor-dom/lib/edit/adjustInsertPosition.ts
62 26 4
public onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/HyperLink/HyperLink.ts
55 24 1
private processNode()
in packages/roosterjs-editor-dom/lib/htmlSanitizer/HtmlSanitizer.ts
61 23 3
private onKeyDownEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
57 22 1
function output()
in tools/buildTools/dts.js
71 21 4
export function getInlineElementBeforeAfter()
in packages/roosterjs-editor-dom/lib/inlineElements/getInlineElementBeforeAfter.ts
26 20 3
td: cloneNode()
in packages/roosterjs-editor-dom/lib/table/VTable.ts
37 19 2
private onKeyUpDomEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
74 18 1
export function highlight()
in packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/utils/highlight.ts
32 18 1
public onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
52 17 1
export default function applyInlineStyle()
in packages/roosterjs-editor-api/lib/utils/applyInlineStyle.ts
50 16 3
function cacheGetLinkData()
in packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/autoLinkFeatures.ts
32 16 2
onMouseMove()
in packages/roosterjs-editor-plugins/lib/plugins/TableResize/editors/TableEditor.ts
44 16 2
export default function applyTextStyle()
in packages/roosterjs-editor-dom/lib/inlineElements/applyTextStyle.ts
51 15 3
export default function createVListFromRegion()
in packages/roosterjs-editor-dom/lib/list/createVListFromRegion.ts
65 15 3
function areNodesValid()
in packages/roosterjs-editor-dom/lib/region/getRegionsFromRange.ts
20 15 4
function cacheGetNeighborEntityElement()
in packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts
49 15 5
function clearInlineFormat()
in packages/roosterjs-editor-api/lib/format/clearFormat.ts
56 14 1