apple / swift-stress-tester
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 119 units with 1,200 lines of code in units (18.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (203 lines of code)
    • 3 simple units (91 lines of code)
    • 113 very simple units (906 lines of code)
0% | 0% | 16% | 7% | 75%
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% | 20% | 1% | 78%
py0% | 0% | 0% | 38% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
SourceKitStressTester/Sources/SwiftCWrapper0% | 0% | 73% | 3% | 22%
ROOT0% | 0% | 0% | 41% | 58%
SwiftEvolve/Sources/SwiftEvolve0% | 0% | 0% | 0% | 100%
SourceKitStressTester/Sources/StressTester0% | 0% | 0% | 0% | 100%
SourceKitStressTester0% | 0% | 0% | 0% | 100%
SourceKitStressTester/Sources/Common0% | 0% | 0% | 0% | 100%
SourceKitStressTester/Utilities0% | 0% | 0% | 0% | 100%
SourceKitStressTester/Sources/SwiftSourceKit0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
init()
in SourceKitStressTester/Sources/SwiftCWrapper/ExpectedIssue.swift
73 18 3
func enabledFor()
in SourceKitStressTester/Sources/SwiftCWrapper/ExpectedIssue.swift
36 18 1
func run()
in SourceKitStressTester/Sources/SwiftCWrapper/SwiftCWrapper.swift
94 18 0
def run()
in build-script-helper.py
62 8 1
mutating func complete()
in SourceKitStressTester/Sources/SwiftCWrapper/SwiftCWrapper.swift
11 7 3
def install_package()
in build-script-helper.py
18 6 6
func cursorInfo()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
30 5 1
def parse_args()
in build-script-helper.py
24 5 1
func getConfigParam()
in SourceKitStressTester/Package.swift
21 4 1
func write()
in SwiftEvolve/Sources/SwiftEvolve/SyntaxDump.swift
25 4 3
def invoke_swift_single_product()
in build-script-helper.py
10 4 9
def get_products()
in build-script-helper.py
7 4 1
func rangeInfo()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
22 3 2
func conformingMethodList()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
17 3 2
init()
in SourceKitStressTester/Sources/SwiftCWrapper/SwiftCWrapperTool.swift
10 3 2
func lookupDirect()
in SwiftEvolve/Sources/SwiftEvolve/DeclContext.swift
9 3 1
func lookupDirect()
in SwiftEvolve/Sources/SwiftEvolve/DeclContext.swift
10 3 1
func write()
in SwiftEvolve/Sources/SwiftEvolve/DeclContext.swift
10 3 1
func contains()
in SwiftEvolve/Sources/SwiftEvolve/DeclContext.swift
11 3 1
func makeAll()
in SwiftEvolve/Sources/SwiftEvolve/EvolutionRules.swift
14 3 3