microsoft / monaco-editor
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 407 units with 7,387 lines of code in units (17.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 14 medium complex units (797 lines of code)
    • 31 simple units (1,208 lines of code)
    • 362 very simple units (5,382 lines of code)
0% | 0% | 10% | 16% | 72%
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% | 0% | 17% | 15% | 66%
js0% | 0% | 3% | 17% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/common0% | 0% | 25% | 19% | 55%
src/json0% | 0% | 40% | 6% | 53%
build0% | 0% | 8% | 34% | 56%
src/css0% | 0% | 22% | 8% | 68%
src/typescript0% | 0% | 5% | 24% | 70%
src/html0% | 0% | 19% | 0% | 80%
website/playground0% | 0% | 0% | 11% | 88%
website/index0% | 0% | 0% | 22% | 77%
website/monarch0% | 0% | 0% | 10% | 89%
src/basic-languages0% | 0% | 0% | 0% | 100%
webpack-plugin/src0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
build/fillers0% | 0% | 0% | 0% | 100%
build/npm0% | 0% | 0% | 0% | 100%
src/fillers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function tokenize()
in src/json/tokenization.ts
113 24 4
kind: toSymbolKind()
in src/common/lspLanguageFeatures.ts
66 20 1
range: toRange()
in src/common/lspLanguageFeatures.ts
65 20 1
function toCompletionItemKind()
in src/common/lspLanguageFeatures.ts
42 19 1
function fromCompletionItemKind()
in src/common/lspLanguageFeatures.ts
42 19 1
function toSymbolKind()
in src/common/lspLanguageFeatures.ts
42 19 1
private static convertKind()
in src/typescript/languageFeatures.ts
31 18 1
function escapeText()
in build/importTypescript.js
56 12 1
function ESM_releasePlugin()
in build/release.js
51 12 2
function registerProviders()
in src/css/cssMode.ts
83 12 0
function registerProviders()
in src/html/htmlMode.ts
72 11 0
function registerProviders()
in src/json/jsonMode.ts
71 11 0
function normalizePath()
in src/json/jsonWorker.ts
19 11 1
private async _doValidate()
in src/typescript/languageFeatures.ts
44 11 1
function toExternalDTS()
in build/release.js
35 10 1
function getFeatures()
in build/releaseMetadata.js
59 10 0
range: toRange()
in src/common/lspLanguageFeatures.ts
115 10 1
function load()
in website/playground/playground.js
79 10 0
function checkSamples()
in build/website.js
35 9 0
public static equals()
in src/json/tokenization.ts
19 9 2