dart-lang / source_gen
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 41 units with 586 lines of code in units (42.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (77 lines of code)
    • 3 simple units (89 lines of code)
    • 37 very simple units (420 lines of code)
0% | 0% | 13% | 15% | 71%
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% | 13% | 15% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source_gen/lib/src0% | 0% | 16% | 18% | 65%
source_gen/lib0% | 0% | 0% | 0% | 100%
example/lib/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Revivable reviveInstance()
in source_gen/lib/src/constants/revive.dart
77 19 2
Uri pathToUrl()
in source_gen/lib/src/library.dart
37 10 1
SourceSpan spanForElement()
in source_gen/lib/src/span_for_element.dart
31 7 2
Stream normalizeGeneratorOutput()
in source_gen/lib/src/output_helpers.dart
21 7 1
Future build()
in source_gen/lib/builder.dart
54 5 1
static SourceSpan? _findSpan()
in source_gen/lib/src/type_checker.dart
46 5 2
String typeNameOf()
in source_gen/lib/src/utils.dart
16 5 1
Iterable _annotationsWhere()
in source_gen/lib/src/type_checker.dart
16 4 2
bool isSuperOf()
in source_gen/lib/src/type_checker.dart
12 4 1
static bool _isRelative()
in source_gen/lib/src/library.dart
8 4 2
Uri normalizeUrl()
in source_gen/lib/src/utils.dart
12 4 1
DartObject? firstAnnotationOf()
in source_gen/lib/src/type_checker.dart
11 3 3
DartObject? firstAnnotationOfExact()
in source_gen/lib/src/type_checker.dart
11 3 3
DartObject? _computeConstantValue()
in source_gen/lib/src/type_checker.dart
12 3 4
FutureOr generate()
in source_gen/lib/src/generator_for_annotation.dart
15 3 2
String toString()
in source_gen/lib/src/generator.dart
17 3 0
Iterable annotatedWith()
in source_gen/lib/src/library.dart
14 3 3
Iterable annotatedWithExact()
in source_gen/lib/src/library.dart
14 3 3
void assertHasField()
in source_gen/lib/src/constants/utils.dart
16 3 2
DartObject? getFieldRecursive()
in source_gen/lib/src/constants/utils.dart
10 3 2