apple / swift-argument-parser
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
  • 11% duplication:
    • 4,667 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 551 duplicated lines
  • 51 duplicates
system11% (551 lines)
Duplication per Extension
swift12% (551 lines)
Duplication per Component (primary)
Sources/ArgumentParser/Parsable Properties38% (382 lines)
Sources/ArgumentParser/Parsable Types14% (63 lines)
Sources/ArgumentParserTestHelpers26% (52 lines)
Sources/ArgumentParser/Parsing2% (34 lines)
ROOT19% (20 lines)
Sources/ArgumentParser/Completions0% (0 lines)
Sources/ArgumentParser/Usage0% (0 lines)
Sources/ArgumentParser/Utilities0% (0 lines)
Sources/ArgumentParserToolInfo0% (0 lines)
Tools/changelog-authors0% (0 lines)
cmake/modules0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 51 duplicates...
Size#FoldersFilesLinesCode
26 x 2 Sources/ArgumentParserTestHelpers
Sources/ArgumentParserTestHelpers
TestHelpers.swift
TestHelpers.swift
180:213 (14%)
237:270 (14%)
view
17 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Option.swift
46:81 (7%)
51:86 (5%)
view
11 x 2 Sources/ArgumentParser/Parsable Types
Sources/ArgumentParser/Parsable Types
ParsableArgumentsValidation.swift
ParsableArgumentsValidation.swift
210:223 (6%)
259:272 (6%)
view
11 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Flag.swift
66:81 (4%)
92:107 (4%)
view
11 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Flag.swift
Option.swift
92:107 (4%)
71:86 (3%)
view
10 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Option.swift
249:260 (4%)
379:390 (3%)
view
10 x 2 ROOT
ROOT
Package.swift
Package@swift-5.5.swift
16:25 (19%)
16:25 (18%)
view
10 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Option.swift
415:426 (4%)
566:577 (3%)
view
10 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Option.swift
Option.swift
493:514 (3%)
597:624 (3%)
view
10 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Option.swift
327:338 (4%)
471:482 (3%)
view
9 x 2 Sources/ArgumentParser/Parsable Types
Sources/ArgumentParser/Parsable Types
ParsableArgumentsValidation.swift
ParsableArgumentsValidation.swift
86:97 (5%)
261:272 (5%)
view
9 x 2 Sources/ArgumentParser/Parsable Types
Sources/ArgumentParser/Parsable Types
CommandConfiguration.swift
CommandConfiguration.swift
73:81 (18%)
96:104 (18%)
view
9 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
OptionGroup.swift
71:81 (3%)
71:81 (20%)
view
9 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Option.swift
OptionGroup.swift
76:86 (2%)
71:81 (20%)
view
9 x 2 Sources/ArgumentParser/Parsing
Sources/ArgumentParser/Parsing
ArgumentSet.swift
ArgumentSet.swift
290:300 (3%)
312:322 (3%)
view
9 x 2 Sources/ArgumentParser/Parsable Types
Sources/ArgumentParser/Parsable Types
ParsableArgumentsValidation.swift
ParsableArgumentsValidation.swift
86:97 (5%)
212:223 (5%)
view
9 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Flag.swift
OptionGroup.swift
97:107 (4%)
71:81 (20%)
view
8 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Option.swift
437:445 (3%)
588:596 (2%)
view
8 x 2 Sources/ArgumentParser/Parsing
Sources/ArgumentParser/Parsing
ArgumentSet.swift
ArgumentSet.swift
266:275 (2%)
290:299 (2%)
view
8 x 2 Sources/ArgumentParser/Parsable Properties
Sources/ArgumentParser/Parsable Properties
Argument.swift
Argument.swift
348:364 (3%)
446:465 (3%)
view