apple / swift-tools-support-core
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:
    • 9,989 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 233 duplicated lines
  • 18 duplicates
system2% (233 lines)
Duplication per Extension
swift2% (233 lines)
Duplication per Component (primary)
Sources/TSCBasic2% (124 lines)
Sources/TSCUtility2% (93 lines)
Sources/TSCTestSupport3% (16 lines)
ROOT0% (0 lines)
Sources/TSCLibc0% (0 lines)
Sources/TSCclibc/include0% (0 lines)
Sources/TSCclibc0% (0 lines)
Utilities0% (0 lines)
cmake/modules0% (0 lines)
Longest Duplicates
The list of 18 longest duplicates.
See data for all 18 duplicates...
Size#FoldersFilesLinesCode
12 x 2 Sources/TSCUtility
Sources/TSCUtility
Tracing.swift
Tracing.swift
102:113 (10%)
122:133 (10%)
view
12 x 2 Sources/TSCBasic
Sources/TSCBasic
Path.swift
Path.swift
100:127 (2%)
244:271 (2%)
view
11 x 2 Sources/TSCUtility
Sources/TSCUtility
Tracing.swift
Tracing.swift
83:93 (9%)
123:133 (9%)
view
11 x 2 Sources/TSCUtility
Sources/TSCUtility
Tracing.swift
Tracing.swift
83:93 (9%)
103:113 (9%)
view
9 x 2 Sources/TSCBasic
Sources/TSCBasic
Path.swift
Path.swift
568:578 (2%)
638:648 (2%)
view
8 x 2 Sources/TSCUtility
Sources/TSCUtility
ArgumentParser.swift
ArgumentParser.swift
398:410 (1%)
457:469 (1%)
view
8 x 2 Sources/TSCUtility
Sources/TSCUtility
StringExtensions.swift
StringExtensions.swift
111:122 (10%)
124:135 (10%)
view
8 x 2 Sources/TSCTestSupport
Sources/TSCTestSupport
DiagnosticsEngine.swift
DiagnosticsEngine.swift
47:54 (15%)
67:74 (15%)
view
8 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
106:114 (3%)
119:127 (3%)
view
7 x 2 Sources/TSCUtility
Sources/TSCUtility
ArgumentParser.swift
ArgumentParser.swift
519:525 (1%)
532:538 (1%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
199:205 (2%)
212:218 (2%)
view
6 x 2 Sources/TSCUtility
Sources/TSCUtility
Tracing.swift
Tracing.swift
76:81 (5%)
96:101 (5%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
186:192 (2%)
212:218 (2%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
53:59 (2%)
66:72 (2%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
186:192 (2%)
199:205 (2%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
Process.swift
Process.swift
297:302 (1%)
322:327 (1%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
OSLog.swift
OSLog.swift
139:144 (2%)
290:295 (2%)
view
6 x 2 Sources/TSCBasic
Sources/TSCBasic
Path.swift
Path.swift
319:326 (1%)
331:338 (1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 2 Sources/TSCUtility
Sources/TSCUtility
ArgumentParser.swift
ArgumentParser.swift
402:408 
461:467 
view