apple / swift-nio-extras
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 104 units with 980 lines of code in units (26.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 2 simple units (35 lines of code)
    • 102 very simple units (945 lines of code)
0% | 0% | 0% | 3% | 96%
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% | 0% | 3% | 96%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/NIOHTTPCompression0% | 0% | 0% | 11% | 88%
Sources/NIOSOCKS0% | 0% | 0% | 5% | 94%
Sources/NIOExtras0% | 0% | 0% | 0% | 100%
Sources/NIOExtrasPerformanceTester0% | 0% | 0% | 0% | 100%
Sources/HTTPServerWithQuiescingDemo0% | 0% | 0% | 0% | 100%
Sources/NIOWritePartialPCAPDemo0% | 0% | 0% | 0% | 100%
Sources/NIOWritePCAPDemo0% | 0% | 0% | 0% | 100%
Sources/CNIOExtrasZlib0% | 0% | 0% | 0% | 100%
Sources/NIOSOCKSClient0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
mutating func flush()
in Sources/NIOHTTPCompression/HTTPResponseCompressor.swift
18 6 2
mutating func receiveBuffer()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
17 6 1
mutating func receiveBuffer()
in Sources/NIOSOCKS/State/ClientStateMachine.swift
21 5 1
mutating func sendAuthenticationData()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
20 5 2
func channelRead()
in Sources/HTTPServerWithQuiescingDemo/main.swift
29 4 2
func channelRead()
in Sources/NIOExtrasPerformanceTester/HTTP1PerformanceTestFramework.swift
13 4 2
func run()
in Sources/NIOExtrasPerformanceTester/HTTP1PerformanceTestFramework.swift
38 4 0
func exceeded()
in Sources/NIOHTTPCompression/HTTPDecompression.swift
10 4 2
mutating func readAddressType()
in Sources/NIOSOCKS/Messages/SOCKSRequest.swift
17 4 0
mutating func sendAuthenticationMethod()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
20 4 1
mutating func sendServerResponse()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
19 4 1
func channelRead()
in Sources/NIOWritePartialPCAPDemo/main.swift
9 4 2
mutating func get24UInt()
in Sources/NIOExtras/LengthFieldBasedFrameDecoder.swift
20 3 2
mutating func write24UInt()
in Sources/NIOExtras/LengthFieldPrepender.swift
14 3 2
func initiateShutdown()
in Sources/NIOExtras/QuiescingHelper.swift
16 3 1
func channelRead()
in Sources/NIOExtras/QuiescingHelper.swift
15 3 2
init()
in Sources/NIOExtras/WritePCAPHandler.swift
12 3 4
func emitWrites()
in Sources/NIOExtras/WritePCAPHandler.swift
20 3 0
mutating func writePCAPRecord()
in Sources/NIOExtras/WritePCAPHandler.swift
52 3 1
init()
in Sources/NIOExtrasPerformanceTester/HTTP1PerformanceTestFramework.swift
14 3 0