dart-lang / json_rpc_2
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 33 units with 421 lines of code in units (60.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (50 lines of code)
    • 7 simple units (149 lines of code)
    • 25 very simple units (222 lines of code)
0% | 0% | 11% | 35% | 52%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
dart0% | 0% | 11% | 35% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src0% | 0% | 13% | 37% | 48%
lib0% | 0% | 0% | 100% | 0%
example0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void _validateRequest()
in lib/src/server.dart
50 15 1
bool _isResponseValid()
in lib/src/client.dart
14 10 1
Future _handleSingleRequest()
in lib/src/server.dart
39 9 1
void _send()
in lib/src/client.dart
16 9 3
Future listen()
in lib/src/peer.dart
27 9 0
Map serialize()
in lib/src/exception.dart
18 7 1
String? name()
in lib/error_code.dart
16 6 1
Future _handleRequest()
in lib/src/server.dart
19 6 1
Future _tryFallbacks()
in lib/src/server.dart
15 4 1
void _handleSingleResponse()
in lib/src/client.dart
14 4 1
String computePath()
in lib/src/parameters.dart
9 4 1
void tryFinally()
in lib/src/utils.dart
15 3 1
dynamic _getParsed()
in lib/src/parameters.dart
16 3 2
void main()
in example/main.dart
32 3 0
Future listen()
in lib/src/server.dart
9 2 0
Future close()
in lib/src/server.dart
5 2 0
void registerMethod()
in lib/src/server.dart
6 2 2
Future listen()
in lib/src/client.dart
10 2 0
Future close()
in lib/src/client.dart
5 2 0
void withBatch()
in lib/src/client.dart
8 2 1