apple / swift-nio-ssh
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 387 units with 4,514 lines of code in units (45.9% of code).
    • 3 very long units (837 lines of code)
    • 4 long units (308 lines of code)
    • 26 medium size units (749 lines of code)
    • 85 small units (1,250 lines of code)
    • 269 very small units (1,370 lines of code)
18% | 6% | 16% | 27% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift18% | 6% | 16% | 27% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/NIOSSH/Connection State Machine65% | 0% | 3% | 2% | 27%
Sources/NIOSSH11% | 23% | 20% | 16% | 27%
Sources/NIOSSH/Child Channels0% | 0% | 15% | 53% | 30%
Sources/NIOSSH/Key Exchange0% | 0% | 29% | 39% | 30%
Sources/NIOSSHClient0% | 0% | 31% | 22% | 45%
Sources/NIOSSH/User Authentication0% | 0% | 21% | 65% | 12%
Sources/NIOSSH/Keys And Signatures0% | 0% | 26% | 57% | 16%
Sources/NIOSSH/TransportProtection0% | 0% | 23% | 18% | 58%
Sources/NIOSSHServer0% | 0% | 12% | 43% | 43%
Sources/NIOSSHPerformanceTester0% | 0% | 0% | 34% | 65%
Sources/NIOSSH/CSPRNG0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest 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 readSSHMessage()
in Sources/NIOSSH/SSHMessages.swift
147 30 0
mutating func writeSSHMessage()
in Sources/NIOSSH/SSHMessages.swift
93 31 1
mutating func readChannelRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
91 11 0
mutating func writeChannelRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
66 23 1
mutating func readUserAuthRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
58 7 0
mutating func readChannelOpenMessage()
in Sources/NIOSSH/SSHMessages.swift
48 4 0
mutating func handle()
in Sources/NIOSSH/Key Exchange/SSHKeyExchangeStateMachine.swift
45 11 1
mutating func nextPacket()
in Sources/NIOSSH/SSHPacketParser.swift
45 12 0
mutating func bufferInboundData()
in Sources/NIOSSH/Connection State Machine/SSHConnectionStateMachine.swift
41 14 1
func receiveMessage()
in Sources/NIOSSH/Child Channels/SSHChannelMultiplexer.swift
35 14 1
mutating func readKeyExchangeMessage()
in Sources/NIOSSH/SSHMessages.swift
35 1 0
mutating func readGlobalRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
33 3 0
func receiveInboundMessage()
in Sources/NIOSSH/Child Channels/SSHChildChannel.swift
32 13 1
mutating func handle()
in Sources/NIOSSH/Key Exchange/SSHKeyExchangeStateMachine.swift
31 6 1
func sign()
in Sources/NIOSSH/Keys And Signatures/NIOSSHPrivateKey.swift
31 9 1
mutating func writeChannelOpenMessage()
in Sources/NIOSSH/SSHMessages.swift
29 7 1
mutating func writeUserAuthRequestMessage()
in Sources/NIOSSH/SSHMessages.swift
28 6 1
func parse()
in Sources/NIOSSHClient/SimpleCLIParser.swift
27 4 0