dart-lang / source_span
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 51 units with 687 lines of code in units (56.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (198 lines of code)
    • 8 simple units (166 lines of code)
    • 39 very simple units (323 lines of code)
0% | 0% | 28% | 24% | 47%
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
dart0% | 0% | 28% | 24% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src0% | 0% | 28% | 24% | 47%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void _writeMultilineHighlights()
in lib/src/highlighter.dart
60 21 3
String highlight()
in lib/src/highlighter.dart
55 17 0
SourceSpan subspan()
in lib/src/span.dart
38 13 2
void _writeIndicator()
in lib/src/highlighter.dart
45 11 3
static List _collateLines()
in lib/src/highlighter.dart
41 9 1
int? findLineStart()
in lib/src/utils.dart
23 9 3
22 7 1
bool _isNearCachedLine()
in lib/src/file.dart
15 7 1
int getColumn()
in lib/src/file.dart
21 7 2
SourceSpan union()
in lib/src/file.dart
14 7 1
int getLine()
in lib/src/file.dart
13 6 1
int getOffset()
in lib/src/file.dart
17 6 2
SourceSpan union()
in lib/src/span_mixin.dart
16 5 1
void _colorize()
in lib/src/highlighter.dart
5 5 1
18 5 1
FileSpan subspan()
in lib/src/file.dart
5 5 2
FileSpan subspan()
in lib/src/file.dart
7 5 2
static bool _contiguous()
in lib/src/highlighter.dart
11 4 1
bool _isOnlyWhitespace()
in lib/src/highlighter.dart
6 4 1
15 4 1