apple / swift-syntax
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
  • 23% duplication:
    • 60,277 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 14,249 duplicated lines
  • 35,553 duplicates
system23% (14,249 lines)
Duplication per Extension
swift23% (14,249 lines)
Duplication per Component (primary)
Sources/SwiftSyntax/gyb_generated25% (11,441 lines)
Sources/SwiftSyntaxBuilder/gyb_generated22% (2,518 lines)
Sources/SwiftSyntax5% (142 lines)
lit_tests28% (114 lines)
Sources/SwiftSyntaxParser9% (28 lines)
Sources/SwiftSyntaxBuilder5% (6 lines)
ROOT0% (0 lines)
Sources/SwiftSyntaxBuilder/gyb_helpers0% (0 lines)
Sources/SwiftSyntaxParser/gyb_generated0% (0 lines)
Sources/_CSwiftSyntax/include0% (0 lines)
Sources/_CSwiftSyntax/src0% (0 lines)
lit_tests/incrParse0% (0 lines)

Duplication Between Components (50+ lines)

G Sources/SwiftSyntax Sources/SwiftSyntax Sources/SwiftSyntaxParser Sources/SwiftSyntaxParser Sources/SwiftSyntax--Sources/SwiftSyntaxParser 56

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 35,553 duplicates...
Size#FoldersFilesLinesCode
54 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
1874:1942 (1%)
5093:5161 (1%)
view
54 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
1539:1607 (1%)
1874:1942 (1%)
view
54 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
1539:1607 (1%)
5093:5161 (1%)
view
40 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
583:633 (1%)
2186:2236 (1%)
view
38 x 2 lit_tests
lit_tests
coloring_configs.swift
coloring_configs.swift
11:92 (23%)
100:181 (23%)
view
38 x 2 lit_tests
lit_tests
coloring_configs.swift
coloring_configs.swift
11:92 (23%)
190:271 (23%)
view
38 x 2 lit_tests
lit_tests
coloring_configs.swift
coloring_configs.swift
100:181 (23%)
190:271 (23%)
view
37 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
284:330 (1%)
1543:1589 (1%)
view
37 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
284:330 (1%)
1878:1924 (1%)
view
37 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
284:330 (1%)
5097:5143 (1%)
view
35 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
1874:1917 (1%)
2815:2858 (1%)
view
35 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
1539:1582 (1%)
2815:2858 (1%)
view
35 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
2815:2858 (1%)
5093:5136 (1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
6431:6488 (<1%)
6679:6736 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
5435:5492 (<1%)
6431:6488 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
5435:5492 (<1%)
6679:6736 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
5435:5492 (<1%)
7426:7483 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated/syntax_nodes
Sources/SwiftSyntax/gyb_generated/syntax_nodes
SyntaxDeclNodes.swift
SyntaxDeclNodes.swift
280:322 (<1%)
2186:2228 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
1205:1262 (<1%)
6679:6736 (<1%)
view
34 x 2 Sources/SwiftSyntax/gyb_generated
Sources/SwiftSyntax/gyb_generated
SyntaxCollections.swift
SyntaxCollections.swift
1205:1262 (<1%)
6431:6488 (<1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
10 x 2 Sources/SwiftSyntax
Sources/SwiftSyntax
IncrementalParseTransition.swift
SyntaxClassifier.swift
392:403 
176:187 
view