apple / swift-xcode-playground-support
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 494 units with 4,490 lines of code in units (57.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (223 lines of code)
    • 5 medium complex units (294 lines of code)
    • 11 simple units (351 lines of code)
    • 476 very simple units (3,622 lines of code)
0% | 4% | 6% | 7% | 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
swift0% | 5% | 6% | 6% | 82%
py0% | 0% | 12% | 26% | 60%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
PlaygroundLogger/PlaygroundLogger0% | 15% | 0% | 2% | 81%
Legacy/PlaygroundLogger0% | 5% | 6% | 10% | 78%
PlaygroundLogger/PlaygroundLoggerTests0% | 0% | 10% | 7% | 82%
PlaygroundSupport/XCPlaygroundTests0% | 0% | 0% | 0% | 100%
PlaygroundSupport/PlaygroundSupportTests0% | 0% | 0% | 0% | 100%
PlaygroundSupport/XCPlayground0% | 0% | 0% | 0% | 100%
PlaygroundLogger/PlaygroundLoggerTestHost_iOS0% | 0% | 0% | 0% | 100%
PlaygroundLogger/PlaygroundLoggerTestHost_tvOS0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func opaqueRepresentation()
in PlaygroundLogger/PlaygroundLogger/LegacySupport/PlaygroundQuickLook+OpaqueRepresentationSupport.swift
112 29 0
func encode()
in Legacy/PlaygroundLogger/PlaygroundLogger/QuickLookEncoder.swift
111 27 0
def parse()
in Legacy/PlaygroundLogger/build.py
39 13 2
func testMaximumDepthLimitTwoWithSuperclasses()
in PlaygroundLogger/PlaygroundLoggerTests/LogPolicyTests.swift
131 13 0
func CGColorSpaceCopyName()
in Legacy/PlaygroundLogger/PlaygroundLogger/ExtensionCGColorRef.swift
64 11 1
func doTest()
in Legacy/PlaygroundLogger/PlaygroundLogger/TestCases.swift
27 11 0
func testBaseClassLogging()
in PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift
33 11 0
func encode()
in Legacy/PlaygroundLogger/PlaygroundLogger/PlaygroundObjectWriter.swift
36 8 3
func toString()
in Legacy/PlaygroundLogger/PlaygroundLogger/TestInfrastructure.swift
10 7 0
func testContainerChildPolicyHeadTail()
in PlaygroundLogger/PlaygroundLoggerTests/LogPolicyTests.swift
48 7 0
func isValid()
in Legacy/PlaygroundLogger/PlaygroundLogger/ExtensionCGColorRef.swift
13 6 0
func getSummaries()
in Legacy/PlaygroundLogger/PlaygroundLogger/LoggerMirror.swift
17 6 0
func encode()
in Legacy/PlaygroundLogger/PlaygroundLogger/PlaygroundObjectWriter.swift
38 6 2
func encode()
in Legacy/PlaygroundLogger/PlaygroundLogger/PlaygroundObjectWriter.swift
22 6 3
def main()
in Legacy/PlaygroundLogger/build.py
82 6 0
func opaqueRepresentation()
in PlaygroundLogger/PlaygroundLogger/CustomLoggable/Foundation/NSNumber+CustomOpaqueLoggable.swift
16 6 0
func testLargeSet()
in PlaygroundLogger/PlaygroundLoggerTests/LogEntryTests.swift
27 6 0
func testAggregateChildPolicyHeadTail()
in PlaygroundLogger/PlaygroundLoggerTests/LogPolicyTests.swift
42 6 0
func JPEGRepresentation()
in Legacy/PlaygroundLogger/PlaygroundLogger/ImageHandler.swift
13 5 2
func PNGRepresentation()
in Legacy/PlaygroundLogger/PlaygroundLogger/ImageHandler.swift
13 5 1