apple / swift-corelibs-xctest
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 107 units with 730 lines of code in units (25.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (70 lines of code)
    • 1 simple units (14 lines of code)
    • 105 very simple units (646 lines of code)
0% | 0% | 9% | 1% | 88%
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
py0% | 0% | 31% | 0% | 68%
swift0% | 0% | 0% | 2% | 97%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 31% | 0% | 68%
Sources/XCTest/Public0% | 0% | 0% | 9% | 90%
Sources/XCTest/Private0% | 0% | 0% | 0% | 100%
Sources/XCTest/Public/Asynchronous0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def build()
in build_script.py
70 12 1
func failureDescription()
in Sources/XCTest/Public/XCTAssert.swift
14 6 1
func testSuiteDidFinish()
in Sources/XCTest/Private/PrintObserver.swift
16 5 1
def test()
in build_script.py
47 5 1
func cancelPrimitiveWait()
in Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
8 4 0
func handleErrorDuringSetUp()
in Sources/XCTest/Public/XCTestCase.swift
12 4 1
def symlink_force()
in build_script.py
11 4 2
func testCaseDidFinish()
in Sources/XCTest/Private/PrintObserver.swift
14 3 1
init?()
in Sources/XCTest/Private/TestFiltering.swift
13 3 1
func printTestList()
in Sources/XCTest/Private/TestListing.swift
9 3 0
func startManaging()
in Sources/XCTest/Private/WaiterManager.swift
21 3 2
func failureMessage()
in Sources/XCTest/Private/WallClockTimeMetric.swift
8 3 0
func runTeardownBlocks()
in Sources/XCTest/Public/XCTestCase.swift
9 3 0
func awaitUsingExpectation()
in Sources/XCTest/Public/XCTestCase.swift
18 3 1
6 3 2
def build()
in build_script.py
22 3 1
func findBundleTestSuite()
in Sources/XCTest/Private/TestListing.swift
7 2 0
func queue_handleWatchdogTimeout()
in Sources/XCTest/Private/WaiterManager.swift
13 2 1
init()
in Sources/XCTest/Private/XCTestCaseSuite.swift
9 2 1
func handleErrorDuringTearDown()
in Sources/XCTest/Public/XCTestCase.swift
5 2 1