dart-lang / mime
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 19 units with 308 lines of code in units (20.0% of code).
    • 1 very long units (181 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 3 small units (47 lines of code)
    • 15 very small units (80 lines of code)
58% | 0% | 0% | 15% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart58% | 0% | 0% | 15% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src59% | 0% | 0% | 15% | 24%
example0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 19 longest units
Unit# linesMcCabe index# params
void _parse()
in lib/src/bound_multipart_stream.dart
181 47 0
String? lookup()
in lib/src/mime_type.dart
19 8 2
void _tryPropagateControllerState()
in lib/src/bound_multipart_stream.dart
17 7 0
bool matches()
in lib/src/magic_number.dart
11 6 1
Uint8List _getBoundary()
in lib/src/mime_multipart_transformer.dart
10 1 1
String extensionFromMime()
in lib/src/mime_type.dart
9 3 1
void addMagicNumber()
in lib/src/mime_type.dart
9 4 3
static String? _matchMagic()
in lib/src/mime_type.dart
7 3 2
int _toLowerCase()
in lib/src/bound_multipart_stream.dart
6 3 1
void _expectByteValue()
in lib/src/bound_multipart_stream.dart
5 2 2
void _expectWhitespace()
in lib/src/bound_multipart_stream.dart
5 3 1
void Function()
in lib/src/bound_multipart_stream.dart
5 1 1
void _resumeStream()
in lib/src/bound_multipart_stream.dart
5 1 0
static String _ext()
in lib/src/mime_type.dart
5 2 1
void main()
in example/example.dart
5 1 0
void _pauseStream()
in lib/src/bound_multipart_stream.dart
4 1 0
void addExtension()
in lib/src/mime_type.dart
3 1 2
String? lookupMimeType()
in lib/src/mime_type.dart
1 1 2
const MagicNumber()
in lib/src/magic_number.dart
1 1 3