dart-lang / code_builder
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 24 units with 629 lines of code in units (64.6% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (178 lines of code)
    • 8 medium size units (291 lines of code)
    • 8 small units (118 lines of code)
    • 6 very small units (42 lines of code)
0% | 28% | 46% | 18% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 28% | 46% | 18% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 30% | 49% | 14% | 4%
example0% | 0% | 0% | 69% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
StringSink visitMethod()
in lib/src/emitter.dart
91 24 2
StringSink visitConstructor()
in lib/src/emitter.dart
87 21 3
StringSink visitClass()
in lib/src/emitter.dart
46 10 2
StringSink visitFunctionType()
in lib/src/emitter.dart
45 10 2
StringSink visitField()
in lib/src/emitter.dart
39 10 2
StringSink visitDirective()
in lib/src/emitter.dart
35 9 2
StringSink visitLibrary()
in lib/src/emitter.dart
34 10 2
StringSink visitMixin()
in lib/src/emitter.dart
33 7 2
StringSink visitExtension()
in lib/src/emitter.dart
30 7 2
void _visitParameter()
in lib/src/emitter.dart
29 8 5
StringSink visitEnum()
in lib/src/emitter.dart
20 5 2
String jsonEnum()
in example/example.dart
18 1 0
StringSink visitAll()
in lib/src/emitter.dart
17 3 3
Description describeMismatch()
in lib/src/matchers.dart
14 1 4
String scopedLibrary()
in example/example.dart
14 1 0
StringSink visitType()
in lib/src/emitter.dart
13 4 2
StringSink visitTypeParameters()
in lib/src/emitter.dart
11 2 2
bool _newLineBetween()
in lib/src/emitter.dart
11 5 3
String animalClass()
in example/example.dart
9 1 0
String allocate()
in lib/src/allocator.dart
8 3 1