microsoft / dtslint
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 135 units with 1,905 lines of code in units (71.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (129 lines of code)
    • 10 medium complex units (426 lines of code)
    • 30 simple units (602 lines of code)
    • 93 very simple units (748 lines of code)
0% | 6% | 22% | 31% | 39%
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% | 6% | 22% | 31% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 8% | 24% | 23% | 42%
src/rules0% | 5% | 20% | 37% | 36%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
71 31 2
function checkTag()
in src/rules/noRedundantJsdoc2Rule.ts
58 30 1
function removeTag()
in src/rules/noRedundantJsdoc2Rule.ts
52 25 2
42 16 2
async function main()
in src/index.ts
65 16 0
53 16 4
function walk()
in src/rules/npmNamingRule.ts
42 15 1
39 13 6
function matchReadonlyArray()
in src/rules/expectRule.ts
34 13 2
function walk()
in src/rules/expectRule.ts
47 12 5
function walk()
in src/rules/noPaddingRule.ts
27 12 1
function isJustNamespace()
in src/rules/exportJustNamespaceRule.ts
25 11 2
function getSoleUse()
in src/rules/noUnnecessaryGenericsRule.ts
27 10 3
function parseOptions()
in src/rules/npmNamingRule.ts
26 10 1
function tslintDisableOption()
in src/rules/npmNamingRule.ts
15 10 1
function walk()
in src/rules/strictExportDeclareModifiersRule.ts
18 10 1
function checkInExternalModule()
in src/rules/strictExportDeclareModifiersRule.ts
22 10 2
function walk()
in src/rules/noImportDefaultOfExportEqualsRule.ts
18 9 2
export function disabler()
in src/rules/npmNamingRule.ts
28 9 1
32 8 4