microsoft / rushstack
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 2,968 units with 46,334 lines of code in units (61.1% of code).
    • 1 very complex units (296 lines of code)
    • 21 complex units (2,951 lines of code)
    • 150 medium complex units (9,449 lines of code)
    • 301 simple units (9,888 lines of code)
    • 2,495 very simple units (23,750 lines of code)
<1% | 6% | 20% | 21% | 51%
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
ts<1% | 6% | 20% | 21% | 50%
js0% | 0% | 0% | 18% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
apps/api-extractor4% | 12% | 29% | 16% | 36%
apps/rush-lib0% | 7% | 18% | 23% | 50%
apps/api-documenter0% | 10% | 34% | 20% | 35%
libraries/node-core-library0% | 7% | 17% | 16% | 58%
libraries/heft-config-file0% | 45% | 0% | 12% | 41%
libraries/rushell0% | 23% | 0% | 13% | 63%
apps/heft0% | 0% | 15% | 24% | 59%
heft-plugins/heft-jest-plugin0% | 0% | 29% | 12% | 57%
apps/api-extractor-model0% | 0% | 16% | 8% | 74%
libraries/ts-command-line0% | 0% | 28% | 21% | 49%
eslint/eslint-plugin-packlets0% | 0% | 50% | 24% | 25%
heft-plugins/heft-webpack5-plugin0% | 0% | 45% | 28% | 25%
heft-plugins/heft-webpack4-plugin0% | 0% | 50% | 20% | 28%
repo-scripts/repo-toolbox0% | 0% | 64% | 0% | 35%
libraries/tree-pattern0% | 0% | 80% | 0% | 19%
rush-plugins/rush-amazon-s3-build-cache-plugin0% | 0% | 11% | 18% | 69%
rush-plugins/rush-litewatch-plugin0% | 0% | 21% | 19% | 59%
eslint/eslint-plugin0% | 0% | 25% | 47% | 27%
libraries/rig-package0% | 0% | 13% | 27% | 59%
libraries/load-themed-styles0% | 0% | 10% | 0% | 89%
libraries/debug-certificate-manager0% | 0% | 0% | 57% | 42%
libraries/package-deps-hash0% | 0% | 0% | 47% | 52%
common/scripts0% | 0% | 0% | 35% | 64%
rush-plugins/rush-azure-storage-build-cache-plugin0% | 0% | 0% | 47% | 52%
libraries/terminal0% | 0% | 0% | 28% | 71%
libraries/typings-generator0% | 0% | 0% | 42% | 57%
apps/rundown0% | 0% | 0% | 35% | 64%
heft-plugins/heft-storybook-plugin0% | 0% | 0% | 46% | 53%
apps/rush0% | 0% | 0% | 34% | 65%
libraries/stream-collator0% | 0% | 0% | 24% | 75%
eslint/eslint-config0% | 0% | 0% | 0% | 100%
heft-plugins/heft-sass-plugin0% | 0% | 0% | 0% | 100%
heft-plugins/heft-dev-cert-plugin0% | 0% | 0% | 0% | 100%
repo-scripts/doc-plugin-rush-stack0% | 0% | 0% | 0% | 100%
eslint/eslint-patch0% | 0% | 0% | 0% | 100%
repo-scripts/tombstone0% | 0% | 0% | 0% | 100%
libraries/rush-sdk0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static prepare()
in apps/api-extractor/src/api/ExtractorConfig.ts
296 56 1
private _writeApiItemPage()
in apps/api-documenter/src/documenters/MarkdownDocumenter.ts
186 47 1
public async prepareCommonTempAsync()
in apps/rush-lib/src/logic/installManager/RushInstallManager.ts
197 42 1
private constructor()
in apps/rush-lib/src/api/RushConfiguration.ts
199 40 2
private async _getNormalizedVersionSpec()
in apps/rush-lib/src/logic/PackageJsonUpdater.ts
169 39 6
private _generateYamlItem()
in apps/api-documenter/src/documenters/YamlDocumenter.ts
127 38 1
private static _modifySpan()
in apps/api-extractor/src/generators/DtsRollupGenerator.ts
142 38 5
private static _modifySpan()
in apps/api-extractor/src/generators/ApiReportGenerator.ts
130 34 5
private _serializeFormattableTextSegments()
in libraries/node-core-library/src/Terminal/Terminal.ts
169 34 1
private async _loadConfigurationFileInnerAsync()
in libraries/heft-config-file/src/ConfigurationFile.ts
177 33 4
private async _executeTaskAsync()
in apps/rush-lib/src/logic/taskExecution/ProjectTaskRunner.ts
195 32 1
private static _tryGetSgrFriendlyName()
in libraries/node-core-library/src/Terminal/AnsiEscape.ts
68 32 1
private _calculateApiItemMetadata()
in apps/api-extractor/src/collector/Collector.ts
136 31 1
public static generateReviewFileContent()
in apps/api-extractor/src/generators/ApiReportGenerator.ts
143 30 1
public static validate()
in apps/rush-lib/src/api/EnvironmentConfiguration.ts
105 30 1
protected async runAsync()
in apps/rush-lib/src/cli/actions/ScanAction.ts
133 30 0
private _analyzeChildTree()
in apps/api-extractor/src/analyzer/AstSymbolTable.ts
94 27 2
private static _generateTypingsFileContent()
in apps/api-extractor/src/generators/DtsRollupGenerator.ts
114 27 3
private _fetchAstSymbol()
in apps/api-extractor/src/analyzer/AstSymbolTable.ts
108 26 1
public async runAsync()
in apps/rush-lib/src/cli/actions/ChangeAction.ts
126 26 0