dart-lang / samples
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 49 units with 469 lines of code in units (42.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 1 simple units (15 lines of code)
    • 48 very simple units (454 lines of code)
0% | 0% | 0% | 3% | 96%
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% | 0% | 3% | 96%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
null_safety/calculate_lix0% | 0% | 0% | 57% | 42%
command_line/lib0% | 0% | 0% | 0% | 100%
ffi/primitives0% | 0% | 0% | 0% | 100%
ffi/structs0% | 0% | 0% | 0% | 100%
server/google_apis0% | 0% | 0% | 0% | 100%
ffi/system-command0% | 0% | 0% | 0% | 100%
extension_methods/example0% | 0% | 0% | 0% | 100%
ffi/hello_world0% | 0% | 0% | 0% | 100%
extension_methods/lib0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
String describe()
in null_safety/calculate_lix/lib/lix.dart
15 7 0
Stream _fetchUserStatsImpl()
in command_line/lib/github_activity.dart
12 5 0
Future terminateRequestFuture()
in server/google_apis/lib/helpers.dart
23 4 0
Future currentProjectId()
in server/google_apis/lib/helpers.dart
31 4 0
bool isTooOld()
in command_line/lib/src/util.dart
13 4 2
int _calculate()
in null_safety/calculate_lix/lib/lix.dart
11 3 0
Stream getActivityStrings()
in command_line/lib/github_activity.dart
10 3 0
String? getUrl()
in command_line/lib/src/util.dart
10 3 1
String? getTitle()
in command_line/lib/src/util.dart
10 3 1
int? getIssueNumber()
in command_line/lib/src/util.dart
10 3 1
void main()
in ffi/primitives/primitives.dart
37 3 0
void main()
in ffi/structs/structs.dart
42 3 0
void main()
in ffi/hello_world/hello.dart
17 3 0
void times()
in extension_methods/example/core_type_extensions.dart
5 2 1
void main()
in extension_methods/example/operator_extensions.dart
9 2 0
String format()
in command_line/lib/src/formatter.dart
11 2 1
String format()
in command_line/lib/src/formatter.dart
13 2 1
int multi_sum()
in ffi/primitives/primitives_library/primitives.c
12 2 2
Future serveHandler()
in server/google_apis/lib/helpers.dart
11 1 1
void main()
in extension_methods/lib/privacy_source.dart
5 1 0