microsoft / vscode
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 31,671 units with 388,904 lines of code in units (61.6% of code).
    • 25 very complex units (5,986 lines of code)
    • 162 complex units (17,618 lines of code)
    • 1,354 medium complex units (67,731 lines of code)
    • 3,037 simple units (76,825 lines of code)
    • 27,093 very simple units (220,744 lines of code)
1% | 4% | 17% | 19% | 56%
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% | 4% | 17% | 19% | 56%
js0% | 3% | 20% | 25% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/vs1% | 4% | 17% | 19% | 57%
extensions/html-language-features11% | 1% | 28% | 15% | 43%
extensions/emmet10% | 7% | 30% | 26% | 25%
extensions/json-language-features19% | 12% | 17% | 9% | 41%
extensions/git2% | 1% | 25% | 22% | 48%
build/lib0% | 2% | 21% | 31% | 44%
extensions/css-language-features0% | 25% | 5% | 20% | 49%
src0% | 34% | 18% | 7% | 39%
build/azure-pipelines0% | 11% | 0% | 25% | 63%
extensions/extension-editing0% | 27% | 25% | 0% | 46%
extensions/php-language-features0% | 14% | 23% | 22% | 40%
extensions/theme-seti0% | 17% | 14% | 9% | 57%
extensions/typescript-language-features0% | <1% | 12% | 22% | 64%
build0% | 0% | 42% | 19% | 38%
extensions/npm0% | 0% | 20% | 26% | 52%
extensions/configuration-editing0% | 0% | 40% | 6% | 52%
extensions/github0% | 0% | 60% | 0% | 39%
extensions/ipynb0% | 0% | 28% | 18% | 52%
extensions/search-result0% | 0% | 97% | 0% | 2%
extensions/microsoft-authentication0% | 0% | 20% | 41% | 37%
extensions/markdown-language-features0% | 0% | 5% | 17% | 77%
extensions/merge-conflict0% | 0% | 17% | 30% | 51%
build/npm0% | 0% | 37% | 52% | 9%
extensions/grunt0% | 0% | 24% | 23% | 51%
extensions/debug-auto-launch0% | 0% | 35% | 8% | 56%
extensions/jake0% | 0% | 22% | 25% | 52%
extensions/gulp0% | 0% | 18% | 31% | 50%
extensions/github-authentication0% | 0% | 6% | 30% | 62%
extensions/debug-server-ready0% | 0% | 19% | 34% | 46%
extensions/git-base0% | 0% | 8% | 38% | 52%
scripts0% | 0% | 0% | 75% | 24%
extensions/image-preview0% | 0% | 0% | 15% | 84%
build/builtin0% | 0% | 0% | 42% | 57%
extensions/php0% | 0% | 0% | 58% | 41%
extensions0% | 0% | 0% | 64% | 35%
extensions/typescript-basics0% | 0% | 0% | 30% | 69%
extensions/html0% | 0% | 0% | 56% | 44%
extensions/simple-browser0% | 0% | 0% | 0% | 100%
build/darwin0% | 0% | 0% | 0% | 100%
build/linux0% | 0% | 0% | 0% | 100%
extensions/markdown-math0% | 0% | 0% | 0% | 100%
extensions/json0% | 0% | 0% | 0% | 100%
build/monaco0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function startServer()
in extensions/html-language-features/server/src/htmlServer.ts
358 107 2
async function webviewPreloads()
in src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
579 102 1
private registerListeners()
in src/vs/workbench/contrib/debug/browser/debugSession.ts
252 81 0
private _myTokenize()
in src/vs/editor/standalone/common/monarch/monarchLexer.ts
229 75 5
private async computeAndUpdateStatus()
in src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
165 74 0
private _initialize()
in src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
301 72 1
export function isValidLocationForEmmetAbbreviation()
in extensions/emmet/src/abbreviationActions.ts
142 69 6
private async createShellLaunchConfig()
in src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
153 62 8
private shouldRunExperiment()
in src/vs/workbench/contrib/experiments/common/experimentService.ts
129 61 2
private async resolveWorkspaceTags()
in src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts
152 61 0
private provideCompletionItemsInternal()
in extensions/emmet/src/defaultCompletionProvider.ts
147 60 3
identifiers: overrideIdentifiersFromKey()
in src/vs/platform/configuration/common/configurationModels.ts
280 57 1
export function main()
in src/vs/server/node/server.cli.ts
180 57 2
export function startServer()
in extensions/json-language-features/server/src/jsonServer.ts
249 56 2
private async executeInTerminal()
in src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
228 56 4
export function fromNow()
in src/vs/base/common/date.ts
167 55 3
private addPane()
in src/vs/workbench/browser/parts/views/viewPaneContainer.ts
133 55 3
constructor()
in src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts
244 54 3
async show()
in src/vs/base/browser/ui/dialog/dialog.ts
172 53 0
private getGroupedTasks()
in src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
202 53 1