apple / swift-nio
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
  • 12% duplication:
    • 26,977 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,487 duplicated lines
  • 648 duplicates
system12% (3,487 lines)
Duplication per Extension
swift13% (3,172 lines)
yaml54% (201 lines)
c5% (114 lines)
Duplication per Component (primary)
Sources/NIOCore21% (1,771 lines)
Sources/NIOPerformanceTester39% (593 lines)
Sources/NIOPosix6% (451 lines)
docker54% (201 lines)
Sources/CNIOHTTPParser3% (68 lines)
Sources/CNIOAtomics30% (46 lines)
Sources/NIOHTTP11% (46 lines)
Sources/NIOHTTP1Client64% (44 lines)
Sources/NIOEchoServer80% (40 lines)
Sources/NIOEchoClient69% (38 lines)
Sources/NIOChatClient62% (34 lines)
Sources/NIOUDPEchoServer65% (32 lines)
Sources/NIOChatServer33% (30 lines)
Sources/NIOWebSocketClient22% (28 lines)
Sources/NIOHTTP1Server6% (28 lines)
Sources/NIOWebSocketServer9% (19 lines)
Sources/NIOWebSocket1% (12 lines)
Sources/NIOUDPEchoClient8% (6 lines)
ROOT0% (0 lines)
Sources/CNIODarwin0% (0 lines)
Sources/CNIOLinux0% (0 lines)
Sources/CNIOSHA10% (0 lines)
Sources/CNIOWindows0% (0 lines)
Sources/NIO0% (0 lines)
Sources/NIOAsyncAwaitDemo0% (0 lines)
Sources/NIOConcurrencyHelpers0% (0 lines)
Sources/NIOCrashTester0% (0 lines)
Sources/NIOEmbedded0% (0 lines)
Sources/NIOFoundationCompat0% (0 lines)
Sources/NIOMulticastChat0% (0 lines)
Sources/NIOTLS0% (0 lines)
Sources/_NIOConcurrency0% (0 lines)
Sources/_NIODataStructures0% (0 lines)
dev0% (0 lines)
scripts0% (0 lines)

Duplication Between Components (50+ lines)

G Sources/NIOCore Sources/NIOCore Sources/NIOPosix Sources/NIOPosix Sources/NIOCore--Sources/NIOPosix 390 Sources/NIOEchoClient Sources/NIOEchoClient Sources/NIOHTTP1Client Sources/NIOHTTP1Client Sources/NIOEchoClient--Sources/NIOHTTP1Client 72 Sources/NIOWebSocketClient Sources/NIOWebSocketClient Sources/NIOHTTP1Client--Sources/NIOWebSocketClient 56 Sources/NIOChatClient Sources/NIOChatClient Sources/NIOChatClient--Sources/NIOEchoClient 66 Sources/NIOChatClient--Sources/NIOHTTP1Client 66 Sources/NIOEchoServer Sources/NIOEchoServer Sources/NIOUDPEchoServer Sources/NIOUDPEchoServer Sources/NIOEchoServer--Sources/NIOUDPEchoServer 64 Sources/NIOChatServer Sources/NIOChatServer Sources/NIOChatServer--Sources/NIOEchoServer 54

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 648 duplicates...
Size#FoldersFilesLinesCode
131 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
263:502 (24%)
753:992 (24%)
view
113 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
508:726 (21%)
753:971 (21%)
view
113 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
263:481 (21%)
508:726 (21%)
view
112 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
47:261 (20%)
537:751 (20%)
view
91 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
47:236 (16%)
292:481 (16%)
view
91 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
resources.swift
resources.swift
47:236 (16%)
782:971 (16%)
view
61 x 2 Sources/NIOCore
Sources/NIOPosix
IntegerBitPacking.swift
IntegerBitPacking.swift
17:101 (100%)
15:99 (100%)
view
54 x 2 Sources/NIOCore
Sources/NIOPosix
IntegerTypes.swift
IntegerTypes.swift
20:114 (100%)
18:112 (100%)
view
46 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1638:1697 (2%)
1850:1909 (2%)
view
43 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1438:1493 (2%)
1850:1905 (2%)
view
43 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1438:1493 (2%)
1638:1693 (2%)
view
40 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1250:1301 (2%)
1638:1689 (2%)
view
40 x 2 docker
docker
docker-compose.2004.56.yaml
docker-compose.2004.main.yaml
20:61 (65%)
20:61 (65%)
view
40 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1250:1301 (2%)
1850:1901 (2%)
view
40 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1250:1301 (2%)
1438:1489 (2%)
view
37 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1074:1121 (2%)
1850:1897 (2%)
view
37 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1074:1121 (2%)
1638:1685 (2%)
view
37 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1074:1121 (2%)
1438:1485 (2%)
view
37 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
1074:1121 (2%)
1250:1297 (2%)
view
34 x 2 Sources/NIOCore
Sources/NIOCore
ByteBuffer-multi-int.swift
ByteBuffer-multi-int.swift
910:953 (1%)
1250:1293 (1%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
15 x 2 Sources/NIOPosix
Sources/NIOPosix
Bootstrap.swift
Bootstrap.swift
672:687 
1100:1115 
view
12 x 2 Sources/NIOPerformanceTester
Sources/NIOPerformanceTester
ExecuteBenchmark.swift
SchedulingAndRunningBenchmark.swift
25:40 
25:40 
view
8 x 2 Sources/NIOPosix
Sources/NIOPosix
SelectorEpoll.swift
SelectorUring.swift
283:291 
350:358 
view