apple / swift-collections-benchmark
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 97 units with 965 lines of code in units (14.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (283 lines of code)
    • 4 simple units (94 lines of code)
    • 90 very simple units (588 lines of code)
0% | 0% | 29% | 9% | 60%
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
swift0% | 0% | 29% | 9% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/CollectionsBenchmark/BenchmarkCLI0% | 0% | 64% | 8% | 27%
Sources/CollectionsBenchmark/Benchmark0% | 0% | 0% | 36% | 63%
Sources/CollectionsBenchmark/Charts/Graphics0% | 0% | 0% | 22% | 77%
Sources/CollectionsBenchmark/Utilities0% | 0% | 0% | 0% | 100%
Sources/CollectionsBenchmark/Charts0% | 0% | 0% | 0% | 100%
Sources/CollectionsBenchmark/Basics0% | 0% | 0% | 0% | 100%
Sources/CollectionsBenchmark/Charts/Renderers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Results+Compare.swift
133 16 0
mutating func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/_Document.swift
68 16 2
func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Library+Render.swift
82 11 1
func markdown()
in Sources/CollectionsBenchmark/Benchmark/Benchmark+ChartLibrary.swift
37 6 1
func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Results+ListTasks.swift
22 6 0
mutating func merge()
in Sources/CollectionsBenchmark/BenchmarkCLI/_Document.swift
14 6 2
func _svgString()
in Sources/CollectionsBenchmark/Charts/Graphics/Graphics+SVG.swift
21 6 0
init?()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Results+Compare.swift
30 5 2
func curve()
in Sources/CollectionsBenchmark/Basics/TaskResults.swift
14 4 3
func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Library+List.swift
10 3 1
func needsThinning()
in Sources/CollectionsBenchmark/Charts/Chart.swift
10 3 1
func renderText()
in Sources/CollectionsBenchmark/Charts/Graphics/Graphics+SVG.swift
17 3 1
mutating func removeAll()
in Sources/CollectionsBenchmark/Utilities/_SimpleOrderedDictionary.swift
10 3 1
func _customLastIndexOfEquatableElement()
in Sources/CollectionsBenchmark/Utilities/_SimpleSortedBag.swift
5 3 1
func _checkInvariants()
in Sources/CollectionsBenchmark/Utilities/_SimpleSortedDictionary.swift
7 3 0
func _links()
in Sources/CollectionsBenchmark/Benchmark/Benchmark+Links.swift
8 2 2
func run()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Render.swift
26 2 0
func filename()
in Sources/CollectionsBenchmark/BenchmarkCLI/BenchmarkCLI+Results+Compare.swift
4 2 3
func sizeScale()
in Sources/CollectionsBenchmark/Charts/Chart+Options.swift
12 2 2
func timeScale()
in Sources/CollectionsBenchmark/Charts/Chart+Options.swift
14 2 2