dart-lang / source_span
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 51 units with 687 lines of code in units (56.6% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (115 lines of code)
    • 6 medium size units (190 lines of code)
    • 16 small units (227 lines of code)
    • 27 very small units (155 lines of code)
0% | 16% | 27% | 33% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 16% | 27% | 33% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 16% | 27% | 33% | 22%
Alternative Visuals
Longest Units
Top 20 longest 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
void _writeIndicator()
in lib/src/highlighter.dart
45 11 3
static List _collateLines()
in lib/src/highlighter.dart
41 9 1
SourceSpan subspan()
in lib/src/span.dart
38 13 2
int? findLineStart()
in lib/src/utils.dart
23 9 3
22 7 1
int getColumn()
in lib/src/file.dart
21 7 2
18 5 1
int getOffset()
in lib/src/file.dart
17 6 2
String toString()
in lib/src/span_exception.dart
17 4 2
SourceSpan union()
in lib/src/span_mixin.dart
16 5 1
15 4 1
bool _isNearCachedLine()
in lib/src/file.dart
15 7 1
FileSpan expand()
in lib/src/file.dart
15 3 1
String messageMultiple()
in lib/src/span.dart
14 2 6
void _writeUnderline()
in lib/src/highlighter.dart
14 1 3
SourceSpan union()
in lib/src/file.dart
14 7 1
String message()
in lib/src/span_mixin.dart
13 3 2
int getLine()
in lib/src/file.dart
13 6 1