dart-lang / json_rpc_2
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 33 units with 421 lines of code in units (60.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (148 lines of code)
    • 10 small units (158 lines of code)
    • 19 very small units (115 lines of code)
0% | 0% | 35% | 37% | 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% | 0% | 35% | 37% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src0% | 0% | 32% | 35% | 32%
example0% | 0% | 68% | 31% | 0%
lib0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void _validateRequest()
in lib/src/server.dart
50 15 1
Future _handleSingleRequest()
in lib/src/server.dart
39 9 1
void main()
in example/main.dart
32 3 0
Future listen()
in lib/src/peer.dart
27 9 0
Future _handleRequest()
in lib/src/server.dart
19 6 1
Map serialize()
in lib/src/exception.dart
18 7 1
String? name()
in lib/error_code.dart
16 6 1
void _send()
in lib/src/client.dart
16 9 3
dynamic _getParsed()
in lib/src/parameters.dart
16 3 2
Future _tryFallbacks()
in lib/src/server.dart
15 4 1
void tryFinally()
in lib/src/utils.dart
15 3 1
void main()
in example/client.dart
15 2 0
void _handleSingleResponse()
in lib/src/client.dart
14 4 1
bool _isResponseValid()
in lib/src/client.dart
14 10 1
Future listen()
in lib/src/client.dart
10 2 0
StreamChannel bind()
in lib/src/utils.dart
10 1 1
Future listen()
in lib/src/server.dart
9 2 0
String computePath()
in lib/src/parameters.dart
9 4 1
void withBatch()
in lib/src/client.dart
8 2 1
Future sendRequest()
in lib/src/client.dart
7 1 2