apple / swift-cmark
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 267 units with 19,167 lines of code in units (66.8% of code).
    • 20 very complex units (14,081 lines of code)
    • 11 complex units (1,267 lines of code)
    • 16 medium complex units (753 lines of code)
    • 31 simple units (806 lines of code)
    • 189 very simple units (2,260 lines of code)
73% | 6% | 3% | 4% | 11%
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
c74% | 6% | 3% | 4% | 10%
py0% | 0% | 0% | 33% | 66%
re0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src77% | 7% | 4% | 4% | 6%
bench0% | 0% | 0% | 36% | 63%
api_test0% | 0% | 0% | 3% | 96%
wrappers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
3392 1144 1
1689 556 1
1690 359 1
bufsize_t _scan_entity()
in src/scanners.c
895 323 1
838 312 1
bufsize_t _scan_scheme()
in src/scanners.c
721 286 1
876 286 1
62 225 1
615 182 1
591 173 1
360 106 1
360 106 1
325 94 1
311 89 1
static int S_render_node()
in src/commonmark.c
267 85 4
323 85 1
271 73 1
248 61 4
202 56 4
45 55 4