dart-lang / source_maps
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 47 units with 498 lines of code in units (53.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (208 lines of code)
    • 10 small units (159 lines of code)
    • 30 very small units (131 lines of code)
0% | 0% | 41% | 31% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 0% | 41% | 31% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 0% | 37% | 32% | 29%
lib/src0% | 0% | 71% | 25% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Map toJson()
in lib/parser.dart
46 10 1
NestedPrinter commit()
in lib/refactor.dart
34 5 0
SourceMapSpan? spanFor()
in lib/parser.dart
33 7 4
void add()
in lib/printer.dart
28 9 2
int decodeVlq()
in lib/src/vlq.dart
25 6 1
Iterable encodeVlq()
in lib/src/vlq.dart
21 5 1
SourceMapSpan? spanFor()
in lib/parser.dart
21 4 4
String guessIndent()
in lib/refactor.dart
19 7 2
void writeTo()
in lib/printer.dart
18 7 1
Mapping parseJson()
in lib/parser.dart
18 6 3
int binarySearch()
in lib/src/utils.dart
16 6 2
String toString()
in lib/parser.dart
16 4 0
void add()
in lib/printer.dart
15 10 4
String toString()
in lib/parser.dart
15 2 0
String toString()
in lib/parser.dart
15 1 0
void addLine()
in lib/printer.dart
14 8 3
void mark()
in lib/printer.dart
13 5 1
int compareTo()
in lib/builder.dart
9 3 1
Mapping parseJsonExtended()
in lib/parser.dart
7 2 3
int _indexFor()
in lib/parser.dart
7 5 2