apple / swift-nio-transport-services
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 29 units with 337 lines of code in units (15.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (123 lines of code)
    • 0 simple units (0 lines of code)
    • 26 very simple units (214 lines of code)
0% | 0% | 36% | 0% | 63%
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% | 36% | 0% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/NIOTransportServices0% | 0% | 40% | 0% | 59%
Sources/NIOTSHTTPClient0% | 0% | 0% | 0% | 100%
Sources/NIOTSHTTPServer0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func valueFor()
in Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift
30 19 1
func getOption0()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
63 17 1
func applyChannelOption()
in Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift
30 13 2
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 5 1
mutating func closeOutput()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 5 0
func channelRead()
in Sources/NIOTSHTTPClient/main.swift
12 4 2
mutating func closeInput()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
10 4 0
mutating func newPort()
in Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift
14 4 1
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
8 3 1
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
8 3 1
func completionCallback()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 3 2
func channelRead()
in Sources/NIOTSHTTPServer/main.swift
10 2 2
func completionCallback()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
9 2 1
func channelRead()
in Sources/NIOTransportServices/NIOTSListenerBootstrap.swift
15 2 2
func channelActive()
in Sources/NIOTSHTTPClient/main.swift
8 1 1
init()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
4 1 2
init()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
3 1 0
func execute()
in Sources/NIOTransportServices/NIOTSEventLoop.swift
5 1 2
func scheduleTask()
in Sources/NIOTransportServices/NIOTSEventLoop.swift
4 1 3
func setupChildChannel()
in Sources/NIOTransportServices/NIOTSListenerBootstrap.swift
6 1 0