apple / swift-system
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
  • 3% duplication:
    • 3,249 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 98 duplicated lines
  • 11 duplicates
system3% (98 lines)
Duplication per Extension
swift3% (98 lines)
Duplication per Component (primary)
Sources/System/FilePath5% (48 lines)
Sources/System/Internals5% (38 lines)
Sources/System<1% (12 lines)
ROOT0% (0 lines)
Sources/CSystem/include0% (0 lines)
Sources/CSystem0% (0 lines)
Utilities0% (0 lines)
cmake/modules0% (0 lines)
Longest Duplicates
The list of 11 longest duplicates.
See data for all 11 duplicates...
Size#FoldersFilesLinesCode
9 x 2 Sources/System/FilePath
Sources/System/FilePath
FilePathWindows.swift
FilePathWindows.swift
44:52 (4%)
60:68 (4%)
view
9 x 2 Sources/System/FilePath
Sources/System/FilePath
FilePathComponentView.swift
FilePathComponentView.swift
47:63 (8%)
70:86 (8%)
view
7 x 2 Sources/System/Internals
Sources/System/Internals
WindowsSyscallAdapters.swift
WindowsSyscallAdapters.swift
64:73 (10%)
87:96 (10%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
Constants.swift
Syscalls.swift
14:24 (1%)
10:18 (7%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
Exports.swift
Syscalls.swift
15:25 (6%)
10:18 (7%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
CInterop.swift
Syscalls.swift
17:27 (24%)
10:18 (7%)
view
6 x 2 Sources/System
Sources/System
FileDescriptor.swift
FileDescriptor.swift
438:443 (2%)
459:464 (2%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
CInterop.swift
Constants.swift
17:27 (24%)
14:24 (1%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
Constants.swift
Exports.swift
14:24 (1%)
15:25 (6%)
view
6 x 2 Sources/System/Internals
Sources/System/Internals
CInterop.swift
Exports.swift
17:27 (24%)
15:25 (6%)
view
6 x 2 Sources/System/FilePath
Sources/System/FilePath
FilePathString.swift
FilePathString.swift
59:81 (5%)
95:117 (5%)
view