apple / swift-nio-extras
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
  • 2% duplication:
    • 2,906 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 85 duplicated lines
  • 7 duplicates
system2% (85 lines)
Duplication per Extension
swift3% (85 lines)
Duplication per Component (primary)
Sources/NIOExtras4% (46 lines)
ROOT19% (21 lines)
Sources/NIOWritePCAPDemo19% (9 lines)
Sources/NIOWritePartialPCAPDemo10% (9 lines)
Sources/CNIOExtrasZlib0% (0 lines)
Sources/HTTPServerWithQuiescingDemo0% (0 lines)
Sources/NIOExtrasPerformanceTester0% (0 lines)
Sources/NIOHTTPCompression0% (0 lines)
Sources/NIOSOCKS0% (0 lines)
Sources/NIOSOCKSClient0% (0 lines)
docker0% (0 lines)
Longest Duplicates
The list of 7 longest duplicates.
See data for all 7 duplicates...
Size#FoldersFilesLinesCode
11 x 2 Sources/NIOExtras
Sources/NIOExtras
LengthFieldBasedFrameDecoder.swift
LengthFieldPrepender.swift
80:91 (10%)
57:68 (16%)
view
9 x 2 Sources/NIOWritePCAPDemo
Sources/NIOWritePartialPCAPDemo
main.swift
main.swift
52:64 (19%)
102:114 (10%)
view
7 x 2 ROOT
ROOT
Package.swift
Package.swift
35:41 (6%)
51:57 (6%)
view
7 x 2 ROOT
ROOT
Package.swift
Package.swift
35:41 (6%)
43:49 (6%)
view
7 x 2 ROOT
ROOT
Package.swift
Package.swift
43:49 (6%)
51:57 (6%)
view
6 x 2 Sources/NIOExtras
Sources/NIOExtras
WritePCAPHandler.swift
WritePCAPHandler.swift
468:473 (1%)
482:487 (1%)
view
6 x 2 Sources/NIOExtras
Sources/NIOExtras
FixedLengthFrameDecoder.swift
LengthFieldBasedFrameDecoder.swift
53:61 (35%)
152:161 (5%)
view