dart-lang / shelf
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 44 units with 534 lines of code in units (44.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (60 lines of code)
    • 7 medium size units (194 lines of code)
    • 10 small units (135 lines of code)
    • 26 very small units (145 lines of code)
0% | 11% | 36% | 25% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 11% | 36% | 25% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 37% | 46% | 6% | 9%
lib/src0% | 0% | 35% | 33% | 31%
lib/src/middleware0% | 0% | 0% | 40% | 60%
example0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Future handleRequest()
in lib/shelf_io.dart
60 10 2
Uri _computeUrl()
in lib/src/request.dart
38 14 3
factory Body()
in lib/src/body.dart
34 10 2
Future _writeResponse()
in lib/shelf_io.dart
33 11 2
Middleware createMiddleware()
in lib/src/middleware.dart
24 4 1
String _computeHandlerPath()
in lib/src/request.dart
23 9 3
Future serve()
in lib/shelf_io.dart
21 2 7
Request _fromHttpRequest()
in lib/shelf_io.dart
21 1 1
Request change()
in lib/src/request.dart
19 2 5
factory ShelfUnmodifiableMap()
in lib/src/shelf_unmodifiable_map.dart
18 7 3
Response change()
in lib/src/response.dart
15 1 4
void Function()
in lib/src/request.dart
13 2 1
Map updateMap()
in lib/src/util.dart
13 5 2
String _errorMessage()
in lib/src/middleware/logger.dart
12 3 6
String? findHeader()
in lib/src/util.dart
12 5 2
List expandHeaderValue()
in lib/src/util.dart
11 4 1
Map _adjustErrorHeaders()
in lib/src/response.dart
11 3 1
Response _logError()
in lib/shelf_io.dart
11 2 3
Map addHeader()
in lib/src/util.dart
9 2 3
void catchTopLevelErrors()
in lib/src/util.dart
8 2 1