apple / swift-integration-tests
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 18 units with 201 lines of code in units (34.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (39 lines of code)
    • 0 simple units (0 lines of code)
    • 17 very simple units (162 lines of code)
0% | 0% | 19% | 0% | 80%
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% | 20% | 0% | 79%
c0% | 0% | 0% | 0% | 100%
swift0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
test-snapshot-binaries0% | 0% | 42% | 0% | 57%
test-sourcekit-lsp0% | 0% | 0% | 0% | 100%
repl0% | 0% | 0% | 0% | 100%
test-complex-xctest-package0% | 0% | 0% | 0% | 100%
test-lldb-with-swiftpm0% | 0% | 0% | 0% | 100%
test-xctest-package0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 18 most complex units
Unit# linesMcCabe index# params
def process_library()
in test-snapshot-binaries/linux_load_commands.py
39 11 2
def regex_string()
in test-snapshot-binaries/linux_load_commands.py
15 5 1
def next()
in test-snapshot-binaries/linux_load_commands.py
10 5 1
def main()
in test-snapshot-binaries/linux_load_commands.py
12 4 0
def __init__()
in test-snapshot-binaries/linux_load_commands.py
4 2 2
def main()
in test-sourcekit-lsp/test-sourcekit-lsp.py
68 2 0
def debug()
in repl/test-repl-darwin.py
9 1 1
int foo()
in test-complex-xctest-package/SwiftCMixed/Sources/see/see.c
3 1 0
func swiftyFoo()
in test-complex-xctest-package/SwiftCMixed/Sources/swifty/swifty.swift
3 1 0
int see()
in test-lldb-with-swiftpm/Sources/See/see.c
3 1 0
def regex()
in test-snapshot-binaries/linux_load_commands.py
2 1 1
def matches()
in test-snapshot-binaries/linux_load_commands.py
2 1 2
def get_libraries()
in test-snapshot-binaries/linux_load_commands.py
8 1 1
void clib_func()
in test-sourcekit-lsp/pkg/Sources/clib/clib.c
1 1 1
def __init__()
in test-sourcekit-lsp/test-sourcekit-lsp.py
3 1 1
def request()
in test-sourcekit-lsp/test-sourcekit-lsp.py
9 1 3
def note()
in test-sourcekit-lsp/test-sourcekit-lsp.py
7 1 3
func test_example()
in test-xctest-package/main.swift
3 1 0