apple / sourcekit-lsp
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
  • 5% duplication:
    • 11,667 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 653 duplicated lines
  • 85 duplicates
system5% (653 lines)
Duplication per Extension
py62% (409 lines)
swift2% (244 lines)
Duplication per Component (primary)
Sources/SKTestSupport44% (437 lines)
Sources/SourceKitLSP2% (92 lines)
Sources/LanguageServerProtocol2% (70 lines)
Sources/SKCore4% (48 lines)
Sources/SKSwiftPMWorkspace1% (6 lines)
ROOT0% (0 lines)
Sources/BuildServerProtocol0% (0 lines)
Sources/CSKTestSupport0% (0 lines)
Sources/Csourcekitd0% (0 lines)
Sources/LSPLogging0% (0 lines)
Sources/LSPTestSupport0% (0 lines)
Sources/LanguageServerProtocolJSONRPC0% (0 lines)
Sources/SKSupport0% (0 lines)
Sources/SourceKitD0% (0 lines)
Sources/sourcekit-lsp0% (0 lines)
Utilities0% (0 lines)
cmake/modules0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 85 duplicates...
Size#FoldersFilesLinesCode
51 x 2 Sources/SKTestSupport/IN...testBuildTargetsChanged
Sources/SKTestSupport/IN...ts.testFileRegistration
server.py
server.py
8:64 (69%)
8:64 (71%)
view
34 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN....testBuildTargetSources
server.py
server.py
7:42 (51%)
7:42 (38%)
view
34 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
7:42 (51%)
8:43 (48%)
view
34 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
7:42 (38%)
8:43 (48%)
view
25 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...testBuildTargetsChanged
server.py
server.py
18:42 (37%)
31:55 (34%)
view
25 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...testBuildTargetsChanged
server.py
server.py
18:42 (28%)
31:55 (34%)
view
25 x 2 Sources/SKTestSupport/IN...ts.testFileRegistration
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
31:55 (35%)
19:43 (35%)
view
25 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...ts.testFileRegistration
server.py
server.py
18:42 (28%)
31:55 (35%)
view
25 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...ts.testFileRegistration
server.py
server.py
18:42 (37%)
31:55 (35%)
view
25 x 2 Sources/SKTestSupport/IN...testBuildTargetsChanged
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
31:55 (34%)
19:43 (35%)
view
21 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN....testBuildTargetSources
server.py
server.py
54:77 (31%)
77:100 (23%)
view
20 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...ts.testServerInitialize
server.py
server.py
7:28 (30%)
7:28 (39%)
view
20 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...mTests.testBuildTargets
server.py
server.py
55:77 (30%)
74:96 (23%)
view
20 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...mTests.testBuildTargets
server.py
server.py
78:100 (22%)
74:96 (23%)
view
20 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...ts.testServerInitialize
server.py
server.py
7:28 (22%)
7:28 (39%)
view
20 x 2 Sources/SKTestSupport/IN...ts.testServerInitialize
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
7:28 (39%)
8:29 (28%)
view
18 x 2 Sources/SKTestSupport/IN...mTests.testBuildTargets
Sources/SKTestSupport/IN...ystemTests.testSettings
server.py
server.py
7:26 (21%)
8:27 (25%)
view
18 x 2 Sources/SKTestSupport/IN....testBuildTargetOutputs
Sources/SKTestSupport/IN...mTests.testBuildTargets
server.py
server.py
7:26 (27%)
7:26 (21%)
view
18 x 2 Sources/SKTestSupport/IN....testBuildTargetSources
Sources/SKTestSupport/IN...mTests.testBuildTargets
server.py
server.py
7:26 (20%)
7:26 (21%)
view
18 x 2 Sources/SKTestSupport/IN...mTests.testBuildTargets
Sources/SKTestSupport/IN...ts.testServerInitialize
server.py
server.py
7:26 (21%)
7:26 (35%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
10 x 2 Sources/SKCore
Sources/SKCore
FallbackBuildSystem.swift
FallbackBuildSystem.swift
78:88 
90:100 
view
8 x 2 Sources/SourceKitLSP/Clang
Sources/SourceKitLSP/Clang
ClangLanguageServer.swift
ClangLanguageServer.swift
444:452 
466:474 
view
7 x 2 Sources/SKTestSupport/IN...testBuildTargetsChanged
Sources/SKTestSupport/IN...ts.testFileRegistration
server.py
server.py
0:0 
0:0 
view