apple / swift-nio-http2
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
  • 6% duplication:
    • 13,546 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 859 duplicated lines
  • 111 duplicates
system6% (859 lines)
Duplication per Extension
swift5% (788 lines)
yaml35% (71 lines)
Duplication per Component (primary)
Sources/NIOHTTP26% (309 lines)
Sources/NIOHTTP2/ConnectionStateMachine15% (241 lines)
Sources/NIOHTTP2PerformanceTester25% (143 lines)
docker35% (71 lines)
Sources/NIOHTTP2Server48% (37 lines)
Sources/NIOHPACK<1% (36 lines)
Sources/NIOHTTP2/Frame Buffers3% (22 lines)
FuzzTesting0% (0 lines)
FuzzTesting/Sources/FuzzHTTP20% (0 lines)
ROOT0% (0 lines)
scripts0% (0 lines)

Duplication Between Components (50+ lines)

G Sources/NIOHTTP2PerformanceTester Sources/NIOHTTP2PerformanceTester Sources/NIOHTTP2Server Sources/NIOHTTP2Server Sources/NIOHTTP2PerformanceTester--Sources/NIOHTTP2Server 74

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 111 duplicates...
Size#FoldersFilesLinesCode
40 x 2 Sources/NIOHTTP2PerformanceTester
Sources/NIOHTTP2PerformanceTester
ServerOnly10KRequestsBenchmark.swift
StreamTeardownBenchmark.swift
49:112 (36%)
24:87 (40%)
view
23 x 2 Sources/NIOHTTP2PerformanceTester
Sources/NIOHTTP2Server
Bench1Conn10kRequests.swift
main.swift
109:143 (21%)
24:59 (30%)
view
14 x 2 Sources/NIOHTTP2PerformanceTester
Sources/NIOHTTP2Server
Bench1Conn10kRequests.swift
main.swift
51:72 (13%)
100:121 (18%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
888:913 (1%)
929:954 (1%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
806:831 (1%)
929:954 (1%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
806:831 (1%)
888:913 (1%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
806:831 (1%)
847:872 (1%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
847:872 (1%)
888:913 (1%)
view
14 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
847:872 (1%)
929:954 (1%)
view
13 x 2 docker
docker
docker-compose.1804.53.yaml
docker-compose.2004.55.yaml
27:40 (39%)
27:40 (39%)
view
13 x 2 docker
docker
docker-compose.1804.53.yaml
docker-compose.2004.54.yaml
27:40 (39%)
28:41 (38%)
view
13 x 2 docker
docker
docker-compose.2004.56.yaml
docker-compose.2004.main.yaml
27:40 (39%)
27:40 (39%)
view
13 x 2 docker
docker
docker-compose.2004.54.yaml
docker-compose.2004.55.yaml
28:41 (38%)
27:40 (39%)
view
12 x 2 Sources/NIOHPACK
Sources/NIOHPACK
HPACKEncoder.swift
HPACKEncoder.swift
130:143 (7%)
171:184 (7%)
view
12 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2ToHTTP1Codec.swift
HTTP2ToHTTP1Codec.swift
167:183 (3%)
363:380 (3%)
view
11 x 2 Sources/NIOHTTP2/Frame Buffers
Sources/NIOHTTP2/Frame Buffers
OutboundFrameBuffer.swift
OutboundFrameBuffer.swift
84:95 (5%)
99:110 (5%)
view
11 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2ToHTTP1Codec.swift
HTTP2ToHTTP1Codec.swift
232:247 (2%)
416:432 (2%)
view
11 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Frame.swift
HTTP2Frame.swift
125:140 (9%)
161:176 (9%)
view
10 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Error.swift
HTTP2Error.swift
1075:1092 (1%)
1240:1257 (1%)
view
10 x 2 Sources/NIOHTTP2
Sources/NIOHTTP2
HTTP2Frame.swift
HTTP2Frame.swift
164:176 (8%)
206:218 (8%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
11 x 2 Sources/NIOHTTP2/ConnectionStateMachine
Sources/NIOHTTP2/ConnectionStateMachine
ConnectionStateMachine.swift
ConnectionStateMachine.swift
889:906 
1164:1182 
view