apple / swift-collections
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 232 units with 1,603 lines of code in units (10.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (43 lines of code)
    • 2 simple units (33 lines of code)
    • 229 very simple units (1,527 lines of code)
0% | 0% | 2% | 2% | 95%
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% | 2% | 2% | 95%
cpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/_CollectionsTestSupport0% | 0% | 3% | 2% | 94%
Benchmarks/Benchmarks0% | 0% | 0% | 0% | 100%
Sources/OrderedCollections0% | 0% | 0% | 0% | 100%
Sources/DequeModule0% | 0% | 0% | 0% | 100%
Sources/PriorityQueueModule0% | 0% | 0% | 0% | 100%
Benchmarks/CppBenchmarks0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func _description()
in Sources/_CollectionsTestSupport/MinimalTypes/MinimalEncoder.swift
43 22 2
func isValidIndex()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
16 6 1
func replace()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
17 6 3
func value()
in Sources/_CollectionsTestSupport/MinimalTypes/MinimalSequence.swift
12 5 1
func insert()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
14 5 2
func remove()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
14 5 2
func _bucketContents()
in Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift
9 4 1
func kalimbaOrdered()
in Benchmarks/Benchmarks/Kalimba.swift
14 3 0
func kalimbaOrdered2()
in Benchmarks/Benchmarks/Kalimba.swift
14 3 0
func kalimbaOrdered3()
in Benchmarks/Benchmarks/Kalimba.swift
18 3 0
init()
in Sources/OrderedCollections/HashTable/_Hashtable+Header.swift
11 3 3
func replaceAll()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
10 3 0
func reset()
in Sources/_CollectionsTestSupport/MinimalTypes/_CollectionState.swift
11 3 1
func destroy()
in Benchmarks/Benchmarks/Cpp/CppDequeBenchmarks.swift
6 2 0
func destroy()
in Benchmarks/Benchmarks/Cpp/CppPriorityQueueBenchmarks.swift
6 2 0
func destroy()
in Benchmarks/Benchmarks/Cpp/CppUnorderedMapBenchmarks.swift
6 2 0
func destroy()
in Benchmarks/Benchmarks/Cpp/CppUnorderedSetBenchmarks.swift
6 2 0
func destroy()
in Benchmarks/Benchmarks/Cpp/CppVectorBenchmarks.swift
6 2 0
func destroy()
in Benchmarks/Benchmarks/Cpp/CppVectorBoolBenchmarks.swift
6 2 0
init()
in Benchmarks/Benchmarks/Cpp/CppVectorBoolBenchmarks.swift
6 2 2