dart-lang / shelf_static
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 10 units with 240 lines of code in units (58.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (61 lines of code)
    • 4 medium size units (133 lines of code)
    • 1 small units (14 lines of code)
    • 4 very small units (32 lines of code)
0% | 25% | 55% | 5% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 25% | 55% | 5% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 29% | 48% | 6% | 15%
example0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
Handler createStaticHandler()
in lib/src/static_handler.dart
61 15 6
Response listDirectory()
in lib/src/directory_listing.dart
39 8 2
Response? _fileRangeResponse()
in lib/src/static_handler.dart
38 12 3
void main()
in example/example.dart
34 5 1
Future _handleFile()
in lib/src/static_handler.dart
22 5 3
Handler createFileHandler()
in lib/src/static_handler.dart
14 5 3
Response _redirectToAddTrailingSlash()
in lib/src/static_handler.dart
10 1 1
String _getHeader()
in lib/src/directory_listing.dart
9 2 1
File? _tryDefaultFile()
in lib/src/static_handler.dart
9 3 2
DateTime toSecondResolution()
in lib/src/util.dart
4 2 1