apple / swift-algorithms
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
  • 15% duplication:
    • 3,948 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 631 duplicated lines
  • 47 duplicates
system15% (631 lines)
Duplication per Extension
swift15% (631 lines)
Duplication per Component (primary)
Sources/Algorithms16% (631 lines)
ROOT0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 47 duplicates...
Size#FoldersFilesLinesCode
38 x 2 Sources/Algorithms
Sources/Algorithms
Joined.swift
Joined.swift
142:199 (15%)
248:305 (15%)
view
37 x 2 Sources/Algorithms
Sources/Algorithms
FlattenCollection.swift
Intersperse.swift
114:161 (18%)
457:504 (8%)
view
36 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
Product.swift
142:187 (20%)
206:251 (16%)
view
21 x 2 Sources/Algorithms
Sources/Algorithms
Intersperse.swift
Intersperse.swift
180:207 (4%)
475:502 (4%)
view
21 x 2 Sources/Algorithms
Sources/Algorithms
FlattenCollection.swift
Intersperse.swift
132:159 (10%)
180:207 (4%)
view
16 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
Windows.swift
163:185 (8%)
153:175 (8%)
view
16 x 2 Sources/Algorithms
Sources/Algorithms
Product.swift
Windows.swift
227:249 (7%)
153:175 (8%)
view
13 x 2 Sources/Algorithms
Sources/Algorithms
Joined.swift
Joined.swift
74:88 (5%)
229:243 (5%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
Windows.swift
142:156 (6%)
129:143 (6%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
Intersperse.swift
168:183 (6%)
485:500 (2%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Intersperse.swift
Windows.swift
190:205 (2%)
158:173 (6%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
FlattenCollection.swift
168:183 (6%)
142:157 (6%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Intersperse.swift
Windows.swift
485:500 (2%)
158:173 (6%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Product.swift
Windows.swift
206:220 (5%)
129:143 (6%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Intersperse.swift
Product.swift
190:205 (2%)
232:247 (5%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
FlattenCollection.swift
Product.swift
142:157 (6%)
232:247 (5%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
MinMax.swift
MinMax.swift
118:160 (9%)
273:315 (9%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Joined.swift
Joined.swift
38:55 (4%)
93:110 (4%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Intersperse.swift
Product.swift
485:500 (2%)
232:247 (5%)
view
12 x 2 Sources/Algorithms
Sources/Algorithms
Chain.swift
Intersperse.swift
168:183 (6%)
190:205 (2%)
view