apple / swift-nio-ssh
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 8% duplication:
    • 7,865 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 667 duplicated lines
  • 58 duplicates
system8% (667 lines)
Duplication per Extension
swift8% (667 lines)
Duplication per Component (primary)
Sources/NIOSSH/Connection State Machine22% (283 lines)
Sources/NIOSSH/Child Channels7% (126 lines)
Sources/NIOSSHServer31% (79 lines)
Sources/NIOSSH/Keys And Signatures6% (64 lines)
Sources/NIOSSHClient19% (57 lines)
Sources/NIOSSH/User Authentication10% (46 lines)
ROOT20% (12 lines)
Sources/NIOSSH0% (0 lines)
Sources/NIOSSH/CSPRNG0% (0 lines)
Sources/NIOSSH/Key Exchange0% (0 lines)
Sources/NIOSSH/TransportProtection0% (0 lines)
Sources/NIOSSHPerformanceTester0% (0 lines)
docker0% (0 lines)

Duplication Between Components (50+ lines)

G Sources/NIOSSHClient Sources/NIOSSHClient Sources/NIOSSHServer Sources/NIOSSHServer Sources/NIOSSHClient--Sources/NIOSSHServer 114

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 58 duplicates...
Size#FoldersFilesLinesCode
57 x 2 Sources/NIOSSHClient
Sources/NIOSSHServer
GlueHandler.swift
GlueHandler.swift
17:121 (100%)
17:121 (100%)
view
35 x 2 Sources/NIOSSH/Connection State Machine
Sources/NIOSSH/Connection State Machine
SSHConnectionStateMachine.swift
SSHConnectionStateMachine.swift
848:882 (4%)
981:1015 (4%)
view
27 x 2 Sources/NIOSSH/Connection State Machine
Sources/NIOSSH/Connection State Machine
SSHConnectionStateMachine.swift
SSHConnectionStateMachine.swift
342:370 (3%)
567:597 (3%)
view
24 x 2 Sources/NIOSSH/Connection State Machine
Sources/NIOSSH/Connection State Machine
SSHConnectionStateMachine.swift
SSHConnectionStateMachine.swift
347:370 (3%)
461:484 (3%)
view
24 x 2 Sources/NIOSSH/Connection State Machine
Sources/NIOSSH/Connection State Machine
SSHConnectionStateMachine.swift
SSHConnectionStateMachine.swift
461:484 (3%)
574:597 (3%)
view
15 x 2 Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
RekeyingReceivedNewKeysState.swift
RekeyingSentNewKeysState.swift
22:46 (78%)
22:46 (78%)
view
13 x 2 Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
ReceivedNewKeysState.swift
SentNewKeysState.swift
22:46 (54%)
22:46 (54%)
view
11 x 2 Sources/NIOSSH/Keys And Signatures
Sources/NIOSSH/Keys And Signatures
NIOSSHCertifiedPublicKey.swift
NIOSSHCertifiedPublicKey.swift
200:210 (2%)
471:481 (2%)
view
11 x 2 Sources/NIOSSHServer
Sources/NIOSSHServer
DataToBufferCodec.swift
ExecHandler.swift
33:50 (47%)
69:86 (12%)
view
9 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
501:512 (2%)
522:533 (2%)
view
9 x 2 Sources/NIOSSH/User Authentication
Sources/NIOSSH/User Authentication
UserAuthenticationStateMachine.swift
UserAuthenticationStateMachine.swift
271:280 (3%)
325:334 (3%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
186:194 (2%)
293:301 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
251:259 (2%)
293:301 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
272:280 (2%)
293:301 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
186:194 (2%)
272:280 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
251:259 (2%)
272:280 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
186:194 (2%)
251:259 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
619:626 (2%)
637:644 (2%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelUserEvents.swift
ChildChannelUserEvents.swift
28:47 (3%)
213:232 (3%)
view
8 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
206:216 (2%)
228:238 (2%)
view
Duplicated Units
The list of top 9 duplicated units.
See data for all 9 unit duplicates...
Size#FoldersFilesLinesCode
15 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
185:203 
249:268 
view
15 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
205:225 
227:247 
view
14 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
436:455 
457:476 
view
14 x 2 Sources/NIOSSH/Child Channels
Sources/NIOSSH/Child Channels
ChildChannelStateMachine.swift
ChildChannelStateMachine.swift
478:497 
499:518 
view
10 x 2 Sources/NIOSSHServer
Sources/NIOSSHServer
DataToBufferCodec.swift
ExecHandler.swift
33:46 
69:82 
view
8 x 3 Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
RekeyingReceivedNewKeysState.swift
RekeyingSentNewKeysState.swift
RekeyingState.swift
39:47 
39:47 
38:46 
view
8 x 2 Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
UserAuthenticationState.swift
UserAuthenticationState.swift
38:46 
48:56 
view
7 x 2 Sources/NIOSSH/Connectio...ate Machine/States
Sources/NIOSSH/Connectio...ate Machine/States
ActiveState.swift
ActiveState.swift
34:41 
43:50 
view
6 x 2 Sources/NIOSSHClient
Sources/NIOSSHServer
GlueHandler.swift
GlueHandler.swift
117:123 
117:123 
view