microsoft / tsdoc
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 566 units with 8,102 lines of code in units (40.2% of code).
    • 1 very complex units (196 lines of code)
    • 5 complex units (592 lines of code)
    • 26 medium complex units (1,801 lines of code)
    • 40 simple units (1,371 lines of code)
    • 494 very simple units (4,142 lines of code)
2% | 7% | 22% | 16% | 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
ts2% | 8% | 23% | 16% | 48%
tsx0% | 0% | 24% | 17% | 58%
js0% | 0% | 0% | 24% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tsdoc/src3% | 6% | 25% | 15% | 49%
playground/src0% | 14% | 18% | 16% | 51%
api-demo/src0% | 13% | 0% | 47% | 38%
tsdoc-config/src0% | 0% | 30% | 11% | 58%
common/scripts0% | 0% | 0% | 24% | 75%
eslint-plugin/src0% | 0% | 0% | 85% | 15%
spec/code-snippets0% | 0% | 0% | 0% | 100%
common/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private _parseDeclarationReference()
in tsdoc/src/parser/NodeParser.ts
196 52 3
private _renderNode()
in tsdoc/src/emitters/TSDocEmitter.ts
225 49 1
public static _getStylesForDocCommentInternal()
in playground/src/SyntaxStyler/DocNodeSyntaxStyler.ts
142 41 2
function tokenToString()
in tsdoc/src/beta/DeclarationReference.ts
70 34 1
function isDeclarationKind()
in api-demo/src/advancedDemo.ts
37 33 1
public static extract()
in tsdoc/src/parser/LineExtractor.ts
118 28 1
private _parseLinkTag()
in tsdoc/src/parser/NodeParser.ts
129 25 2
private scanEscapeSequence()
in tsdoc/src/beta/DeclarationReference.ts
59 24 0
private _parseFencedCode()
in tsdoc/src/parser/NodeParser.ts
189 24 1
public scan()
in tsdoc/src/beta/DeclarationReference.ts
44 17 0
private _parseInlineTag()
in tsdoc/src/parser/NodeParser.ts
147 17 1
public rescanMeaning()
in tsdoc/src/beta/DeclarationReference.ts
36 16 0
public parse()
in tsdoc/src/parser/NodeParser.ts
99 16 0
private tryParseMeaning()
in tsdoc/src/beta/DeclarationReference.ts
34 15 0
function isPunctuator()
in tsdoc/src/beta/DeclarationReference.ts
20 14 1
private _tryParseJSDocTypeOrValueRest()
in tsdoc/src/parser/NodeParser.ts
41 14 4
public static transform()
in tsdoc/src/transforms/TrimSpacesTransform.ts
71 14 1
function isHexDigit()
in tsdoc/src/beta/DeclarationReference.ts
19 13 1
public constructor()
in tsdoc/src/nodes/DocLinkTag.ts
60 13 1
private _parseMemberReference()
in tsdoc/src/parser/NodeParser.ts
94 13 4