apple / swift-nio-ssh
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 387 units with 4,514 lines of code in units (45.9% of code).
    • 2 very complex units (690 lines of code)
    • 2 complex units (240 lines of code)
    • 7 medium complex units (355 lines of code)
    • 27 simple units (575 lines of code)
    • 349 very simple units (2,654 lines of code)
15% | 5% | 7% | 12% | 58%
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
swift15% | 5% | 7% | 12% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/NIOSSH/Connection State Machine65% | 0% | 3% | 0% | 30%
Sources/NIOSSH0% | 18% | 15% | 10% | 55%
Sources/NIOSSH/Child Channels0% | 0% | 9% | 17% | 73%
Sources/NIOSSH/Key Exchange0% | 0% | 13% | 21% | 64%
Sources/NIOSSH/User Authentication0% | 0% | 0% | 44% | 55%
Sources/NIOSSH/Keys And Signatures0% | 0% | 0% | 52% | 47%
Sources/NIOSSH/CSPRNG0% | 0% | 0% | 70% | 30%
Sources/NIOSSHClient0% | 0% | 0% | 0% | 100%
Sources/NIOSSHServer0% | 0% | 0% | 0% | 100%
Sources/NIOSSHPerformanceTester0% | 0% | 0% | 0% | 100%
Sources/NIOSSH/TransportProtection0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
mutating func processInboundMessage()
in Sources/NIOSSH/Connection State Machine/SSHConnectionStateMachine.swift
409 117 2
mutating func processOutboundMessage()
in Sources/NIOSSH/Connection State Machine/SSHConnectionStateMachine.swift
281 93 4
mutating func writeSSHMessage()
in Sources/NIOSSH/SSHMessages.swift
93 31 1
mutating func readSSHMessage()
in Sources/NIOSSH/SSHMessages.swift
147 30 0
mutating func writeChannelRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
66 23 1
func receiveMessage()
in Sources/NIOSSH/Child Channels/SSHChannelMultiplexer.swift
35 14 1
mutating func bufferInboundData()
in Sources/NIOSSH/Connection State Machine/SSHConnectionStateMachine.swift
41 14 1
func receiveInboundMessage()
in Sources/NIOSSH/Child Channels/SSHChildChannel.swift
32 13 1
mutating func nextPacket()
in Sources/NIOSSH/SSHPacketParser.swift
45 12 0
mutating func handle()
in Sources/NIOSSH/Key Exchange/SSHKeyExchangeStateMachine.swift
45 11 1
mutating func readChannelRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
91 11 0
func sign()
in Sources/NIOSSH/Keys And Signatures/NIOSSHPrivateKey.swift
31 9 1
func sign()
in Sources/NIOSSH/Keys And Signatures/NIOSSHPrivateKey.swift
21 9 1
mutating func sendUserAuthPKOK()
in Sources/NIOSSH/User Authentication/UserAuthenticationStateMachine.swift
21 8 1
mutating func receiveChannelClose()
in Sources/NIOSSH/Child Channels/ChildChannelStateMachine.swift
21 7 1
mutating func sendChannelClose()
in Sources/NIOSSH/Child Channels/ChildChannelStateMachine.swift
21 7 1
mutating func send()
in Sources/NIOSSH/Key Exchange/SSHKeyExchangeStateMachine.swift
19 7 1
mutating func readUserAuthRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
58 7 0
mutating func writeChannelOpenMessage()
in Sources/NIOSSH/SSHMessages.swift
29 7 1
mutating func receiveUserAuthRequest()
in Sources/NIOSSH/User Authentication/UserAuthenticationStateMachine.swift
21 7 1