apple / swift-nio-examples
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
  • 7% duplication:
    • 2,857 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 213 duplicated lines
  • 14 duplicates
system7% (213 lines)
Duplication per Extension
swift7% (213 lines)
Duplication per Component (primary)
json-rpc/Sources13% (123 lines)
TLSify/Sources13% (33 lines)
connect-proxy/Sources15% (33 lines)
backpressure-file-io-channel/Sources7% (24 lines)
NIOSMTP/NIOSMTP0% (0 lines)
TLSify0% (0 lines)
UniversalBootstrapDemo0% (0 lines)
UniversalBootstrapDemo/Sources0% (0 lines)
backpressure-file-io-channel0% (0 lines)
connect-proxy0% (0 lines)
http2-client0% (0 lines)
http2-client/Sources0% (0 lines)
http2-server0% (0 lines)
http2-server/Sources0% (0 lines)
json-rpc0% (0 lines)
nio-launchd0% (0 lines)
nio-launchd/Sources0% (0 lines)

Duplication Between Components (50+ lines)

G TLSify/Sources TLSify/Sources connect-proxy/Sources connect-proxy/Sources TLSify/Sources--connect-proxy/Sources 66

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 14 longest duplicates.
See data for all 14 duplicates...
Size#FoldersFilesLinesCode
16 x 2 TLSify/Sources/TLSifyLib
connect-proxy/Sources/ConnectProxy
GlueHandler.swift
GlueHandler.swift
29:58 (28%)
42:72 (29%)
view
12 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Client.swift
Server.swift
77:94 (7%)
61:78 (10%)
view
12 x 2 backpressure-file-io-cha...pressureChannelToFileIO
backpressure-file-io-cha...pressureChannelToFileIO
FileIOChannelWriteCoordinator.swift
FileIOChannelWriteCoordinator.swift
134:146 (6%)
193:207 (6%)
view
12 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Model.swift
Model.swift
180:191 (6%)
312:323 (6%)
view
11 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Codec.swift
Codec.swift
67:85 (6%)
198:215 (6%)
view
9 x 2 TLSify/Sources/TLSifyLib
connect-proxy/Sources/ConnectProxy
GlueHandler.swift
GlueHandler.swift
101:114 (15%)
106:119 (16%)
view
9 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Codec.swift
Codec.swift
137:151 (5%)
200:214 (5%)
view
9 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Codec.swift
Codec.swift
69:83 (5%)
137:151 (5%)
view
8 x 2 TLSify/Sources/TLSifyLib
connect-proxy/Sources/ConnectProxy
GlueHandler.swift
GlueHandler.swift
68:81 (14%)
78:91 (14%)
view
7 x 2 json-rpc/Sources/LightsdDemo
json-rpc/Sources/LightsdDemo
main.swift
main.swift
136:147 (3%)
153:165 (3%)
view
6 x 2 json-rpc/Sources/LightsdDemo
json-rpc/Sources/LightsdDemo
main.swift
main.swift
136:145 (3%)
172:181 (3%)
view
6 x 2 json-rpc/Sources/JsonRpc
json-rpc/Sources/JsonRpc
Client.swift
Server.swift
140:146 (3%)
85:91 (5%)
view
6 x 2 json-rpc/Sources/LightsdDemo
json-rpc/Sources/LightsdDemo
main.swift
main.swift
69:74 (3%)
113:118 (3%)
view
6 x 2 json-rpc/Sources/LightsdDemo
json-rpc/Sources/LightsdDemo
main.swift
main.swift
153:163 (3%)
172:181 (3%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 2 TLSify/Sources/TLSifyLib
connect-proxy/Sources/ConnectProxy
GlueHandler.swift
GlueHandler.swift
110:116 
115:121 
view