apple / swift-corelibs-libdispatch
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 87 units with 995 lines of code in units (2.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (26 lines of code)
    • 7 simple units (177 lines of code)
    • 79 very simple units (792 lines of code)
0% | 0% | 2% | 17% | 79%
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
c0% | 0% | 3% | 22% | 73%
cpp0% | 0% | 0% | 39% | 60%
swift0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
d0% | 0% | 0% | 0% | 100%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 6% | 5% | 88%
src/BlocksRuntime0% | 0% | 0% | 40% | 59%
src/event0% | 0% | 0% | 68% | 31%
src/swift0% | 0% | 0% | 0% | 100%
private0% | 0% | 0% | 0% | 100%
src/shims0% | 0% | 0% | 0% | 100%
src/firehose0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
case DISPATCH_CONTINUATION_TYPE()
in src/introspection.c
26 11 1
void _Block_object_assign()
in src/BlocksRuntime/runtime.c
25 9 3
void _Block_object_dispose()
in src/BlocksRuntime/runtime.c
21 9 2
21 9 0
void _Block_release()
in src/BlocksRuntime/runtime.c
19 8 1
static void _Block_byref_assign_copy()
in src/BlocksRuntime/runtime.c
38 7 3
20 6 1
33 6 3
14 5 1
static bool latching_decr_int_now_zero()
in src/BlocksRuntime/runtime.c
15 5 1
register void()
in src/benchmark.c
36 5 1
19 5 1
case DISPATCH_CONTINUATION_TYPE()
in src/introspection.c
10 5 1
24 5 1
static int32_t latching_incr_int()
in src/BlocksRuntime/runtime.c
11 4 1
static void _Block_byref_release()
in src/BlocksRuntime/runtime.c
15 4 1
return os_atomic_rmw_loop2o()
in src/inline_internal.h
8 4 6
return os_atomic_rmw_loop2o()
in src/inline_internal.h
8 4 6
30 4 1
50 4 7