microsoft / vscode-css-languageservice
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 836 units with 8,426 lines of code in units (80.4% of code).
    • 1 very complex units (154 lines of code)
    • 3 complex units (232 lines of code)
    • 51 medium complex units (1,913 lines of code)
    • 98 simple units (1,918 lines of code)
    • 683 very simple units (4,209 lines of code)
1% | 2% | 22% | 22% | 49%
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% | 2% | 22% | 22% | 49%
js0% | 0% | 0% | 50% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/services4% | 2% | 25% | 19% | 47%
src/parser0% | 1% | 21% | 23% | 52%
src/languageFacts0% | 14% | 20% | 32% | 33%
src/utils0% | 0% | 0% | 33% | 66%
build0% | 0% | 0% | 50% | 50%
src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private visitRuleSet()
in src/services/lint.ts
154 57 1
export function getColorValue()
in src/languageFacts/colors.ts
66 31 1
public doComplete()
in src/services/cssCompletion.ts
83 29 4
protected scanNext()
in src/parser/cssScanner.ts
83 26 1
done: while()
in src/parser/cssParser.ts
58 25 1
export function toElement()
in src/services/selectorPrinting.ts
82 25 2
public _needsSemicolonAfter()
in src/parser/cssParser.ts
33 24 1
done: while()
in src/parser/cssParser.ts
60 23 1
function computeFoldingRanges()
in src/services/cssFolding.ts
92 23 1
public _parseForward()
in src/parser/scssParser.ts
52 22 0
public getCompletionsForDeclarationValue()
in src/services/cssCompletion.ts
70 19 2
69 19 1
public processSelector()
in src/services/selectorPrinting.ts
39 19 1
public _parseUse()
in src/parser/scssParser.ts
44 18 0
public _parseMediaFeature()
in src/parser/cssParser.ts
47 17 0
public _tryParseMixinReference()
in src/parser/lessParser.ts
51 17 1
public _parseRuleSetDeclaration()
in src/parser/scssParser.ts
21 17 0
48 16 1
private _escape()
in src/parser/cssScanner.ts
36 15 2
public visitNode()
in src/parser/cssSymbolScope.ts
44 15 1