dart-lang / csslib
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 522 units with 5,279 lines of code in units (63.7% of code).
    • 2 very complex units (343 lines of code)
    • 6 complex units (505 lines of code)
    • 15 medium complex units (683 lines of code)
    • 45 simple units (1,051 lines of code)
    • 454 very simple units (2,697 lines of code)
6% | 9% | 12% | 19% | 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
dart6% | 9% | 12% | 19% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src5% | 3% | 5% | 20% | 64%
lib8% | 18% | 24% | 17% | 31%
example0% | 0% | 0% | 93% | 6%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Token next()
in lib/src/tokenizer.dart
172 76 1
171 57 0
101 45 3
dynamic processTerm()
in lib/parser.dart
148 45 1
static String kindToString()
in lib/src/token_kind.dart
76 36 1
static bool isKindIdentifier()
in lib/src/token_kind.dart
39 33 1
76 29 3
65 28 0
40 20 2
79 19 0
static String? _convertCssToArgb()
in lib/src/property.dart
47 17 1
int readEscapeSequence()
in lib/src/tokenizer_base.dart
43 15 0
Token finishIdentifier()
in lib/src/tokenizer.dart
38 15 0
42 15 1
52 15 1
static void template()
in lib/src/validate.dart
51 14 1
39 14 0
43 14 1
Expressions processExpr()
in lib/parser.dart
52 14 1
HexColorTerm _parseHex()
in lib/parser.dart
24 12 2