dart-lang / source_gen
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 41 units with 586 lines of code in units (42.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (131 lines of code)
    • 4 medium size units (135 lines of code)
    • 13 small units (184 lines of code)
    • 22 very small units (136 lines of code)
0% | 22% | 23% | 31% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 22% | 23% | 31% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source_gen/lib/src0% | 16% | 28% | 34% | 20%
source_gen/lib0% | 70% | 0% | 23% | 6%
example/lib/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Revivable reviveInstance()
in source_gen/lib/src/constants/revive.dart
77 19 2
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
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
Builder combiningBuilder()
in source_gen/lib/builder.dart
18 2 1
String toString()
in source_gen/lib/src/generator.dart
17 3 0
Iterable _annotationsWhere()
in source_gen/lib/src/type_checker.dart
16 4 2
String typeNameOf()
in source_gen/lib/src/utils.dart
16 5 1
void assertHasField()
in source_gen/lib/src/constants/utils.dart
16 3 2
FutureOr generate()
in source_gen/lib/src/generator_for_annotation.dart
15 3 2
Iterable annotatedWith()
in source_gen/lib/src/library.dart
14 3 3
Iterable annotatedWithExact()
in source_gen/lib/src/library.dart
14 3 3
DartObject? _computeConstantValue()
in source_gen/lib/src/type_checker.dart
12 3 4
bool isSuperOf()
in source_gen/lib/src/type_checker.dart
12 4 1
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? getFieldRecursive()
in source_gen/lib/src/constants/utils.dart
10 3 2