Public report of swiftlang/swift-package-manager, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 09:33 UTC · Survey ID cd_1585dd1973774694b0186f6e2abf279a
swiftlang/swift-package-manager
Measured 14 November 2026, 09:25 UTC, at code version 20e2788
Dependency hygiene is not measured: SwiftPM pinning read, dependency currency NOT established (SwiftPM has no central registry to ask).
Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.
CAI scoreStrong
CriticalWeakAdequateStrongExemplary
Up 5 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 155,484 lines of product code in 94 projects, tests not counted · Estimated rebuild effort: about 2.7 person-years · Weakest lens: Maturity, 61
Findings by how serious they are
86 critical1888 serious519 minor
22 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 09:25 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
48of 48 dimensions measured by tools.
2442of 2493 findings point to an exact file and line, so you can open each one in the code. The other 51 concern the repository as a whole, such as missing documentation.
48dimensions across 7 lenses, read from 155,484 lines of product code in 94 projects.
swiftlang/swift-package-manager meets our standard for a preview release. It scores 67 out of 100 and is rated Strong, and 13 of its 86 critical findings are security problems.
Maturity, at 61, is the weakest lens and counts most in the score. The best first step is making the naming consistent, worth about 4 points.
Six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Six settings leave the servers or containers unsafe, and twelve parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, correcting the unsafe settings and having someone learn the forgotten files would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once. Giving each kind of identifier a type of its own would take care of the 40 identifiers passed around as plain numbers or text.
The product code is 155,484 lines, about €390,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Maturity rose from 61 to 62, the lowest score rated Strong, the score would rise from 67 to about 67.
Code composition: what the lines of code are
Product code 48%Tests 52%
New since the last survey: 264 findings
These 264 critical or serious findings weren't in the previous survey, on 26 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · ClassTooLong: ModuleAliasTracker Sources/PackageGraph/ModuleAliasTracker.swift
God Classes · FileTooLong: PackageGraph/ModuleAliasTracker.swift Sources/PackageGraph/ModuleAliasTracker.swift
God Classes · MethodTooLong: PluginDelegate.performTestsForPlugin Sources/Commands/Utilities/PluginDelegate.swift
Code Duplication · Near-duplicate member pair (51 shared lines) Sources/PackageRegistry/SignatureValidation.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Workspace/Workspace+State.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/XCBuildSupport/PIF.swift
Code Duplication · Edited copy of a member (64 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift
Code Duplication · Edited copy of a member (49 corresponding lines) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift
Code Duplication · Edited copy of a member (32 corresponding lines) Sources/Basics/SQLiteBackedCache.swift
Code Duplication · Edited copy of a member (43 corresponding lines) Sources/PackageGraph/ModulesGraph.swift
Code Duplication · Edited copy of a member (49 corresponding lines) Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift
Code Duplication · Edited copy of a member (38 corresponding lines) Sources/SourceControl/GitRepository.swift
Code Duplication · Edited copy of a member (31 corresponding lines) Sources/PackageCollections/PackageIndex.swift
Code Duplication · Edited copy of a member (44 corresponding lines) Sources/CoreCommands/SwiftCommandState.swift
Code Duplication · Edited copy of a member (32 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift
Code Duplication · Edited copy of a member (30 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift
Code Duplication · Edited copy of a member (30 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift
Code Duplication · Edited copy of a member (29 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift
Code Duplication · Edited copy of a member (30 corresponding lines) Sources/DriverSupport/DriverSupportUtils.swift
Code Duplication · Edited copy of a member (33 corresponding lines) Sources/SwiftBuildSupport/PackagePIFBuilder.swift
Code Duplication · Edited copy of a member (37 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift
Code Duplication · Edited copy of a member (37 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift
Code Duplication · Edited copy of a member (23 corresponding lines) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift
Code Duplication · Edited copy of a member (28 corresponding lines) Sources/Basics/Archiver/TarArchiver.swift
Code Duplication · Edited copy of a member (25 corresponding lines) Sources/SPMBuildCore/BinaryTarget+Extensions.swift
Code Duplication · Edited copy of a member (34 corresponding lines) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift
Code Duplication · Edited copy of a member (30 corresponding lines) Sources/Basics/Graph/GraphAlgorithms.swift
Code Duplication · Edited copy of a member (28 corresponding lines) Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/Commands/CommandWorkspaceDelegate.swift
Code Duplication · Edited copy of a member (22 corresponding lines) Sources/SBOMModel/Extractor/SBOMExtractor.swift
Code Duplication · Edited copy of a member (20 corresponding lines) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/Commands/Snippets/Cards/SnippetGroupCard.swift
Code Duplication · Edited copy of a member (35 corresponding lines) Sources/PackageRegistry/SignatureValidation.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/Basics/Environment/Environment.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/SwiftBuildSupport/PIF.swift
Code Duplication · Edited copy of a member (26 corresponding lines) Sources/PackageRegistry/SignatureValidation.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/PackageRegistry/SigningEntityTOFU.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/PackageCollections/PackageCollections.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/Basics/SQLiteBackedCache.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/SBOMModel/Validator/SBOMValidator.swift
Code Duplication · Edited copy of a member (22 corresponding lines) Sources/Basics/FileSystem/InMemoryFileSystem.swift
Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) Sources/Runtimes/PackagePlugin/Command.swift
Code Duplication · Edited copy of a member (28 corresponding lines) Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/PackageModel/WindowsToolchainInfo.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift
Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) Sources/Basics/AuthorizationProvider.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/PackageCollections/Storage/Trie.swift
Code Duplication · Edited copy of a member (20 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/Basics/Archiver/TarArchiver.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/Runtimes/PackagePlugin/Plugin.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/PackageCollections/PackageIndex.swift
Code Duplication · Edited copy of a member (11 corresponding lines) Sources/Basics/FileSystem/TSCAdapters.swift
Code Duplication · Edited copy of a member (20 corresponding lines) Sources/Basics/Graph/DirectedGraph.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/PackageModel/Manifest/PackageDependencyDescription.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/Basics/SQLiteBackedCache.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/SBOMModel/Extractor/DependencySourceStrategy.swift
Code Duplication · Edited copy of a member (19 corresponding lines) Sources/Commands/PackageCommands/Config.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/_AsyncFileSystem/OSFileSystem.swift
Code Duplication · Edited copy of a member (18 corresponding lines) Sources/Basics/HTTPClient/HTTPClient.swift
Code Duplication · Edited copy of a member (12 corresponding lines) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift
Code Duplication · Edited copy of a member (24 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift
Code Duplication · Edited copy of a member (12 corresponding lines) Sources/SwiftBuildSupport/PIF.swift
Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) Sources/Basics/HTTPClient/LegacyHTTPClient.swift
Code Duplication · Edited copy of a member (23 corresponding lines) Sources/PackageModel/Module/BinaryModule.swift
Code Duplication · Edited copy of a member (13 corresponding lines) Sources/SPMBuildCore/BuildParameters/BuildParameters.swift
Code Duplication · Edited copy of a member (27 corresponding lines) Utilities/helpers.py
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/SourceControl/GitRepository.swift
Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift
Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) Sources/XCBuildSupport/XCBuildMessage.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/Basics/ProgressAnimation/NinjaProgressAnimation.swift
Code Duplication · Edited copy of a member (11 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift
Code Duplication · Edited copy of a member (19 corresponding lines) Sources/PackageModel/Manifest/PackageDependencyDescription.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/PackageModel/DependencyMapper.swift
Code Duplication · Edited copy of a member (16 corresponding lines) Sources/PackageRegistry/RegistryDownloadsManager.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/Basics/HTTPClient/LegacyHTTPClient.swift
Code Duplication · Edited copy of a member (9 corresponding lines) Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift
Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/Runtimes/PackageDescription/BuildSettings.swift
Code Duplication · Edited copy of a member (15 corresponding lines) Sources/Basics/Concurrency/AsyncProcess.swift
Code Duplication · Edited copy of a member (14 corresponding lines) Sources/Basics/DispatchTimeInterval+Extensions.swift
Code Duplication · Edited copy of a member (8 corresponding lines) Sources/Basics/FileSystem/TSCAdapters.swift
Code Duplication · Edited copy of a member (17 corresponding lines) Sources/PackageFingerprint/PackageFingerprintStorage.swift
Code Duplication · Edited copy of a member (5 corresponding lines) Sources/PackageModel/ManifestSourceGeneration.swift
Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) Sources/Runtimes/PackageDescription/PackageDependency.swift
Code Duplication · Edited copy of a member (22 corresponding lines) Sources/Basics/Cancellator.swift
Code Duplication · Edited copy of a member (11 corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift
Code Duplication · Edited copy of a member (10 corresponding lines) Sources/PackageCollectionsSigning/Utilities/Base64URL.swift
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 109 findings
These 109 critical or serious findings were in the previous survey, on 26 October 2026, and are gone from this one. The first 100 are listed here.
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: ADPAppleDistributionCertificatePolicy.expectedSubjectUserID Sources/Workspace/ManifestSigning/CertificatePolicy.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: _SubjectNamePolicy.expectedUserID Sources/Workspace/ManifestSigning/CertificatePolicy.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: Name.userID Sources/Workspace/ManifestSigning/ManifestSigning.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TargetDependency.targetGUID Sources/XCBuildSupport/PIF.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TargetStartedInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TargetCompleteInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskUpToDateInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskUpToDateInfo.parentTaskID Sources/XCBuildSupport/XCBuildMessage.swift
Rebuild cost: about €390,000 · Estimate
Cost to rebuild
€130,000 to €660,000, for 2,184 to 6,929 hours of work, about 2.7 person-years for 1 to 6 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.9 at a score of 67. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 155,484 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift.
Resolve the 1 `ExperimentalApiDiff` spells `Api` where 22 names in the project spell… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift.
Resolve the 1 `getReplProductName` spells `Repl` where 12 names in the project spell… finding(s) in Naming Consistency — start with ModulesGraph.swift.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €390,000 to build again, about 2.7 person-years of work. Its weakest lens is Maturity, at 61 (Adequate). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
One cause behind 44 Domain Modelling findings · Common cause
44 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Rich vs anemic domain model (4 findings) · Strongly-typed ids (40 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Resolve the 1 `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project… finding(s) in Naming Consistency. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 Naming Consistency findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 31,843 lines over the last 90 days, which is about 129,141 lines a year. At that pace, the extra work comes to an estimated 10.4 to 62.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
48 modules, with 271 dependencies between them. One loop runs through 24 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 8 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
31 pairs of types, where a type in Build uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in Build uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuildSupport uses XCBuildSupport, so a change to XCBuildSupport can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break XCBuildSupport.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→7 SwiftBuildSupport uses SPMBuildCorepart of a loop✕
Connections
11 pairs of types, where a type in SwiftBuildSupport uses a type in SPMBuildCore.
SwiftBuildSupport uses SPMBuildCore, so a change to SPMBuildCore can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break SPMBuildCore.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→9 SwiftBuildSupport uses PackageGraphpart of a loop✕
Connections
23 pairs of types, where a type in SwiftBuildSupport uses a type in PackageGraph.
SwiftBuildSupport uses PackageGraph, so a change to PackageGraph can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageGraph.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→10 SwiftBuildSupport uses PackageLoadingpart of a loop✕
Connections
6 pairs of types, where a type in SwiftBuildSupport uses a type in PackageLoading.
SwiftBuildSupport uses PackageLoading, so a change to PackageLoading can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageLoading.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→14 SwiftBuildSupport uses Workspacepart of a loop✕
Connections
2 pairs of types, where a type in SwiftBuildSupport uses a type in Workspace.
SwiftBuildSupport uses PackageRegistryCommand, so a change to PackageRegistryCommand can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→17 SwiftBuildSupport uses SourceControlpart of a loop✕
Connections
2 pairs of types, where a type in SwiftBuildSupport uses a type in SourceControl.
SwiftBuildSupport uses SourceControl, so a change to SourceControl can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break SourceControl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→18 SwiftBuildSupport uses QueryEnginepart of a loop✕
Connections
33 pairs of types, where a type in SwiftBuildSupport uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuildSupport uses QueryEngine, so a change to QueryEngine can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break QueryEngine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→20 SwiftBuildSupport uses PackageCollectionsSigningpart of a loop✕
Connections
1 pair of types, where a type in SwiftBuildSupport uses a type in PackageCollectionsSigning.
SwiftBuildSupport uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→21 SwiftBuildSupport uses PackageModelpart of a loop✕
Connections
23 pairs of types, where a type in SwiftBuildSupport uses a type in PackageModel.
SwiftBuildSupport uses PackageModel, so a change to PackageModel can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→22 SwiftBuildSupport uses LLBuildManifestpart of a loop✕
Connections
33 pairs of types, where a type in SwiftBuildSupport uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuildSupport uses LLBuildManifest, so a change to LLBuildManifest can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→27 SwiftBuildSupport uses CoreCommandspart of a loop✕
Connections
1 pair of types, where a type in SwiftBuildSupport uses a type in CoreCommands.
SwiftBuildSupport uses CoreCommands, so a change to CoreCommands can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break CoreCommands.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29 pairs of types, where a type in SwiftBuildSupport uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
XCBuildSupport uses SwiftBuildSupport, so a change to SwiftBuildSupport can break XCBuildSupport, while a change to XCBuildSupport can't break SwiftBuildSupport.
Position
Below the diagonal: XCBuildSupport uses a module listed above it, which is the healthy direction.
6→7 XCBuildSupport uses SPMBuildCorepart of a loop✕
Connections
5 pairs of types, where a type in XCBuildSupport uses a type in SPMBuildCore.
XCBuildSupport uses _AsyncFileSystem, so a change to _AsyncFileSystem can break XCBuildSupport, while a change to XCBuildSupport can't break _AsyncFileSystem.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→16 XCBuildSupport uses PackageRegistryCommandpart of a loop✕
Connections
1 pair of types, where a type in XCBuildSupport uses a type in PackageRegistryCommand.
XCBuildSupport uses PackageRegistryCommand, so a change to PackageRegistryCommand can break XCBuildSupport, while a change to XCBuildSupport can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→18 XCBuildSupport uses QueryEnginepart of a loop✕
Connections
29 pairs of types, where a type in XCBuildSupport uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
XCBuildSupport uses PackageModel, so a change to PackageModel can break XCBuildSupport, while a change to XCBuildSupport can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→22 XCBuildSupport uses LLBuildManifestpart of a loop✕
Connections
53 pairs of types, where a type in XCBuildSupport uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
XCBuildSupport uses LLBuildManifest, so a change to LLBuildManifest can break XCBuildSupport, while a change to XCBuildSupport can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
SPMBuildCore uses _AsyncFileSystem, so a change to _AsyncFileSystem can break SPMBuildCore, while a change to SPMBuildCore can't break _AsyncFileSystem.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→16 SPMBuildCore uses PackageRegistryCommandpart of a loop✕
Connections
2 pairs of types, where a type in SPMBuildCore uses a type in PackageRegistryCommand.
SPMBuildCore uses PackageRegistryCommand, so a change to PackageRegistryCommand can break SPMBuildCore, while a change to SPMBuildCore can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30 pairs of types, where a type in SPMBuildCore uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SPMBuildCore uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break SPMBuildCore, while a change to SPMBuildCore can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→21 SPMBuildCore uses PackageModelpart of a loop✕
Connections
17 pairs of types, where a type in SPMBuildCore uses a type in PackageModel.
SPMBuildCore uses PackageModel, so a change to PackageModel can break SPMBuildCore, while a change to SPMBuildCore can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→22 SPMBuildCore uses LLBuildManifestpart of a loop✕
Connections
54 pairs of types, where a type in SPMBuildCore uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
43 pairs of types, where a type in SPMBuildCore uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Runtimes uses PackageRegistryCommand, so a change to PackageRegistryCommand can break Runtimes, while a change to Runtimes can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Runtimes uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break Runtimes, while a change to Runtimes can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
80 pairs of types, where a type in Runtimes uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageGraph uses SwiftBuildSupport, so a change to SwiftBuildSupport can break PackageGraph, while a change to PackageGraph can't break SwiftBuildSupport.
Position
Below the diagonal: PackageGraph uses a module listed above it, which is the healthy direction.
PackageGraph uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageGraph, while a change to PackageGraph can't break _AsyncFileSystem.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
PackageGraph uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageGraph, while a change to PackageGraph can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→17 PackageGraph uses SourceControlpart of a loop✕
Connections
1 pair of types, where a type in PackageGraph uses a type in SourceControl.
47 pairs of types, where a type in PackageGraph uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageGraph uses QueryEngine, so a change to QueryEngine can break PackageGraph, while a change to PackageGraph can't break QueryEngine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→21 PackageGraph uses PackageModelpart of a loop✕
Connections
90 pairs of types, where a type in PackageGraph uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageGraph uses PackageModel, so a change to PackageModel can break PackageGraph, while a change to PackageGraph can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→22 PackageGraph uses LLBuildManifestpart of a loop✕
Connections
43 pairs of types, where a type in PackageGraph uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
41 pairs of types, where a type in PackageGraph uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageLoading uses SwiftBuildSupport, so a change to SwiftBuildSupport can break PackageLoading, while a change to PackageLoading can't break SwiftBuildSupport.
Position
Below the diagonal: PackageLoading uses a module listed above it, which is the healthy direction.
PackageLoading uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageLoading, while a change to PackageLoading can't break _AsyncFileSystem.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→16 PackageLoading uses PackageRegistryCommandpart of a loop✕
Connections
8 pairs of types, where a type in PackageLoading uses a type in PackageRegistryCommand.
PackageLoading uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageLoading, while a change to PackageLoading can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→18 PackageLoading uses QueryEnginepart of a loop✕
Connections
24 pairs of types, where a type in PackageLoading uses a type in QueryEngine.
PackageLoading uses QueryEngine, so a change to QueryEngine can break PackageLoading, while a change to PackageLoading can't break QueryEngine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→21 PackageLoading uses PackageModelpart of a loop✕
Connections
70 pairs of types, where a type in PackageLoading uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageLoading uses PackageModel, so a change to PackageModel can break PackageLoading, while a change to PackageLoading can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→22 PackageLoading uses LLBuildManifestpart of a loop✕
Connections
53 pairs of types, where a type in PackageLoading uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageLoading uses LLBuildManifest, so a change to LLBuildManifest can break PackageLoading, while a change to PackageLoading can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
38 pairs of types, where a type in PackageLoading uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
_AsyncFileSystem uses PackageLoading, so a change to PackageLoading can break _AsyncFileSystem, while a change to _AsyncFileSystem can't break PackageLoading.
Position
Below the diagonal: _AsyncFileSystem uses a module listed above it, which is the healthy direction.
11→18 _AsyncFileSystem uses QueryEnginepart of a loop✕
Connections
14 pairs of types, where a type in _AsyncFileSystem uses a type in QueryEngine.
PackageFingerprint uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageFingerprint, while a change to PackageFingerprint can't break _AsyncFileSystem.
Position
Below the diagonal: PackageFingerprint uses a module listed above it, which is the healthy direction.
12→14 PackageFingerprint uses Workspacepart of a loop✕
Connections
1 pair of types, where a type in PackageFingerprint uses a type in Workspace.
PackageFingerprint uses QueryEngine, so a change to QueryEngine can break PackageFingerprint, while a change to PackageFingerprint can't break QueryEngine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→20 PackageFingerprint uses PackageCollectionsSigningpart of a loop✕
Connections
1 pair of types, where a type in PackageFingerprint uses a type in PackageCollectionsSigning.
PackageFingerprint uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break PackageFingerprint, while a change to PackageFingerprint can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→21 PackageFingerprint uses PackageModelpart of a loop✕
Connections
5 pairs of types, where a type in PackageFingerprint uses a type in PackageModel.
PackageFingerprint uses PackageModel, so a change to PackageModel can break PackageFingerprint, while a change to PackageFingerprint can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→22 PackageFingerprint uses LLBuildManifestpart of a loop✕
Connections
5 pairs of types, where a type in PackageFingerprint uses a type in LLBuildManifest.
PackageFingerprint uses LLBuildManifest, so a change to LLBuildManifest can break PackageFingerprint, while a change to PackageFingerprint can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→29 PackageFingerprint uses Basicspart of a loop✕
Connections
7 pairs of types, where a type in PackageFingerprint uses a type in Basics.
PackageRegistry uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageRegistry, while a change to PackageRegistry can't break _AsyncFileSystem.
Position
Below the diagonal: PackageRegistry uses a module listed above it, which is the healthy direction.
PackageRegistry uses PackageFingerprint, so a change to PackageFingerprint can break PackageRegistry, while a change to PackageRegistry can't break PackageFingerprint.
Position
Below the diagonal: PackageRegistry uses a module listed above it, which is the healthy direction.
13→15 PackageRegistry uses PackageSigningpart of a loop✕
Connections
9 pairs of types, where a type in PackageRegistry uses a type in PackageSigning.
PackageRegistry uses PackageSigning, so a change to PackageSigning can break PackageRegistry, while a change to PackageRegistry can't break PackageSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→16 PackageRegistry uses PackageRegistryCommandpart of a loop✕
Connections
1 pair of types, where a type in PackageRegistry uses a type in PackageRegistryCommand.
PackageRegistry uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageRegistry, while a change to PackageRegistry can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→18 PackageRegistry uses QueryEnginepart of a loop✕
Connections
9 pairs of types, where a type in PackageRegistry uses a type in QueryEngine.
PackageRegistry uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break PackageRegistry, while a change to PackageRegistry can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→21 PackageRegistry uses PackageModelpart of a loop✕
Connections
18 pairs of types, where a type in PackageRegistry uses a type in PackageModel.
PackageRegistry uses LLBuildManifest, so a change to LLBuildManifest can break PackageRegistry, while a change to PackageRegistry can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Workspace uses PackageRegistryCommand, so a change to PackageRegistryCommand can break Workspace, while a change to Workspace can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30 pairs of types, where a type in Workspace uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Workspace uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break Workspace, while a change to Workspace can't break PackageCollectionsSigning.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
58 pairs of types, where a type in Workspace uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Workspace uses PackageModel, so a change to PackageModel can break Workspace, while a change to Workspace can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
14→22 Workspace uses LLBuildManifestpart of a loop✕
Connections
42 pairs of types, where a type in Workspace uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageSigning uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageSigning, while a change to PackageSigning can't break _AsyncFileSystem.
Position
Below the diagonal: PackageSigning uses a module listed above it, which is the healthy direction.
PackageSigning uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageSigning, while a change to PackageSigning can't break PackageRegistryCommand.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→18 PackageSigning uses QueryEnginepart of a loop✕
Connections
11 pairs of types, where a type in PackageSigning uses a type in QueryEngine.
PackageSigning uses LLBuildManifest, so a change to LLBuildManifest can break PackageSigning, while a change to PackageSigning can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
PackageRegistryCommand uses PackageSigning, so a change to PackageSigning can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break PackageSigning.
Position
Below the diagonal: PackageRegistryCommand uses a module listed above it, which is the healthy direction.
16→18 PackageRegistryCommand uses QueryEnginepart of a loop✕
Connections
5 pairs of types, where a type in PackageRegistryCommand uses a type in QueryEngine.
PackageRegistryCommand uses QueryEngine, so a change to QueryEngine can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break QueryEngine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→21 PackageRegistryCommand uses PackageModelpart of a loop✕
Connections
3 pairs of types, where a type in PackageRegistryCommand uses a type in PackageModel.
PackageRegistryCommand uses PackageModel, so a change to PackageModel can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→22 PackageRegistryCommand uses LLBuildManifestpart of a loop✕
Connections
7 pairs of types, where a type in PackageRegistryCommand uses a type in LLBuildManifest.
PackageRegistryCommand uses LLBuildManifest, so a change to LLBuildManifest can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→27 PackageRegistryCommand uses CoreCommandspart of a loop✕
Connections
8 pairs of types, where a type in PackageRegistryCommand uses a type in CoreCommands.
PackageRegistryCommand uses CoreCommands, so a change to CoreCommands can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break CoreCommands.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→29 PackageRegistryCommand uses Basicspart of a loop✕
Connections
8 pairs of types, where a type in PackageRegistryCommand uses a type in Basics.
PackageRegistryCommand uses Basics, so a change to Basics can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break Basics.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
SourceControl uses _AsyncFileSystem, so a change to _AsyncFileSystem can break SourceControl, while a change to SourceControl can't break _AsyncFileSystem.
Position
Below the diagonal: SourceControl uses a module listed above it, which is the healthy direction.
SourceControl uses PackageRegistryCommand, so a change to PackageRegistryCommand can break SourceControl, while a change to SourceControl can't break PackageRegistryCommand.
Position
Below the diagonal: SourceControl uses a module listed above it, which is the healthy direction.
17→18 SourceControl uses QueryEnginepart of a loop✕
Connections
18 pairs of types, where a type in SourceControl uses a type in QueryEngine.
SourceControl uses LLBuildManifest, so a change to LLBuildManifest can break SourceControl, while a change to SourceControl can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
37 pairs of types, where a type in SourceControl uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageCollectionsModel uses QueryEngine, so a change to QueryEngine can break PackageCollectionsModel, while a change to PackageCollectionsModel can't break QueryEngine.
Position
Below the diagonal: PackageCollectionsModel uses a module listed above it, which is the healthy direction.
PackageCollectionsSigning uses Workspace, so a change to Workspace can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break Workspace.
Position
Below the diagonal: PackageCollectionsSigning uses a module listed above it, which is the healthy direction.
PackageCollectionsSigning uses QueryEngine, so a change to QueryEngine can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break QueryEngine.
Position
Below the diagonal: PackageCollectionsSigning uses a module listed above it, which is the healthy direction.
PackageCollectionsSigning uses PackageCollectionsModel, so a change to PackageCollectionsModel can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break PackageCollectionsModel.
Position
Below the diagonal: PackageCollectionsSigning uses a module listed above it, which is the healthy direction.
20→21 PackageCollectionsSigning uses PackageModelpart of a loop✕
Connections
1 pair of types, where a type in PackageCollectionsSigning uses a type in PackageModel.
PackageCollectionsSigning uses PackageModel, so a change to PackageModel can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break PackageModel.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→22 PackageCollectionsSigning uses LLBuildManifestpart of a loop✕
Connections
10 pairs of types, where a type in PackageCollectionsSigning uses a type in LLBuildManifest.
PackageCollectionsSigning uses LLBuildManifest, so a change to LLBuildManifest can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break LLBuildManifest.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→28 PackageCollectionsSigning uses Commandspart of a loop✕
Connections
2 pairs of types, where a type in PackageCollectionsSigning uses a type in Commands.
PackageCollectionsSigning uses Commands, so a change to Commands can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break Commands.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→29 PackageCollectionsSigning uses Basicspart of a loop✕
Connections
17 pairs of types, where a type in PackageCollectionsSigning uses a type in Basics.
PackageCollectionsSigning uses Basics, so a change to Basics can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break Basics.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
PackageModel uses SwiftBuildSupport, so a change to SwiftBuildSupport can break PackageModel, while a change to PackageModel can't break SwiftBuildSupport.
Position
Below the diagonal: PackageModel uses a module listed above it, which is the healthy direction.
PackageModel uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageModel, while a change to PackageModel can't break _AsyncFileSystem.
Position
Below the diagonal: PackageModel uses a module listed above it, which is the healthy direction.
PackageModel uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageModel, while a change to PackageModel can't break PackageRegistryCommand.
Position
Below the diagonal: PackageModel uses a module listed above it, which is the healthy direction.
64 pairs of types, where a type in PackageModel uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageModel uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break PackageModel, while a change to PackageModel can't break PackageCollectionsSigning.
Position
Below the diagonal: PackageModel uses a module listed above it, which is the healthy direction.
21→22 PackageModel uses LLBuildManifestpart of a loop✕
Connections
119 pairs of types, where a type in PackageModel uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
91 pairs of types, where a type in PackageModel uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageCollectionsCommand uses QueryEngine, so a change to QueryEngine can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break QueryEngine.
Position
Below the diagonal: PackageCollectionsCommand uses a module listed above it, which is the healthy direction.
PackageCollectionsCommand uses PackageModel, so a change to PackageModel can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break PackageModel.
Position
Below the diagonal: PackageCollectionsCommand uses a module listed above it, which is the healthy direction.
PackageCollectionsCommand uses LLBuildManifest, so a change to LLBuildManifest can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break LLBuildManifest.
Position
Below the diagonal: PackageCollectionsCommand uses a module listed above it, which is the healthy direction.
23→27 PackageCollectionsCommand uses CoreCommandspart of a loop✕
Connections
19 pairs of types, where a type in PackageCollectionsCommand uses a type in CoreCommands.
PackageCollectionsCommand uses CoreCommands, so a change to CoreCommands can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break CoreCommands.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
SBOMModel uses PackageRegistryCommand, so a change to PackageRegistryCommand can break SBOMModel, while a change to SBOMModel can't break PackageRegistryCommand.
Position
Below the diagonal: SBOMModel uses a module listed above it, which is the healthy direction.
SBOMModel uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break SBOMModel, while a change to SBOMModel can't break PackageCollectionsSigning.
Position
Below the diagonal: SBOMModel uses a module listed above it, which is the healthy direction.
65 pairs of types, where a type in SBOMModel uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Utilities~InstalledSwiftPMConfiguration uses QueryEngine, so a change to QueryEngine can break Utilities~InstalledSwiftPMConfiguration, while a change to Utilities~InstalledSwiftPMConfiguration can't break QueryEngine.
Position
Below the diagonal: Utilities~InstalledSwiftPMConfiguration uses a module listed above it, which is the healthy direction.
Utilities~InstalledSwiftPMConfiguration uses LLBuildManifest, so a change to LLBuildManifest can break Utilities~InstalledSwiftPMConfiguration, while a change to Utilities~InstalledSwiftPMConfiguration can't break LLBuildManifest.
Position
Below the diagonal: Utilities~InstalledSwiftPMConfiguration uses a module listed above it, which is the healthy direction.
swift-package-manager uses LLBuildManifest, so a change to LLBuildManifest can break swift-package-manager, while a change to swift-package-manager can't break LLBuildManifest.
Position
Below the diagonal: swift-package-manager uses a module listed above it, which is the healthy direction.
CoreCommands uses _AsyncFileSystem, so a change to _AsyncFileSystem can break CoreCommands, while a change to CoreCommands can't break _AsyncFileSystem.
Position
Below the diagonal: CoreCommands uses a module listed above it, which is the healthy direction.
CoreCommands uses PackageRegistryCommand, so a change to PackageRegistryCommand can break CoreCommands, while a change to CoreCommands can't break PackageRegistryCommand.
Position
Below the diagonal: CoreCommands uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in CoreCommands uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
CoreCommands uses PackageCollectionsCommand, so a change to PackageCollectionsCommand can break CoreCommands, while a change to CoreCommands can't break PackageCollectionsCommand.
Position
Below the diagonal: CoreCommands uses a module listed above it, which is the healthy direction.
Commands uses PackageRegistryCommand, so a change to PackageRegistryCommand can break Commands, while a change to Commands can't break PackageRegistryCommand.
Position
Below the diagonal: Commands uses a module listed above it, which is the healthy direction.
87 pairs of types, where a type in Commands uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Commands uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break Commands, while a change to Commands can't break PackageCollectionsSigning.
Position
Below the diagonal: Commands uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in Commands uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
95 pairs of types, where a type in Commands uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Commands uses PackageCollectionsCommand, so a change to PackageCollectionsCommand can break Commands, while a change to Commands can't break PackageCollectionsCommand.
Position
Below the diagonal: Commands uses a module listed above it, which is the healthy direction.
62 pairs of types, where a type in Commands uses a type in CoreCommands. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Basics uses PackageRegistryCommand, so a change to PackageRegistryCommand can break Basics, while a change to Basics can't break PackageRegistryCommand.
Position
Below the diagonal: Basics uses a module listed above it, which is the healthy direction.
119 pairs of types, where a type in Basics uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Basics uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break Basics, while a change to Basics can't break PackageCollectionsSigning.
Position
Below the diagonal: Basics uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in Basics uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
84 pairs of types, where a type in Basics uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
BinarySymbols uses PackageRegistryCommand, so a change to PackageRegistryCommand can break BinarySymbols, while a change to BinarySymbols can't break PackageRegistryCommand.
Position
Below the diagonal: BinarySymbols uses a module listed above it, which is the healthy direction.
BinarySymbols uses LLBuildManifest, so a change to LLBuildManifest can break BinarySymbols, while a change to BinarySymbols can't break LLBuildManifest.
Position
Below the diagonal: BinarySymbols uses a module listed above it, which is the healthy direction.
DriverSupport uses PackageRegistryCommand, so a change to PackageRegistryCommand can break DriverSupport, while a change to DriverSupport can't break PackageRegistryCommand.
Position
Below the diagonal: DriverSupport uses a module listed above it, which is the healthy direction.
DriverSupport uses LLBuildManifest, so a change to LLBuildManifest can break DriverSupport, while a change to DriverSupport can't break LLBuildManifest.
Position
Below the diagonal: DriverSupport uses a module listed above it, which is the healthy direction.
PackageCollections uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageCollections, while a change to PackageCollections can't break _AsyncFileSystem.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
PackageCollections uses PackageRegistryCommand, so a change to PackageRegistryCommand can break PackageCollections, while a change to PackageCollections can't break PackageRegistryCommand.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in PackageCollections uses a type in QueryEngine. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageCollections uses QueryEngine, so a change to QueryEngine can break PackageCollections, while a change to PackageCollections can't break QueryEngine.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
PackageCollections uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break PackageCollections, while a change to PackageCollections can't break PackageCollectionsSigning.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
PackageCollections uses PackageModel, so a change to PackageModel can break PackageCollections, while a change to PackageCollections can't break PackageModel.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in PackageCollections uses a type in LLBuildManifest. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageCollections uses LLBuildManifest, so a change to LLBuildManifest can break PackageCollections, while a change to PackageCollections can't break LLBuildManifest.
Position
Below the diagonal: PackageCollections uses a module listed above it, which is the healthy direction.
35 pairs of types, where a type in PackageCollections uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SourceKitLSPAPI uses LLBuildManifest, so a change to LLBuildManifest can break SourceKitLSPAPI, while a change to SourceKitLSPAPI can't break LLBuildManifest.
Position
Below the diagonal: SourceKitLSPAPI uses a module listed above it, which is the healthy direction.
SwiftFixIt uses PackageRegistryCommand, so a change to PackageRegistryCommand can break SwiftFixIt, while a change to SwiftFixIt can't break PackageRegistryCommand.
Position
Below the diagonal: SwiftFixIt uses a module listed above it, which is the healthy direction.
SwiftSDKCommand uses LLBuildManifest, so a change to LLBuildManifest can break SwiftSDKCommand, while a change to SwiftSDKCommand can't break LLBuildManifest.
Position
Below the diagonal: SwiftSDKCommand uses a module listed above it, which is the healthy direction.
swift-bootstrap uses PackageLoading, so a change to PackageLoading can break swift-bootstrap, while a change to swift-bootstrap can't break PackageLoading.
Position
Below the diagonal: swift-bootstrap uses a module listed above it, which is the healthy direction.
swift-bootstrap uses LLBuildManifest, so a change to LLBuildManifest can break swift-bootstrap, while a change to swift-bootstrap can't break LLBuildManifest.
Position
Below the diagonal: swift-bootstrap uses a module listed above it, which is the healthy direction.
swift-build-prebuilts uses QueryEngine, so a change to QueryEngine can break swift-build-prebuilts, while a change to swift-build-prebuilts can't break QueryEngine.
Position
Below the diagonal: swift-build-prebuilts uses a module listed above it, which is the healthy direction.
swift-build-prebuilts uses LLBuildManifest, so a change to LLBuildManifest can break swift-build-prebuilts, while a change to swift-build-prebuilts can't break LLBuildManifest.
Position
Below the diagonal: swift-build-prebuilts uses a module listed above it, which is the healthy direction.
PackageMetadata uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageMetadata, while a change to PackageMetadata can't break _AsyncFileSystem.
Position
Below the diagonal: PackageMetadata uses a module listed above it, which is the healthy direction.
PackageMetadata uses PackageRegistry, so a change to PackageRegistry can break PackageMetadata, while a change to PackageMetadata can't break PackageRegistry.
Position
Below the diagonal: PackageMetadata uses a module listed above it, which is the healthy direction.
PackageMetadata uses SourceControl, so a change to SourceControl can break PackageMetadata, while a change to PackageMetadata can't break SourceControl.
Position
Below the diagonal: PackageMetadata uses a module listed above it, which is the healthy direction.
PackageMetadata uses LLBuildManifest, so a change to LLBuildManifest can break PackageMetadata, while a change to PackageMetadata can't break LLBuildManifest.
Position
Below the diagonal: PackageMetadata uses a module listed above it, which is the healthy direction.
PackageMetadata uses PackageCollections, so a change to PackageCollections can break PackageMetadata, while a change to PackageMetadata can't break PackageCollections.
Position
Below the diagonal: PackageMetadata uses a module listed above it, which is the healthy direction.
SwiftPMBuildServer uses SwiftBuildSupport, so a change to SwiftBuildSupport can break SwiftPMBuildServer, while a change to SwiftPMBuildServer can't break SwiftBuildSupport.
Position
Below the diagonal: SwiftPMBuildServer uses a module listed above it, which is the healthy direction.
SwiftPMBuildServer uses QueryEngine, so a change to QueryEngine can break SwiftPMBuildServer, while a change to SwiftPMBuildServer can't break QueryEngine.
Position
Below the diagonal: SwiftPMBuildServer uses a module listed above it, which is the healthy direction.
SwiftPMBuildServer uses LLBuildManifest, so a change to LLBuildManifest can break SwiftPMBuildServer, while a change to SwiftPMBuildServer can't break LLBuildManifest.
Position
Below the diagonal: SwiftPMBuildServer uses a module listed above it, which is the healthy direction.
SwiftPMBuildServer uses SourceKitLSPAPI, so a change to SourceKitLSPAPI can break SwiftPMBuildServer, while a change to SwiftPMBuildServer can't break SourceKitLSPAPI.
Position
Below the diagonal: SwiftPMBuildServer uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A02:2025 — Security Misconfiguration
63
High / Critical
A05:2025 — Injection
7
High / Critical
Roadmap
Top priorities: Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find; Resolve the 1 `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift; Resolve the 1 `ExperimentalApiDiff` spells `Api` where 22 names in the project spell… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift.
Resolve the 1 `ExperimentalApiDiff` spells `Api` where 22 names in the project spell… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift.
Resolve the 1 `getReplProductName` spells `Repl` where 12 names in the project spell… finding(s) in Naming Consistency — start with ModulesGraph.swift.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 86
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 1888
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 519
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 22
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 48 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 48 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2442 of 2493 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 144 SwiftPM declaration(s) across 343 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (31 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 25 of this repository's SwiftPM dependencies could not be fetched at a pinned revision and are repositories api.deps.dev has not indexed, so their licences were not read and the verdict does not cover them: b, bar, barpkg, baz, c, cfake, cfoo, csystemmodule, deck-of-playing-cards, dep1.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift`, `Examples/swift-sdl/Sources/SwiftSDL/SwiftSDL.swift`, `Examples/swift-sdl/Sources/SwiftSDLGenerator/SwiftSDLGenerator.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroClient/main.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroDef/MacroDef.swift`, … (+194 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in Sources/SPMLLBuild/llbuild.swift, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 17 — an image could not be built) — runtime-setup Warning pull access denied for swift-package-manager, repository does not exist or may require 'docker login': denied: requested access to the resource is denied failed to solve: process "/bin/sh -c wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -" did not complete successfully: exit code: 2; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
DM2 Strongly-typed ids — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 17 further occurrence(s) are not listed individually; the score already reflects all 57.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Swift, c is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Swift, c is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Python, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
104 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PackageBuilder.buildSettings at 85. A further 12 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being RegistryError.description at 53 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift (Capability.init at 22), Sources/Workspace/Diagnostics.swift (FileSystemError.description at 22), Sources/XCBuildSupport/PIF.swift (FileReference.fileTypeIdentifier at 21), Sources/XCBuildSupport/XCBuildMessage.swift (XCBuildMessage.encode at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 98 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with PackageBuilder.buildSettings (cyclomatic 85), PackagePIFProjectBuilder.buildSourceModule (cyclomatic 77), ModulesGraph+Loading.swift.createResolvedPackages (cyclomatic 74). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 6.2 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 168 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with ModulesGraph+Loading.swift.createResolvedPackages (cognitive 179). — Refactoring it lifts Cognitive Complexity from 4.7 to about 5.2/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 37 MethodTooLong finding(s) in God Classes — start with PackageBuilder.swift (4), Workspace+Dependencies.swift (3), RegistryClient.swift (3). — One of this dimension's main actionable groups (37 warning-level).
Resolve the 34 FileTooLong finding(s) in God Classes — start with PIFBuilder.swift (2), RegistryClient.swift, PackageBuilder.swift. — One of this dimension's main actionable groups (34 warning-level).
Resolve the 19 ClassTooLong finding(s) in God Classes — start with RegistryClient.swift, PackageBuilder.swift, UserToolchain.swift. — One of this dimension's main actionable groups (19 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
219 duplicated block group(s) detected. 6.7 % of the production lines (10,396 of 155,484) are in a reported copy. A further 298 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 91 of the 517 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (8 corresponding lines) · ×16Sources/PackageModel/Manifest/PackageDependencyDescription.swift:116
Edited copy of a member (10 corresponding lines) · ×14Sources/Basics/SQLiteBackedCache.swift:142
+ 136 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 16 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with BuildSettings.swift (2), PackageGraphTester.swift (2), PackageDependencyDescription.swift. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 16 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with ManifestJSONParser.swift (2), PIFTester.swift (2), URLSessionHTTPClient.swift. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 15 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with AuthorizationProvider.swift, HTTPClientRequest.swift, ManifestJSONParser.swift. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.1 / 10Stronggated by 10 serious findings✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
94 production modules (SwiftPM+CMake), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 45 of the 94 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: PackageDescription (SwiftPM) · ×7
Unstable project SBOMModel (SwiftPM)
Unstable project SourceKitLSPAPI (CMake)
Unstable project SwiftPMBuildServer (CMake)
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project SBOMModel (SwiftPM) finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project SourceKitLSPAPI (CMake) finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 17 Low cohesion finding(s) in Cohesion (LCOM4) — start with GitRepository.swift (2), SwiftTestCommand.swift (2), LLBuildManifestWriter.swift. — One of this dimension's main actionable groups (17 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D8 · Code Coverage7.8 / 10Strong✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 41.4% — 9 file(s) below 50%. Measured from the Swift suite (.: no coverage export; Examples/package-registry: no coverage export; Fixtures/CommandPluginTestProductArtifacts: `swift test --enable-code-coverage` over 1 production file(s); Tests/ExtraTests: no coverage export; Fixtures/CFamilyTargets/CLibrarySources: no coverage export; Fixtures/CFamilyTargets/MixedExecutableTestTarget: no coverage export; Fixtures/CFamilyTargets/MixedLibraryTestTarget: no coverage export; Fixtures/CFamilyTargets/MixedSourceTestTarget: no coverage export; Fixtures/CFamilyTargets/ObjCmacOSPackage: no coverage export; Fixtures/Coverage/Simple: no coverage export; Fixtures/Macros/MacroWithDirectTestDependency: `swift test --enable-code-coverage` over 2 production file(s); Fixtures/Macros/MinimalMacroPackage: export carried only generated/test rows; Fixtures/Metal/SimpleLibrary: no coverage export; Fixtures/Miscellaneous/CheckTestLibraryEnvironmentVariable: export carried only generated/test rows; Fixtures/Miscellaneous/DefaultInteropMode: no coverage export; Fixtures/Miscellaneous/EchoExecutable: export carried only generated/test rows; Fixtures/Miscellaneous/EmptyTestsPkg: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/ExeTest: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/FlatPackage: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/ImportOfMissingDependency: no coverage export; Fixtures/Miscellaneous/LibraryWithTestAndDep: `swift test --enable-code-coverage` over 2 production file(s); Fixtures/Miscellaneous/MultipleXCTestSuitesWithFailures: no coverage export; Fixtures/Miscellaneous/NoDefaultInteropMode: no coverage export; Fixtures/Miscellaneous/PackageWithResource: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/ParallelTestsPkg: no coverage export; Fixtures/Miscellaneous/RespectUserInteropMode: no coverage export; Fixtures/Miscellaneous/SkipTests: export carried only generated/test rows; Fixtures/Miscellaneous/SwiftPMXCTestHelper: export carried only generated/test rows; Fixtures/Miscellaneous/TestDebugging: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/TestDebuggingMultiProduct: `swift test --enable-code-coverage` over 2 production file(s); Fixtures/Miscellaneous/TestMixedFailuresAcrossTargets: no coverage export; Fixtures/Miscellaneous/TestMultipleFailureSwiftTesting: no coverage export; Fixtures/Miscellaneous/TestMultipleFailureXCTest: no coverage export; Fixtures/Miscellaneous/TestSingleFailureSwiftTesting: no coverage export; Fixtures/Miscellaneous/TestSingleFailureXCTest: no coverage export; Fixtures/Miscellaneous/TestTargetDependsOnTestTarget: no coverage export; Fixtures/Miscellaneous/TestWithDynamicDep: export carried only generated/test rows; Fixtures/Miscellaneous/TestableAsyncExe: `swift test --enable-code-coverage` over 4 production file(s); Fixtures/Miscellaneous/TestableExe: `swift test --enable-code-coverage` over 2 production file(s); Fixtures/Miscellaneous/TestableExeWithDifferentProductName: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/TestableExeWithResources: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/Unicode: no coverage export; Fixtures/PIFBuilder/Library: no coverage export; Fixtures/PIFBuilder/Simple: no coverage export; Fixtures/Resources/Simple: no coverage export; Fixtures/SwiftMigrate/ExistentialAnyMigration: no coverage export; Fixtures/SwiftMigrate/ExistentialAnyWithCommonPluginDependencyMigration: no coverage export; Fixtures/SwiftMigrate/ExistentialAnyWithPluginMigration: no coverage export; Fixtures/SwiftMigrate/InferIsolatedConformancesMigration: no coverage export; Fixtures/SwiftMigrate/StrictMemorySafetyMigration: no coverage export; Fixtures/Traits/Example: `swift test --enable-code-coverage` over 4 production file(s); Fixtures/WebAssembly/MinimalWebAssemblyMacroPackage: export carried only generated/test rows; Fixtures/WebAssembly/MinimalWebAssemblyPluginPackage: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/DynamicProduct/exec: no coverage export; Fixtures/Miscellaneous/MultiRootInteropMode/Pkg6_3: no coverage export; Fixtures/Miscellaneous/MultiRootInteropMode/Pkg6_4: no coverage export; Fixtures/Miscellaneous/MultiRootInteropMode/PkgAlso6_4: no coverage export; Fixtures/Miscellaneous/Plugins/CommandPluginTestStub: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/Plugins/IncorrectDependencies: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/Plugins/LibraryWithLocalBuildToolPluginUsingRemoteTool: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/Plugins/MySourceGenClient: no coverage export; Fixtures/Miscellaneous/Plugins/MySourceGenPlugin: no coverage export; Fixtures/Miscellaneous/Plugins/MySourceGenPluginNoPreBuildCommands: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/Plugins/MySourceGenPluginUsingURLBasedAPI: no coverage export; Fixtures/Miscellaneous/TargetPackageAccess/libPkg: `swift test --enable-code-coverage` over 3 production file(s); Fixtures/Miscellaneous/TestDiscovery/Async: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/Deprecation: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/Miscellaneous/TestDiscovery/Extensions: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/IgnoresLinuxMain: no coverage export; Fixtures/Miscellaneous/TestDiscovery/NoTests: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/Simple: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/Subclass: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/SwiftTesting: export carried only generated/test rows; Fixtures/Miscellaneous/TestDiscovery/hello world: `swift test --enable-code-coverage` over 1 production file(s); Fixtures/PIFBuilder/UnhandledFiled/App: no coverage export; Fixtures/PIFBuilder/UnhandledFiled/Dependent1: no coverage export; Fixtures/PIFBuilder/UnhandledFiled/Dependent2: no coverage export; Fixtures/XCBuild/TestProducts/Foo: no coverage export; Fixtures/Miscellaneous/Errors/FatalErrorInSingleXCTest/TypeLibrary: no coverage export; Fixtures/Miscellaneous/Plugins/PluginUsingLocalAndRemoteTool/MyLibrary: `swift test --enable-code-coverage` over 1 production file(s)).
Resolve the 9 Low coverage finding(s) in Code Coverage — start with StringifyMacro.swift, MacroImplHelpers.swift, EmptyTestsPkg.swift. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality7.3 / 10Adequategated by 17 critical findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
351 skipped (194 with a documented reason), 481 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3146 tests (3 harness-style project(s) excluded from the assertion penalty).
No assertions (empty test): versionSpecificManifests · ×7Tests/WorkspaceTests/ToolsVersionSpecificationRewriterTests.swift:174
Assertions commented out: example · ×5Fixtures/Metal/SimpleLibrary/Tests/MyRendererTests/MyRendererTests.swift:4
Test project verifies nothing: AppTests · ×5Fixtures/PIFBuilder/UnhandledFiled/App/Tests/AppTests/AppTests.swift:4
No assertions: testBasicAPIs · ×323Tests/BasicsTests/AuthorizationProviderTests.swift:18
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 No assertions (empty test) finding(s) in Test Quality — start with SwiftPMXCTestHelperTests.swift (2), SwiftTests.swift (2), ToolsVersionSpecificationRewriterTests.swift. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 5 Assertions commented out finding(s) in Test Quality — start with MyRendererTests.swift, LibraryTests.swift, AppTests.swift. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 5 Test project verifies nothing finding(s) in Test Quality — start with AppTests.swift, Dependent1Tests.swift, Dependent2Tests.swift. — One of this dimension's main actionable groups (5 issue-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 15 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 0 of them read from the licence file the repository carries at the revision Package.resolved pins, and 15 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins. 61 of them are declared by a manifest that commits no Package.resolved (a library, whose resolution is its consumer's), so their own dependencies are resolved by whoever builds it and are not in this verdict. ★ 25 package(s) could not be read at a pinned revision and are not known to the index, and were NOT graded — this verdict does not cover them: `b`, `bar`, `barpkg`, `baz`, `c`, `cfake`, `cfoo`, `csystemmodule`, `deck-of-playing-cards`, `dep1`, ….
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 12 Hotspot finding(s) in Churn × Complexity Hotspots — start with SwiftBuildSystem.swift, PackagePIFProjectBuilder+Modules.swift, PackageBuilder.swift. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.6 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
17 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/Basics/HTTPClient/HTTPClient.swift. Counted over 406 of the 585 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
440 deducted task-comment markers across 155484 LoC (0.3/KLoC) → score 9.4. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 283 FixmeComment finding(s) in Explicit Debt — start with Observability.swift (15), BuildPlanTests.swift (7), GitRepository.swift (7). — One of this dimension's main actionable groups (283 warning-level).
Resolve the 155 TodoComment finding(s) in Explicit Debt — start with MiscellaneousTests.swift (8), PIFBuilder.swift (7), SwiftBuildSystem.swift (6). — One of this dimension's main actionable groups (155 warning-level).
Resolve the 1 XxxComment finding(s) in Explicit Debt — start with ManifestSignatureParserTests.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
3 naming inconsistencies among 34 declarations measured against a convention their peers follow.
`getReplProductName` spells `Repl` where 12 names in the project spell it `REPL`Sources/PackageGraph/ModulesGraph.swift:289
`DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project spell it `API`Sources/_InternalTestSupport/SwiftTesting+Tags.swift:199
`ExperimentalApiDiff` spells `Api` where 22 names in the project spell it `API`Sources/_InternalTestSupport/SwiftTesting+Tags.swift:203
What to do
Resolve the 1 `getReplProductName` spells `Repl` where 12 names in the project spell… finding(s) in Naming Consistency — start with ModulesGraph.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `ExperimentalApiDiff` spells `Api` where 22 names in the project spell… finding(s) in Naming Consistency — start with SwiftTesting+Tags.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
1 of 3 build units (SwiftPM) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
7 finding(s): 0 critical, 7 high, 0 medium, 0 low. 6 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 7 file(s) — `Fixtures/Miscellaneous/CXX17CompilerCrash/v5_7/include/user_objects.h` (line 144, line 145, line 146, …), `Fixtures/Miscellaneous/CXX17CompilerCrash/v5_8/include/user_objects.h` (line 144, line 145, line 146, …), `Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift` (line 167, line 194, line 213, …), `Sources/SwiftBuildSupport/PackagePIFBuilder.swift` (line 249, line 283, line 463, …), `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift` (line 223, line 225, line 402, …), … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 6 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (6 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 56 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (6), REDACTED (6). — One of this dimension's main actionable groups (56 warning-level).
Resolve the 6 High IaC finding(s) in IaC & Container Security — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
173 of 406 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/XCBuildSupport/PIF.swift. Counted over 406 of the 585 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 161 Orphaned file finding(s) in Knowledge Freshness — start with Diagnostics.swift (2), X509Extensions.swift (2), PackageCollectionsCommand.swift. — One of this dimension's main actionable groups (161 recommendation-level).
Resolve the 12 Orphaned knowledge finding(s) in Knowledge Freshness — start with PIF.swift, PackageDependency.swift, SBOMValidator.swift. — One of this dimension's main actionable groups (12 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a typed-id struct) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`Node.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/Commands/Utilities/MermaidPackageSerializer.swift:81
`DefaultCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. (×2) — Sources/PackageCollectionsSigning/CertificatePolicy.swift:133, Sources/Workspace/ManifestSigning/CertificatePolicy.swift:133
`ADPSwiftPackageCollectionCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. (×2) — Sources/PackageCollectionsSigning/CertificatePolicy.swift:207, Sources/Workspace/ManifestSigning/CertificatePolicy.swift:208
`ADPAppleDistributionCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageCollectionsSigning/CertificatePolicy.swift:283
`_SubjectNamePolicy.expectedUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageCollectionsSigning/CertificatePolicy.swift:449
`DistinguishedName.userID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageCollectionsSigning/X509Extensions.swift:48
`ModuleInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageGraph/ModuleAliasTracker.swift:48
`ProductModules.productId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageGraph/ModuleAliasTracker.swift:69
`ProductModules.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageGraph/ModuleAliasTracker.swift:92
`ReachableModule.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageGraph/ModuleAliasTracker.swift:99
`ProposedAlias.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageGraph/ModuleAliasTracker.swift:179
`EnabledTrait.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageModel/EnabledTrait.swift:407
`Product.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageModel/Product.swift:19
`ToolchainConfiguration.metalToolchainId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageModel/ToolchainConfiguration.swift:55
`UserToolchain.metalToolchainId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/PackageModel/UserToolchain.swift:1367
`XcodeProject.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/Runtimes/PackagePlugin/Plugin.swift:475
`XcodeTarget.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/Runtimes/PackagePlugin/Plugin.swift:487
`CycloneDXLicenseInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/CycloneDX/CycloneDXLicense.swift:14
`SPDXAgent.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXAgent.swift:14
`SPDXAgent.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXAgent.swift:17
`SPDXConstants.spdxRootCreationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXConstants.swift:31
`SPDXCreationInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXCreationInfo.swift:14
`SPDXDocument.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXDocument.swift:14
`SPDXDocument.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXDocument.swift:16
`SPDXLicenseExpression.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXLicenseExpression.swift:14
`SPDXLicenseExpression.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXLicenseExpression.swift:17
`SPDXPackage.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXPackage.swift:21
`SPDXPackage.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXPackage.swift:27
`SPDXRelationship.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXRelationship.swift:24
`SPDXRelationship.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXRelationship.swift:27
`SPDXRelationship.parentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXRelationship.swift:28
`SPDXRelationship.childrenID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXRelationship.swift:29
`SPDXSBOM.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXSBOM.swift:14
`SPDXSBOM.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SBOMModel/SPDX/SPDXSBOM.swift:16
`TraceEvent.processID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SwiftBuildSupport/TraceEventsWriter.swift:103
`LocationContext.taskID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:825
`LocationContext.targetID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:836
`BuildTargetIdentifier.targetGUID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:685
What to do
Adopt the repo's typed-id idiom consistently — wrap every entity identity in its own typed id.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model7.4 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`Target` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. (×2) — Sources/SwiftBuildSupport/PIF.swift:218, Sources/XCBuildSupport/PIF.swift:557
`Workspace` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. (×2) — Sources/Workspace/Workspace.swift:77, Sources/XCBuildSupport/PIF.swift:89
What to do
Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM on its own declaration (active-record), or reaching a web-framework transport type in its own method, couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
1 ADR-shaped document(s) detected by content — `Documentation/Design/RefactoredModuleAliasTracker.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Sources/PackageModel/README.md links to `../PackageDescription/README.md`, but `Sources/PackageDescription/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Sources/PackageModel/README.md:13
What to do
Reconcile the README with reality: Sources/PackageModel/README.md links to `../PackageDescription/README.md`, but `Sources/PackageDescription/README.md` does not exist.
Only 2/147 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `Fixtures/CFamilyTargets/CLibraryNoIncludeDir`, `Fixtures/CFamilyTargets/CLibraryWithSpaces`, `Fixtures/CFamilyTargets/MixedCxxUsesSwiftHeader`, `Fixtures/CFamilyTargets/MixedExecutableTestTarget`, `Fixtures/CFamilyTargets/MixedLanguageClient` and 140 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`run` is async and calls .wait() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. (×2) — Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift:112, Sources/SwiftSDKCommand/SwiftSDKSubcommand.swift:58
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×25) — Sources/Workspace/ResolverPrecomputationProvider.swift:134, Sources/Workspace/PackageContainer/RegistryPackageContainer.swift:71, Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:425, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — Sources/PackageModel/MinimumDeploymentTarget.swift:95, Sources/PackageLoading/Platform.swift:76, Sources/Commands/PackageCommands/SwiftPackageCommand.swift:141
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 70 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — runtime-setup Warning pull access denied for swift-package-manager, repository does not exist or may require 'docker login': denied: requested access to the resource is denied failed to solve: process "/bin/sh -c wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -" did not complete successfully: exit code: 2; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D12 Dependency Hygiene — Not scored — 144 SwiftPM declaration(s) across 343 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (31 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D32 Data Compliance (PII/GDPR) — 199 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 35 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — swift (155,360 lines), c (4,225 lines), objectivec (120 lines), cpp (62 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X19 Unrestored process-global state — X19 reached only 0% of this repository's production lines — swift (155,360 lines), c (4,225 lines), objectivec (120 lines), cpp (62 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — X23 reached only 0% of this repository's production lines — swift (155,360 lines), c (4,225 lines), objectivec (120 lines), cpp (62 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — X4 reached only 0% of this repository's production lines — swift (155,360 lines), c (4,225 lines), objectivec (120 lines), cpp (62 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 86 finding(s)
DM2 · Strongly-typed ids· Raw-primitive id despite a typed-id idiom · ×40
Raw-primitive id despite a typed-id idiom: Node.id Sources/Commands/Utilities/MermaidPackageSerializer.swift:81— `Node.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: DefaultCertificatePolicy.expectedSubjectUserID Sources/PackageCollectionsSigning/CertificatePolicy.swift:133— `DefaultCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ADPSwiftPackageCollectionCertificatePolicy.expectedSubjectUserID Sources/PackageCollectionsSigning/CertificatePolicy.swift:207— `ADPSwiftPackageCollectionCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ADPAppleDistributionCertificatePolicy.expectedSubjectUserID Sources/PackageCollectionsSigning/CertificatePolicy.swift:283— `ADPAppleDistributionCertificatePolicy.expectedSubjectUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: _SubjectNamePolicy.expectedUserID Sources/PackageCollectionsSigning/CertificatePolicy.swift:449— `_SubjectNamePolicy.expectedUserID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: DistinguishedName.userID Sources/PackageCollectionsSigning/X509Extensions.swift:48— `DistinguishedName.userID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ModuleInfo.id Sources/PackageGraph/ModuleAliasTracker.swift:48— `ModuleInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ProductModules.productId Sources/PackageGraph/ModuleAliasTracker.swift:69— `ProductModules.productId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ProductModules.id Sources/PackageGraph/ModuleAliasTracker.swift:92— `ProductModules.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ReachableModule.id Sources/PackageGraph/ModuleAliasTracker.swift:99— `ReachableModule.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ProposedAlias.id Sources/PackageGraph/ModuleAliasTracker.swift:179— `ProposedAlias.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: EnabledTrait.id Sources/PackageModel/EnabledTrait.swift:407— `EnabledTrait.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Product.id Sources/PackageModel/Product.swift:19— `Product.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: ToolchainConfiguration.metalToolchainId Sources/PackageModel/ToolchainConfiguration.swift:55— `ToolchainConfiguration.metalToolchainId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: UserToolchain.metalToolchainId Sources/PackageModel/UserToolchain.swift:1367— `UserToolchain.metalToolchainId` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: XcodeProject.id Sources/Runtimes/PackagePlugin/Plugin.swift:475— `XcodeProject.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: XcodeTarget.id Sources/Runtimes/PackagePlugin/Plugin.swift:487— `XcodeTarget.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: CycloneDXLicenseInfo.id Sources/SBOMModel/CycloneDX/CycloneDXLicense.swift:14— `CycloneDXLicenseInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXAgent.id Sources/SBOMModel/SPDX/SPDXAgent.swift:14— `SPDXAgent.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXAgent.creationInfoID Sources/SBOMModel/SPDX/SPDXAgent.swift:17— `SPDXAgent.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXConstants.spdxRootCreationInfoID Sources/SBOMModel/SPDX/SPDXConstants.swift:31— `SPDXConstants.spdxRootCreationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXCreationInfo.id Sources/SBOMModel/SPDX/SPDXCreationInfo.swift:14— `SPDXCreationInfo.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXDocument.id Sources/SBOMModel/SPDX/SPDXDocument.swift:14— `SPDXDocument.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXDocument.creationInfoID Sources/SBOMModel/SPDX/SPDXDocument.swift:16— `SPDXDocument.creationInfoID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: SPDXLicenseExpression.id Sources/SBOMModel/SPDX/SPDXLicenseExpression.swift:14— `SPDXLicenseExpression.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Orphaned knowledge Sources/XCBuildSupport/PIF.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/Runtimes/PackageDescription/PackageDependency.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/SBOMModel/Validator/SBOMValidator.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/Runtimes/PackageDescription/Product.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageCollections/PackageCollections.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageCollectionsSigning/CertificatePolicy.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageLoading/PkgConfig.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageGraph/ResolvedPackagesStore.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageModel/PackageIdentity.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge Sources/Workspace/Workspace+Delegation.swift:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D10 · Test Quality· No assertions (empty test) · ×7
No assertions (empty test): versionSpecificManifests Tests/WorkspaceTests/ToolsVersionSpecificationRewriterTests.swift:174— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testExample1 Fixtures/Miscellaneous/SwiftPMXCTestHelper/Tests/SwiftPMXCTestHelperTests/SwiftPMXCTestHelperTests.swift:6— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): test_Example2 Fixtures/Miscellaneous/SwiftPMXCTestHelper/Tests/SwiftPMXCTestHelperTests/SwiftPMXCTestHelperTests.swift:9— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testAsync Fixtures/Miscellaneous/TestDiscovery/Async/Tests/AsyncTests/SwiftTests.swift:7— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testAsyncThrows Fixtures/Miscellaneous/TestDiscovery/Async/Tests/AsyncTests/SwiftTests.swift:10— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): testSomething Fixtures/Miscellaneous/TestDiscovery/IgnoresLinuxMain/Tests/IgnoresLinuxMainTests/SomeTest.swift:4— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): someTestFunction Fixtures/Miscellaneous/TestDiscovery/SwiftTesting/Tests/SwiftTestingTests/SwiftTestingTests.swift:2— Test method has an empty body — it asserts nothing and exercises no code.
Assertions commented out: example Fixtures/Metal/SimpleLibrary/Tests/MyRendererTests/MyRendererTests.swift:4— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: example Fixtures/PIFBuilder/Library/Tests/LibraryTests/LibraryTests.swift:4— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: example Fixtures/PIFBuilder/UnhandledFiled/App/Tests/AppTests/AppTests.swift:4— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: example Fixtures/PIFBuilder/UnhandledFiled/Dependent1/Tests/Dependent1Tests/Dependent1Tests.swift:4— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Assertions commented out: example Fixtures/PIFBuilder/UnhandledFiled/Dependent2/Tests/Dependent2Tests/Dependent2Tests.swift:4— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
D10 · Test Quality· Test project verifies nothing · ×5
Test project verifies nothing: AppTests Fixtures/PIFBuilder/UnhandledFiled/App/Tests/AppTests/AppTests.swift:4— No conventional assertion call was detected in 1 of 1 tests in `AppTests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
Test project verifies nothing: Dependent1Tests Fixtures/PIFBuilder/UnhandledFiled/Dependent1/Tests/Dependent1Tests/Dependent1Tests.swift:4— No conventional assertion call was detected in 1 of 1 tests in `Dependent1Tests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
Test project verifies nothing: Dependent2Tests Fixtures/PIFBuilder/UnhandledFiled/Dependent2/Tests/Dependent2Tests/Dependent2Tests.swift:4— No conventional assertion call was detected in 1 of 1 tests in `Dependent2Tests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
Test project verifies nothing: LibraryTests Fixtures/PIFBuilder/Library/Tests/LibraryTests/LibraryTests.swift:4— No conventional assertion call was detected in 1 of 1 tests in `LibraryTests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
Test project verifies nothing: MyRendererTests Fixtures/Metal/SimpleLibrary/Tests/MyRendererTests/MyRendererTests.swift:4— No conventional assertion call was detected in 1 of 1 tests in `MyRendererTests` — the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off — it is not an approval/verifier harness.
DM4 · Rich vs anemic domain model· Anemic domain model · ×4
Anemic domain model: Target Sources/SwiftBuildSupport/PIF.swift:218— `Target` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: Workspace Sources/Workspace/Workspace.swift:77— `Workspace` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: Workspace Sources/XCBuildSupport/PIF.swift:89— `Workspace` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
Anemic domain model: Target Sources/XCBuildSupport/PIF.swift:557— `Target` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
No assertions: testBasicAPIs Tests/BasicsTests/AuthorizationProviderTests.swift:18— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: closingMoreThanOnceSucceeds Tests/BasicsTests/SQLiteTests.swift:39— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: preparingConcurrentlyWithCloseDoesNotUseFreedHandle Tests/BasicsTests/SQLiteTests.swift:60— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: WASI Tests/BasicsTests/TripleTests.swift:302— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testModuleAliasingEmptyAlias Tests/BuildTests/ModuleAliasingBuildTests.swift:30— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testModuleAliasingInvalidIdentifierAlias Tests/BuildTests/ModuleAliasingBuildTests.swift:80— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testModuleAliasingInvalidSourcesUpstream Tests/BuildTests/ModuleAliasingBuildTests.swift:1006— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testModuleAliasingInvalidSourcesNestedUpstream Tests/BuildTests/ModuleAliasingBuildTests.swift:1061— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testEnableTestingSetup Tests/BuildTests/PrepareForIndexTests.swift:98— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: parse Tests/BuildTests/SwiftCompilerOutputParserTests.swift:18— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: rawTextTransformsIntoUnknown Tests/BuildTests/SwiftCompilerOutputParserTests.swift:152— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: signalledStopsParsing Tests/BuildTests/SwiftCompilerOutputParserTests.swift:180— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStripProductsGeneratesErrorWhenUsedWithXcodeBuildSystemAndConfiguration Tests/CommandsTests/BuildCommandTests.swift:247— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testStripProductsGeneratesErrorWhenUsedWithUnsupportedBuildSystemAndConfiguration Tests/CommandsTests/BuildCommandTests.swift:261— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: binSymlink Tests/CommandsTests/BuildCommandTests.swift:308— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: buildExistingTestTargetIsSuccessful Tests/CommandsTests/BuildCommandTests.swift:644— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: pifManifestFileIsCreatedInTheRootScratchPathDirectory Tests/CommandsTests/BuildCommandTests.swift:1036— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ignoresLinuxMain Tests/CommandsTests/BuildCommandTests.swift:1974— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: executableTargetIntegratedIntoTwoProducts Tests/CommandsTests/BuildCommandTests.swift:2372— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: buildWithAllSBOMEnvironmentVariables Tests/CommandsTests/BuildCommandTests.swift:2784— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: htmlCoverageReportRespectsXcovOutputDirOverride Tests/CommandsTests/CoverageTests.swift:730— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: symlinkedDependency Tests/CommandsTests/PackageCommandTests.swift:4223— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: initEmpty Tests/CommandsTests/PackageCommandTests.swift:2380— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: packageAddURLDependency Tests/CommandsTests/PackageCommandTests.swift:2700— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: packageAddPathDependency Tests/CommandsTests/PackageCommandTests.swift:2790— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
FixmeComment Tests/WorkspaceTests/ResolvedPackagesStoreTests.swift:142— // FIXME: use scope identifier — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/WorkspaceTests/WorkspaceTests.swift:12164— // FIXME: rdar://72940946 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/WorkspaceTests/WorkspaceTests.swift:12852— // FIXME: rdar://72940946 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/WorkspaceTests/WorkspaceTests.swift:12927— // FIXME: rdar://72940946 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/SourceControlTests/GitRepositoryTests.swift:192— // FIXME: It would be nice if we had a deterministic hash here... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageRegistryTests/SignatureValidationTests.swift:19— // FIXME: need this import or else SwiftSigningIdentity init crashes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift:677— // FIXME: does this actually trigger only on Windows or are other — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageLoadingTests/PD_5_6_LoadingTests.swift:257— // FIXME: temporary filter a diagnostic that shows up on macOS 14.0 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageLoadingTests/PackageBuilderTests.swift:1543— // FIXME: there is a memory leak here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageLoadingTests/PackageBuilderTests.swift:3980— // FIXME: We should allow customizing root package boolean. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageGraphTests/PubGrubTests.swift:456— // FIXME: This leads to fatal error. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageGraphTests/PubGrubTests.swift:3269— // FIXME: This should produce a valid solution but cannot at the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageGraphTests/PubGrubTests.swift:3429— // FIXME: this is not thread-safe — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageGraphTests/PubGrubTests.swift:3503— // FIXME: This is messy, remove unversionedDeps property. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/PackageGraphTests/ResolvedTargetTests.swift:131— // FIXME: we should test for actual `t2` and `t2NoConditions` equality, but `SwiftTarget` is a reference type, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/LLBuildManifestTests/LLBuildManifestTests.swift:69— // FIXME(#5475) - use the platform's preferred separator for directory
FixmeComment Tests/FunctionalTests/MiscellaneousTests.swift:703— // FIXME: this test requires swift-driver to be installed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalTests/PluginTests.swift:477— // FIXME: This test is getting quite long — we should add some support functionality for creating synthetic plugin tests and factor this out into separate tests. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalTests/TestDiscoveryTests.swift:121— // FIXME: eliminate extraneous warnings with --build-system swiftbuild — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalTests/TestDiscoveryTests.swift:154— // FIXME: --build-system swiftbuild should support hand-authored entry points. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalTests/VersionSpecificTests.swift:76— // FIXME: We end up filtering this manifest if it has an invalid — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalPerformanceTests/BuildPerfTests.swift:13— // FIXME: re-enable when `measure` supports `async` or replace with lower level benchmarks — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/FunctionalPerformanceTests/BuildPerfTests.swift:26— // // FIXME: We should pass the SWIFT_EXEC at lower level. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/CommandsTests/BuildCommandTests.swift:951— // FIXME: We create the modulemap during build planning, hence this ugliness. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/WorkspaceTests/WorkspaceStateTests.swift:456— // TODO: test for diagnostics when we can get them from the WorkspaceState initializer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/WorkspaceTests/WorkspaceStateTests.swift:517— // TODO: test for diagnostics when we can get them from the WorkspaceState initializer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/WorkspaceTests/WorkspaceTests.swift:15155— // TODO: this error message should be improved — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/SwiftBuildSupportTests/CGenPIFTests.swift:97— // TODO: this should be made a utility — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/BuildTests/CGenPluginsBuildPlanTests.swift:103— // TODO: this should be made a utility — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageRegistryTests/RegistryClientTests.swift:2772— // TODO: check metadata — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageRegistryTests/RegistryClientTests.swift:3569— // TODO: implement multipart form parsing — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageRegistryTests/RegistryClientTests.swift:3669— // TODO: implement multipart form parsing — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageRegistryTests/RegistryClientTests.swift:3788— // TODO: implement multipart form parsing — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageModelTests/CanonicalPackageLocationTests.swift:210— // TODO: Implement Punycode conversion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageLoadingTests/PDAppleProductLoadingTests.swift:23— // TODO: confirm this value — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/ModulesGraphTests.swift:2875— // TODO: remove this when we remove explicit dependency name — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/ModulesGraphTests.swift:3080— // TODO: remove this when we remove explicit dependency name — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/ModulesGraphTests.swift:3124— // TODO: remove this when we remove explicit dependency name — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/ModulesGraphTests.swift:3197— // TODO: remove this when we remove explicit dependency name — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/PubGrubTests.swift:266— // TODO: This should probably add derivations to cover that logic as well. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/PubGrubTests.swift:2770— // TODO: this description could use refinement — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/PackageGraphTests/PubGrubTests.swift:3447— // TODO: this does not actually do anything with the tools-version — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/IntegrationTests/BasicTests.swift:51— //TODO: use Test Cancellation when available — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/IntegrationTests/SwiftPMTests.swift:74— // TODO: error.stderr.contains("error: unexpected file type; supported extensions are:") — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/FunctionalTests/MiscellaneousTests.swift:191— // TODO: raise a GitHub issue on — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/FunctionalTests/MiscellaneousTests.swift:339— // TODO: raise GitHub issue — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/FunctionalTests/MiscellaneousTests.swift:449— // TODO: Raise a GitHub issue as Swift Build fails — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/FunctionalTests/MiscellaneousTests.swift:479— // TODO: raise a GitHub issue . the second `swift-build` command fails. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/FunctionalTests/MiscellaneousTests.swift:789— // TODO: raise GitHub issue.. crashed on Linux — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
MethodTooLong: PackagePIFProjectBuilder.makeMainModuleProduct Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— MethodTooLong — makeMainModuleProduct runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TargetDescription.init Sources/PackageModel/Manifest/TargetDescription.swift:216— MethodTooLong — init runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PluginModule.invoke Sources/SPMBuildCore/Plugins/PluginInvocation.swift:86— MethodTooLong — invoke runs 229 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DebugTestRunner.createTargetSwitchingScript Sources/Commands/Utilities/TestingSupport.swift:929— MethodTooLong — createTargetSwitchingScript runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InitPackage.writeManifestFile Sources/Workspace/InitPackage.swift:160— MethodTooLong — writeManifestFile runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AsyncProcess.launch Sources/Basics/Concurrency/AsyncProcess.swift:468— MethodTooLong — launch runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PackageBuilder.buildSettings Sources/PackageLoading/PackageBuilder.swift:1182— MethodTooLong — buildSettings runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PackagePIFProjectBuilder.buildLibraryProduct Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:699— MethodTooLong — buildLibraryProduct runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PackageBuilder.createTarget Sources/PackageLoading/PackageBuilder.swift:869— MethodTooLong — createTarget runs 179 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Workspace.init Sources/Workspace/Workspace.swift:426— MethodTooLong — init runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ManifestLoader.evaluateManifest Sources/PackageLoading/ManifestLoader.swift:699— MethodTooLong — evaluateManifest runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Plugin.handleMessage Sources/Runtimes/PackagePlugin/Plugin.swift:145— MethodTooLong — handleMessage runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UserToolchain.init Sources/PackageModel/UserToolchain.swift:760— MethodTooLong — init runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PIFBuilder.makePIFBuilders Sources/SwiftBuildSupport/PIFBuilder.swift:267— MethodTooLong — makePIFBuilders runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SwiftBuildSystem.startSWBuildOperation Sources/SwiftBuildSupport/SwiftBuildSystem.swift:664— MethodTooLong — startSWBuildOperation runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PluginContextDeserializer.target Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:68— MethodTooLong — target runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SwiftBuildSystem.makeBuildParameters Sources/SwiftBuildSupport/SwiftBuildSystem.swift:922— MethodTooLong — makeBuildParameters runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Workspace.loadDependencyManifests Sources/Workspace/Workspace+Manifests.swift:494— MethodTooLong — loadDependencyManifests runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DebugTestRunner.createFailbreakScript Sources/Commands/Utilities/TestingSupport.swift:726— MethodTooLong — createFailbreakScript runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Workspace._updateDependencies Sources/Workspace/Workspace+Dependencies.swift:63— MethodTooLong — _updateDependencies runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModulesGraph.load Sources/PackageGraph/ModulesGraph+Loading.swift:25— MethodTooLong — load runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SQLitePackageCollectionsStorage.searchTargets Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:426— MethodTooLong — searchTargets runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VersionSetSpecifier.difference Sources/PackageGraph/VersionSetSpecifier.swift:256— MethodTooLong — difference runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RegistryClient.downloadSourceArchive Sources/PackageRegistry/RegistryClient.swift:712— MethodTooLong — downloadSourceArchive runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PluginCommand.run Sources/Commands/PackageCommands/PluginCommand.swift:221— MethodTooLong — run runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: PackageRegistry/RegistryClient.swift Sources/PackageRegistry/RegistryClient.swift— FileTooLong — 1717 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: RegistryClient (33-1493). The bar is 500 significant lines; this is 1217 over it, 3.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: XCBuildSupport/PIFBuilder.swift Sources/XCBuildSupport/PIFBuilder.swift— FileTooLong — 1238 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 738 over it, 2.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: PackageLoading/PackageBuilder.swift Sources/PackageLoading/PackageBuilder.swift— FileTooLong — 1229 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: PackageBuilder (292-1916). The bar is 500 significant lines; this is 729 over it, 2.46× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Workspace/Workspace+State.swift Sources/Workspace/Workspace+State.swift— FileTooLong — 1085 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 585 over it, 2.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Workspace/Workspace.swift Sources/Workspace/Workspace.swift— FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 547 over it, 2.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SourceControl/GitRepository.swift Sources/SourceControl/GitRepository.swift— FileTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 537 over it, 2.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SwiftBuildSupport/SwiftBuildSystem.swift Sources/SwiftBuildSupport/SwiftBuildSystem.swift— FileTooLong — 1030 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: SwiftBuildSystem (268-1554). The bar is 500 significant lines; this is 530 over it, 2.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: CoreCommands/SwiftCommandState.swift Sources/CoreCommands/SwiftCommandState.swift— FileTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: SwiftCommandState (288-1434). The bar is 500 significant lines; this is 519 over it, 2.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Workspace/Workspace+Dependencies.swift Sources/Workspace/Workspace+Dependencies.swift— FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 496 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: PackageGraph/ModulesGraph+Loading.swift Sources/PackageGraph/ModulesGraph+Loading.swift— FileTooLong — 901 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 401 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SwiftBuildSupport/PackagePIFBuilder+Helpers.swift Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift— FileTooLong — 895 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 395 over it, 1.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: XCBuildSupport/PIF.swift Sources/XCBuildSupport/PIF.swift— FileTooLong — 851 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: PIF (29-1118). The bar is 500 significant lines; this is 351 over it, 1.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: PackageModel/UserToolchain.swift Sources/PackageModel/UserToolchain.swift— FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: UserToolchain (27-1414). The bar is 500 significant lines; this is 344 over it, 1.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Utilities/TestingSupport.swift Sources/Commands/Utilities/TestingSupport.swift— FileTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: DebugTestRunner (464-1202). The bar is 500 significant lines; this is 326 over it, 1.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: PackageModel/ManifestSourceGeneration.swift Sources/PackageModel/ManifestSourceGeneration.swift— FileTooLong — 813 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 313 over it, 1.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift— FileTooLong — 810 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 310 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Concurrency/AsyncProcess.swift Sources/Basics/Concurrency/AsyncProcess.swift— FileTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 299 over it, 1.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Plugins/PluginInvocation.swift Sources/SPMBuildCore/Plugins/PluginInvocation.swift— FileTooLong — 796 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 296 over it, 1.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SwiftSDKs/SwiftSDK.swift Sources/PackageModel/SwiftSDKs/SwiftSDK.swift— FileTooLong — 772 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 272 over it, 1.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: PackageLoading/ManifestLoader.swift Sources/PackageLoading/ManifestLoader.swift— FileTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: ManifestLoader (264-1047). The bar is 500 significant lines; this is 265 over it, 1.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift— FileTooLong — 755 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 255 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: PackageDescription/Target.swift Sources/Runtimes/PackageDescription/Target.swift— FileTooLong — 729 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: Target (23-1292). The bar is 500 significant lines; this is 229 over it, 1.46× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Workspace/Workspace+BinaryArtifacts.swift Sources/Workspace/Workspace+BinaryArtifacts.swift— FileTooLong — 693 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 193 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Workspace/Workspace+Configuration.swift Sources/Workspace/Workspace+Configuration.swift— FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 165 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Workspace/Workspace+Manifests.swift Sources/Workspace/Workspace+Manifests.swift— FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 164 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Swallowed exception (caught, then discarded) Sources/Workspace/ResolverPrecomputationProvider.swift:134— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Workspace/PackageContainer/RegistryPackageContainer.swift:71— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:425— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:435— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/SourceControl/GitRepository.swift:1352— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/SourceControl/GitRepository.swift:1363— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/SourceControl/GitRepository.swift:1374— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/SourceControl/GitRepository.swift:1385— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageModel/UserToolchain.swift:283— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageModel/UserToolchain.swift:300— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageModel/UserToolchain.swift:1173— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageLoading/PkgConfig.swift:496— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageLoading/Platform.swift:85— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageLoading/TargetSourcesBuilder.swift:976— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageCollections/PackageIndexAndCollections.swift:275— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:251— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/DriverSupport/DriverSupportUtils.swift:52— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/DriverSupport/DriverSupportUtils.swift:86— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Commands/SwiftRunCommand.swift:328— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Commands/Utilities/PluginDelegate.swift:499— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Commands/Utilities/TestingSupport.swift:512— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Basics/FileSystem/InMemoryFileSystem.swift:237— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Basics/FileSystem/InMemoryFileSystem.swift:250— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Basics/FileSystem/InMemoryFileSystem.swift:263— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Basics/FileSystem/InMemoryFileSystem.swift:276— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
ClassTooLong: RegistryClient Sources/PackageRegistry/RegistryClient.swift:33— ClassTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 634 over it, 2.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PackageBuilder Sources/PackageLoading/PackageBuilder.swift:292— ClassTooLong — 975 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 575 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UserToolchain Sources/PackageModel/UserToolchain.swift:27— ClassTooLong — 829 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 429 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SwiftBuildSystem Sources/SwiftBuildSupport/SwiftBuildSystem.swift:268— ClassTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 426 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PIF Sources/XCBuildSupport/PIF.swift:29— ClassTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 332 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SwiftCommandState Sources/CoreCommands/SwiftCommandState.swift:288— ClassTooLong — 713 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 313 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SQLitePackageCollectionsStorage Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:27— ClassTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 240 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Target Sources/Runtimes/PackageDescription/Target.swift:23— ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 217 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InitPackage Sources/Workspace/InitPackage.swift:21— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 155 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DebugTestRunner Sources/Commands/Utilities/TestingSupport.swift:464— ClassTooLong — 537 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 137 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ManifestLoader Sources/PackageLoading/ManifestLoader.swift:264— ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 130 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PackagePIFProjectBuilder Sources/XCBuildSupport/PIFBuilder.swift:251— ClassTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 129 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SBOMValidator Sources/SBOMModel/Validator/SBOMValidator.swift:94— ClassTooLong — 481 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 81 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModuleAliasTracker Sources/PackageGraph/ModuleAliasTracker.swift:20— ClassTooLong — 459 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 59 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PubGrubDependencyResolver Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:24— ClassTooLong — 459 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 59 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GitRepository Sources/SourceControl/GitRepository.swift:466— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 57 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SignatureValidation Sources/PackageRegistry/SignatureValidation.swift:30— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Workspace Sources/Workspace/Workspace.swift:77— ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 16 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PackagePIFBuilder Sources/SwiftBuildSupport/PackagePIFBuilder.swift:49— ClassTooLong — 412 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 12 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Low cohesion: String (LCOM4 18) Sources/LLBuildManifest/LLBuildManifestWriter.swift:208— String's methods fall into 18 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 18 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MockWorkspaceDelegate (LCOM4 18) Sources/_InternalTestSupport/MockWorkspace.swift:1067— MockWorkspaceDelegate's methods fall into 18 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 18 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PackagePIFBuilderDelegate (LCOM4 16) Sources/SwiftBuildSupport/PIFBuilder.swift:687— PackagePIFBuilderDelegate's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GitFileSystemView (LCOM4 11) Sources/SourceControl/GitRepository.swift:1278— GitFileSystemView's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VirtualFileSystem (LCOM4 10) Sources/Basics/FileSystem/VirtualFileSystem.swift:133— VirtualFileSystem's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Workspace (LCOM4 10) Sources/SwiftBuildSupport/PIF.swift:116— Workspace's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MockPackageContainer (LCOM4 10) Sources/_InternalTestSupport/MockPackageContainer.swift:21— MockPackageContainer's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: InMemoryGitRepository (LCOM4 8) Sources/_InternalTestSupport/InMemoryGitRepository.swift:37— InMemoryGitRepository's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: HashEncoder (LCOM4 7) Sources/QueryEngine/Query.swift:33— HashEncoder's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Collection (LCOM4 6) Sources/Commands/SwiftTestCommand.swift:1839— Collection's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PluginDelegate (LCOM4 5) Sources/Commands/Utilities/PluginDelegate.swift:32— PluginDelegate's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Array (LCOM4 5) Sources/Commands/SwiftTestCommand.swift:2141— Array's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DispatchTimeInterval (LCOM4 4) Sources/Basics/DispatchTimeInterval+Extensions.swift:16— DispatchTimeInterval's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SwiftModuleBuildDescription (LCOM4 4) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:38— SwiftModuleBuildDescription's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Sequence (LCOM4 4) Sources/PackageLoading/PackageBuilder.swift:2043— Sequence's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Optional (LCOM4 4) Sources/PackageModel/ManifestSourceGeneration.swift:1153— Optional's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GitRepository (LCOM4 4) Sources/SourceControl/GitRepository.swift:466— GitRepository's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×16
Edited copy of a member (8 corresponding lines) Sources/PackageModel/Manifest/PackageDependencyDescription.swift:116— Sources/PackageModel/Manifest/PackageDependencyDescription.swift:116-123 | Sources/PackageModel/Manifest/PackageDependencyDescription.swift:172-181 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift:68— Sources/PackageCollections/PackageIndex+Configuration.swift:68-75 | Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:99-106 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Runtimes/PackageDescription/BuildSettings.swift:176— Sources/Runtimes/PackageDescription/BuildSettings.swift:176-183 | Sources/Runtimes/PackageDescription/BuildSettings.swift:347-354 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Basics/FileSystem/TSCAdapters.swift:53— Sources/Basics/FileSystem/TSCAdapters.swift:53-60 | Sources/Basics/FileSystem/TSCAdapters.swift:62-73 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:440— Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:440-447 | Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:449-456 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Basics/Environment/Environment.swift:117— Sources/Basics/Environment/Environment.swift:117-124 | Sources/Basics/Environment/Environment.swift:126-133 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/SourceControl/GitRepository.swift:694— Sources/SourceControl/GitRepository.swift:694-701 | Sources/SourceControl/GitRepository.swift:753-765 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Runtimes/PackageDescription/BuildSettings.swift:73— Sources/Runtimes/PackageDescription/BuildSettings.swift:73-80 | Sources/Runtimes/PackageDescription/BuildSettings.swift:88-96 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Runtimes/PackageDescription/PackageDependency.swift:420— Sources/Runtimes/PackageDescription/PackageDependency.swift:420-427 | Sources/Runtimes/PackageDescription/PackageDependency.swift:483-490 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/PackageModel/IdentityResolver.swift:52— Sources/PackageModel/IdentityResolver.swift:52-59 | Sources/PackageModel/IdentityResolver.swift:61-68 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift:305— Sources/PackageGraph/ResolvedPackagesStore.swift:305-312 | Sources/Workspace/Workspace+State.swift:174-181 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:85— Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:85-99 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:68-75 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/Basics/Concurrency/ThreadSafeArrayStore.swift:33— Sources/Basics/Concurrency/ThreadSafeArrayStore.swift:33-40 | Sources/Basics/Concurrency/ThreadSafeKeyValueStore.swift:134-141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/_InternalTestSupport/PackageGraphTester.swift:184— Sources/_InternalTestSupport/PackageGraphTester.swift:184-194 | Sources/_InternalTestSupport/PackageGraphTester.swift:278-285 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:301— Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:301-308 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:317-327 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/_InternalTestSupport/PackageGraphTester.swift:59— Sources/_InternalTestSupport/PackageGraphTester.swift:59-66 | Sources/_InternalTestSupport/PackageGraphTester.swift:68-75 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10 lines × 2) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:409— Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:409-418 | Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:421-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) Sources/Commands/SwiftTestCommand.swift:1096— Sources/Commands/SwiftTestCommand.swift:1096-1105 | Sources/Commands/Utilities/PluginDelegate.swift:344-353 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Commands/SwiftTestCommand.swift:1095` calls `codeCovDataFile` and `Sources/Commands/Utilities/PluginDelegate.swift:343` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) Sources/PackageLoading/ManifestSignatureParser.swift:72— Sources/PackageLoading/ManifestSignatureParser.swift:72-81 | Sources/PackageLoading/ManifestSignatureParser.swift:96-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/Runtimes/PackagePlugin/Command.swift:220— Sources/Runtimes/PackagePlugin/Command.swift:220-229 | Sources/Runtimes/PackagePlugin/Command.swift:263-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackagePlugin/Command.swift:220` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/SourceControl/GitRepository.swift:245— Sources/SourceControl/GitRepository.swift:245-255 | Sources/SourceControl/GitRepository.swift:625-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SourceControl/GitRepository.swift:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:927— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:927-936 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:467-476 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:357— Sources/PackageLoading/ManifestJSONParser.swift:357-366 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:459-468 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:132— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:132-141 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:187-196 — before extracting anything, compare `Sources/PackageCollectionsSigning/PackageCollectionSigning.swift` and `Sources/Workspace/ManifestSigning/ManifestSigning.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) Sources/PackageRegistry/RegistryDownloadsManager.swift:258— Sources/PackageRegistry/RegistryDownloadsManager.swift:258-267 | Sources/SourceControl/RepositoryManager.swift:506-515 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:496— Sources/PackageLoading/ManifestJSONParser.swift:496-505 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:598-607 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/_InternalBuildTestSupport/PIFTester.swift:383— Sources/_InternalBuildTestSupport/PIFTester.swift:383-392 | Sources/_InternalBuildTestSupport/PIFTester.swift:395-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalBuildTestSupport/PIFTester.swift:383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/_InternalTestSupport/ManifestExtensions.swift:278— Sources/_InternalTestSupport/ManifestExtensions.swift:278-287 | Sources/_InternalTestSupport/ManifestExtensions.swift:303-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/_InternalTestSupport/MockPackage.swift:89— Sources/_InternalTestSupport/MockPackage.swift:89-98 | Sources/_InternalTestSupport/MockPackage.swift:116-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackage.swift:89` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/_InternalTestSupport/MockPackageGraphs.swift:95— Sources/_InternalTestSupport/MockPackageGraphs.swift:95-104 | Sources/_InternalTestSupport/MockPackageGraphs.swift:176-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageGraphs.swift:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) Sources/_InternalTestSupport/XCTAssertHelpers.swift:182— Sources/_InternalTestSupport/XCTAssertHelpers.swift:182-191 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:213-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/XCTAssertHelpers.swift:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/_InternalBuildTestSupport/PIFTester.swift:84— Sources/_InternalBuildTestSupport/PIFTester.swift:84-93 | Sources/_InternalBuildTestSupport/PIFTester.swift:129-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalBuildTestSupport/PIFTester.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/Basics/AuthorizationProvider.swift:424— Sources/Basics/AuthorizationProvider.swift:424-436 | Sources/Basics/AuthorizationProvider.swift:457-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/AuthorizationProvider.swift:424` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) Sources/Basics/HTTPClient/HTTPClientRequest.swift:22— Sources/Basics/HTTPClient/HTTPClientRequest.swift:22-34 | Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift:22-34 — before extracting anything, compare `Sources/Basics/HTTPClient/HTTPClientRequest.swift` and `Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:340— Sources/PackageLoading/ManifestJSONParser.swift:340-352 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:442-454 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) Sources/PackageLoading/ManifestLoader.swift:306— Sources/PackageLoading/ManifestLoader.swift:306-318 | Sources/_InternalTestSupport/MockManifestLoader.swift:53-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageLoading/ManifestLoader.swift:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/PackageModel/UserToolchain.swift:539— Sources/PackageModel/UserToolchain.swift:539-552 | Sources/PackageModel/UserToolchain.swift:555-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:41— Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:41-53 | Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:57-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:41` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) Sources/SourceControl/GitRepository.swift:231— Sources/SourceControl/GitRepository.swift:231-243 | Sources/SourceControl/GitRepository.swift:611-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SourceControl/GitRepository.swift:231` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1126— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1126-1138 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1199-1211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:378— Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:378-390 | Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:399-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:415` calls `loadManifest` and `Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:391` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) Sources/Workspace/Workspace+Dependencies.swift:335— Sources/Workspace/Workspace+Dependencies.swift:335-347 | Sources/Workspace/Workspace+Dependencies.swift:389-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Workspace/Workspace+Dependencies.swift:335` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Workspace/Workspace+Dependencies.swift:402` calls `exists` and `Sources/Workspace/Workspace+Dependencies.swift:348` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) Sources/swift-bootstrap/main.swift:214— Sources/swift-bootstrap/main.swift:214-226 | Sources/swift-bootstrap/main.swift:228-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/swift-bootstrap/main.swift:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/PackageModel/ToolsVersion.swift:110— Sources/PackageModel/ToolsVersion.swift:110-122 | Sources/PackageModel/ToolsVersion.swift:128-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Sources/SBOMModel/SPDX/SPDXDocument.swift:20— Sources/SBOMModel/SPDX/SPDXDocument.swift:20-32 | Sources/SBOMModel/SPDX/SPDXSBOM.swift:20-32 — before extracting anything, compare `Sources/SBOMModel/SPDX/SPDXDocument.swift` and `Sources/SBOMModel/SPDX/SPDXSBOM.swift` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) Sources/_IntegrationTestSupport/Helpers.swift:132— Sources/_IntegrationTestSupport/Helpers.swift:132-144 | Sources/_IntegrationTestSupport/Helpers.swift:149-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_IntegrationTestSupport/Helpers.swift:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/_InternalTestSupport/misc.swift:132— Sources/_InternalTestSupport/misc.swift:132-144 | Sources/_InternalTestSupport/misc.swift:240-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) Sources/Basics/Concurrency/AsyncProcess.swift:516— Sources/Basics/Concurrency/AsyncProcess.swift:516-523 | Sources/Basics/Concurrency/AsyncProcess.swift:531-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Concurrency/AsyncProcess.swift:516` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Basics/HTTPClient/LegacyHTTPClient.swift:345— Sources/Basics/HTTPClient/LegacyHTTPClient.swift:345-352 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:360-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/HTTPClient/LegacyHTTPClient.swift:345` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:485— Sources/PackageLoading/ManifestJSONParser.swift:485-492 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:587-594 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) Sources/PackageModel/UserToolchain.swift:1030— Sources/PackageModel/UserToolchain.swift:1030-1037 | Sources/PackageModel/UserToolchain.swift:1042-1049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Sources/PackageModel/WindowsToolchainInfo.swift:56— Sources/PackageModel/WindowsToolchainInfo.swift:56-63 | Sources/PackageModel/WindowsToolchainInfo.swift:108-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/WindowsToolchainInfo.swift:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Runtimes/PackageDescription/PackageDependency.swift:343— Sources/Runtimes/PackageDescription/PackageDependency.swift:343-350 | Sources/Runtimes/PackageDescription/PackageDependency.swift:918-925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/Runtimes/PackageDescription/PackageDependency.swift:797— Sources/Runtimes/PackageDescription/PackageDependency.swift:797-804 | Sources/Runtimes/PackageDescription/PackageDependency.swift:974-981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:389— Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:389-396 | Sources/SPMBuildCore/Plugins/PluginInvocation.swift:1019-1026 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) Sources/SourceControl/GitRepository.swift:1174— Sources/SourceControl/GitRepository.swift:1174-1181 | Sources/SourceControl/GitRepository.swift:1188-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SourceControl/GitRepository.swift:1174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:575— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:575-582 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1214-1221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/PackageModel/Module/Module.swift:109— Sources/PackageModel/Module/Module.swift:109-116 | Sources/_InternalTestSupport/PackageGraphTester.swift:307-314 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) Sources/SourceControl/GitRepository.swift:1811— Sources/SourceControl/GitRepository.swift:1811-1818 | Sources/SourceControl/Repository.swift:60-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:509— Sources/PackageLoading/ManifestJSONParser.swift:509-516 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:611-618 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:164— Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:164-171 | Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:219-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Examples/package-registry/Sources/RegistryExample/Auth/Application+UserStore.swift:26— Examples/package-registry/Sources/RegistryExample/Auth/Application+UserStore.swift:26-33 | Examples/package-registry/Sources/RegistryExample/Storage/Application+Registry.swift:27-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×14
Edited copy of a member (10 corresponding lines) Sources/Basics/SQLiteBackedCache.swift:142— Sources/Basics/SQLiteBackedCache.swift:142-151 | Sources/Basics/SQLiteBackedCache.swift:153-162 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/PackageModel/DependencyMapper.swift:253— Sources/PackageModel/DependencyMapper.swift:253-262 | Sources/PackageModel/DependencyMapper.swift:264-273 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/Basics/HTTPClient/LegacyHTTPClient.swift:294— Sources/Basics/HTTPClient/LegacyHTTPClient.swift:294-303 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:319-328 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:48— Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:48-61 | Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:66-75 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/Basics/Concurrency/ThreadSafeKeyValueStore.swift:25— Sources/Basics/Concurrency/ThreadSafeKeyValueStore.swift:25-34 | Sources/Basics/Concurrency/ThreadSafeKeyValueStore.swift:44-53 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/SwiftBuildSupport/TraceEventsWriter.swift:231— Sources/SwiftBuildSupport/TraceEventsWriter.swift:231-240 | Sources/SwiftBuildSupport/TraceEventsWriter.swift:242-253 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/Runtimes/PackagePlugin/Plugin.swift:522— Sources/Runtimes/PackagePlugin/Plugin.swift:522-534 | Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:717-726 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:80— Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:80-89 | Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:91-102 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/Workspace/CheckoutState.swift:26— Sources/Workspace/CheckoutState.swift:26-35 | Sources/Workspace/CheckoutState.swift:39-48 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:88— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:88-101 | Sources/_InternalTestSupport/MockPackageFingerprintStorage.swift:32-41 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/PackageLoading/ManifestJSONParser.swift:617— Sources/PackageLoading/ManifestJSONParser.swift:617-626 | Sources/PackageModel/Module/PluginModule.swift:73-82 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/PackageGraph/ModulesGraph+Loading.swift:1337— Sources/PackageGraph/ModulesGraph+Loading.swift:1337-1347 | Sources/PackageGraph/Resolution/ResolvedModule.swift:176-185 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/Commands/PackageCommands/ShowExecutables.swift:74— Sources/Commands/PackageCommands/ShowExecutables.swift:74-83 | Sources/Commands/PackageCommands/ShowTraits.swift:71-80 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/_InternalTestSupport/PackageGraphTester.swift:235— Sources/_InternalTestSupport/PackageGraphTester.swift:235-244 | Sources/_InternalTestSupport/PackageGraphTester.swift:246-255 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 2) Sources/PackageModel/ManifestSourceGeneration.swift:91— Sources/PackageModel/ManifestSourceGeneration.swift:91-96 | Sources/PackageModel/ManifestSourceGeneration.swift:404-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/ManifestSourceGeneration.swift:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/PackageModel/ManifestSourceGeneration.swift:701— Sources/PackageModel/ManifestSourceGeneration.swift:701-706 | Sources/PackageModel/ManifestSourceGeneration.swift:731-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Sources/PackageModel/Toolchain+SupportedFeatures.swift:118— Sources/PackageModel/Toolchain+SupportedFeatures.swift:118-123 | Sources/PackageModel/Toolchain+SupportedFeatures.swift:152-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/Toolchain+SupportedFeatures.swift:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/PackageRegistry/RegistryDownloadsManager.swift:149— Sources/PackageRegistry/RegistryDownloadsManager.swift:149-154 | Sources/PackageRegistry/RegistryDownloadsManager.swift:171-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Sources/Runtimes/PackageDescription/PackageDependency.swift:441— Sources/Runtimes/PackageDescription/PackageDependency.swift:441-446 | Sources/Runtimes/PackageDescription/PackageDependency.swift:504-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/PackageDependency.swift:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Basics/SQLiteBackedCache.swift:192— Sources/Basics/SQLiteBackedCache.swift:192-197 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:883-888 — before extracting anything, compare `Sources/Basics/SQLiteBackedCache.swift` and `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/SQLiteBackedCache.swift:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:156— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:156-161 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:189-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1051— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1051-1056 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1098-1103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:163— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:163-168 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:196-201 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/PackageGraph/Resolution/ResolvedModule.swift:45— Sources/PackageGraph/Resolution/ResolvedModule.swift:45-50 | Sources/PackageModel/Module/Module.swift:99-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/PackageModel/InstalledSwiftPMConfiguration.swift:20— Sources/PackageModel/InstalledSwiftPMConfiguration.swift:20-25 | Utilities/InstalledSwiftPMConfiguration/Sources/InstalledSwiftPMConfiguration.swift:20-25 — before extracting anything, compare `Sources/PackageModel/InstalledSwiftPMConfiguration.swift` and `Utilities/InstalledSwiftPMConfiguration/Sources/InstalledSwiftPMConfiguration.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:113— Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:113-123 | Sources/PackageModel/RegistryReleaseMetadata.swift:83-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:109— Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:109-114 | Examples/package-registry/Sources/RegistryExample/Routes/SearchRoutes.swift:109-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Sources/_InternalTestSupport/MockDependency.swift:42— Sources/_InternalTestSupport/MockDependency.swift:42-47 | Sources/_InternalTestSupport/MockDependency.swift:56-61 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Hotspot: Sources/SwiftBuildSupport/SwiftBuildSystem.swift Sources/SwiftBuildSupport/SwiftBuildSystem.swift:922— Sources/SwiftBuildSupport/SwiftBuildSystem.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in SwiftBuildSystem.makeBuildParameters at line 922. 1 of those changes was a fix/bug commit, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/SwiftBuildSupport/SwiftBuildSystem.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:365— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in PackagePIFProjectBuilder.buildSourceModule at line 365. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageLoading/PackageBuilder.swift Sources/PackageLoading/PackageBuilder.swift:1182— Sources/PackageLoading/PackageBuilder.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in PackageBuilder.buildSettings at line 1182. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageLoading/PackageBuilder.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in PackagePIFProjectBuilder.makeMainModuleProduct at line 42. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageGraph/ModulesGraph+Loading.swift Sources/PackageGraph/ModulesGraph+Loading.swift:383— Sources/PackageGraph/ModulesGraph+Loading.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in ModulesGraph+Loading.swift.createResolvedPackages at line 383. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageGraph/ModulesGraph+Loading.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageLoading/ManifestJSONParser.swift Sources/PackageLoading/ManifestJSONParser.swift:713— Sources/PackageLoading/ManifestJSONParser.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Kind.from at line 713. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageLoading/ManifestJSONParser.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:216— Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in SwiftBuildSystemMessageHandler.emitEvent at line 216. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageRegistry/RegistryClient.swift Sources/PackageRegistry/RegistryClient.swift:1135— Sources/PackageRegistry/RegistryClient.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in RegistryClient.publish at line 1135. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageRegistry/RegistryClient.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageModel/ManifestSourceGeneration.swift Sources/PackageModel/ManifestSourceGeneration.swift:656— Sources/PackageModel/ManifestSourceGeneration.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in SourceCodeFragment.init at line 656. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageModel/ManifestSourceGeneration.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/SwiftBuildSupport/PIFBuilder.swift Sources/SwiftBuildSupport/PIFBuilder.swift:887— Sources/SwiftBuildSupport/PIFBuilder.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PIFBuilder.swift.buildAggregatePIFProject at line 887. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/SwiftBuildSupport/PIFBuilder.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/PackageModel/UserToolchain.swift Sources/PackageModel/UserToolchain.swift:989— Sources/PackageModel/UserToolchain.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in UserToolchain.deriveSwiftPMLibrariesLocation at line 989. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/PackageModel/UserToolchain.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Workspace/Workspace+Manifests.swift Sources/Workspace/Workspace+Manifests.swift:494— Sources/Workspace/Workspace+Manifests.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Workspace.loadDependencyManifests at line 494. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 11:01:13 -08:00' --until='2026-11-12 11:01:13 -08:00' --full-history --no-merges -- Sources/Workspace/Workspace+Manifests.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×12
Edited copy of a member (3 corresponding lines) Sources/Commands/CommandWorkspaceDelegate.swift:294— Sources/Commands/CommandWorkspaceDelegate.swift:294-296 | Sources/_InternalTestSupport/MockWorkspace.swift:1156-1171 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/Basics/FileSystem/FileSystem+Extensions.swift:198— Sources/Basics/FileSystem/FileSystem+Extensions.swift:198-200 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:510-512 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageModel/InstalledSwiftPMConfiguration.swift:27— Sources/PackageModel/InstalledSwiftPMConfiguration.swift:27-29 | Utilities/InstalledSwiftPMConfiguration/Sources/InstalledSwiftPMConfiguration.swift:27-29 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/Commands/CommandWorkspaceDelegate.swift:117— Sources/Commands/CommandWorkspaceDelegate.swift:117-119 | Sources/_InternalTestSupport/MockWorkspace.swift:1128-1136 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:230— Sources/SwiftBuildSupport/PackagePIFBuilder.swift:230-232 | Sources/XCBuildSupport/PIFBuilder.swift:426-428 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/Workspace/PackageContainer/FileSystemPackageContainer.swift:134— Sources/Workspace/PackageContainer/FileSystemPackageContainer.swift:134-136 | Sources/Workspace/PackageContainer/RegistryPackageContainer.swift:119-121 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageGraph/Diagnostics.swift:20— Sources/PackageGraph/Diagnostics.swift:20-22 | Sources/PackageLoading/ManifestLoader+Validation.swift:345-347 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageLoading/Diagnostics.swift:52— Sources/PackageLoading/Diagnostics.swift:52-54 | Sources/Workspace/Diagnostics.swift:105-109 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageLoading/Diagnostics.swift:132— Sources/PackageLoading/Diagnostics.swift:132-134 | Sources/PackageLoading/TargetSourcesBuilder.swift:938-943 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageLoading/Diagnostics.swift:150— Sources/PackageLoading/Diagnostics.swift:150-152 | Sources/PackageLoading/TargetSourcesBuilder.swift:938-943 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/Commands/CommandWorkspaceDelegate.swift:113— Sources/Commands/CommandWorkspaceDelegate.swift:113-115 | Sources/_InternalTestSupport/MockWorkspace.swift:1106-1108 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Sources/PackageLoading/TargetSourcesBuilder.swift:934— Sources/PackageLoading/TargetSourcesBuilder.swift:934-936 | Sources/Workspace/Diagnostics.swift:99-103 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
TooManyMethods: Diagnostic Sources/Basics/Observability.swift:370— TooManyMethods — 89 methods, declared across 15 files: PackageLoading/Diagnostics.swift (24), PackageLoading/ManifestLoader+Validation.swift (22), Basics/Observability.swift (11), Workspace/Diagnostics.swift (7), +11 more file(s). The bar is 30 methods; this is 59 over it, 2.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Workspace Sources/SwiftBuildSupport/PIF.swift:116— TooManyMethods — 80 methods, declared across 14 files: Workspace/Workspace.swift (26), Workspace/Workspace+Dependencies.swift (18), Workspace/Workspace+Manifests.swift (8), Workspace/Workspace+Traits.swift (7), +10 more file(s). The bar is 30 methods; this is 50 over it, 2.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitRepository Sources/SourceControl/GitRepository.swift:466— TooManyMethods — 57 methods, declared across 2 files: SourceControl/GitRepository.swift (48), _InternalTestSupport/GitRepositoryExtensions.swift (9). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FileSystem Sources/PackageModel/Manifest/PackageDependencyDescription.swift:105— TooManyMethods — 51 methods, declared across 7 files: FileSystem/FileSystem+Extensions.swift (44), _InternalTestSupport/misc.swift (2), FileSystem/VirtualFileSystem.swift (1), Manifest/PackageDependencyDescription.swift (1), +3 more file(s). The bar is 30 methods; this is 21 over it, 1.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Manifest Sources/PackageModel/Manifest/Manifest.swift:22— TooManyMethods — 46 methods, declared across 6 files: Manifest/Manifest.swift (18), Manifest/Manifest+Traits.swift (17), _InternalTestSupport/ManifestExtensions.swift (8), PackageGraph/PackageModel+Extensions.swift (1), +2 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SourceCodeFragment Sources/PackageModel/ManifestSourceGeneration.swift:1094— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SBOMValidator Sources/SBOMModel/Validator/SBOMValidator.swift:94— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CommandWorkspaceDelegate Sources/Commands/CommandWorkspaceDelegate.swift:28— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. Most of these members implement Workspace.WorkspaceDelegate (36 of 37 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: SwiftCommandState Sources/CoreCommands/SwiftCommandState.swift:288— TooManyMethods — 36 methods, declared across 4 files: CoreCommands/SwiftCommandState.swift (32), Utilities/TestingSupport.swift (2), Commands/SwiftTestCommand.swift (1), _InternalTestSupport/MockSwiftCommandState.swift (1). The bar is 30 methods; this is 6 over it, 1.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PackagePIFProjectBuilder Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:41— TooManyMethods — 35 methods, declared across 3 files: SwiftBuildSupport/PackagePIFProjectBuilder.swift (14), SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift (13), SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift (8). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: UserToolchain Sources/PackageModel/UserToolchain.swift:27— TooManyMethods — 34 methods, declared across 3 files: PackageModel/UserToolchain.swift (30), _InternalTestSupport/Toolchain.swift (3), _InternalTestSupport/MockWorkspace.swift (1). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×11
Edited copy of a member (15 corresponding lines) Sources/PackageModel/ToolsVersion.swift:109— Sources/PackageModel/ToolsVersion.swift:109-124 | Sources/PackageModel/ToolsVersion.swift:127-142 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/PackageCollections/PackageCollections.swift:288— Sources/PackageCollections/PackageCollections.swift:288-302 | Sources/PackageCollections/PackageCollections.swift:376-393 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:38— Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:38-53 | Sources/SBOMModel/Extractor/DependencySourceStrategy.swift:55-69 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/_AsyncFileSystem/OSFileSystem.swift:31— Sources/_AsyncFileSystem/OSFileSystem.swift:31-45 | Sources/_AsyncFileSystem/OSFileSystem.swift:47-69 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/Basics/Concurrency/AsyncProcess.swift:352— Sources/Basics/Concurrency/AsyncProcess.swift:352-366 | Sources/Basics/Concurrency/AsyncProcess.swift:379-393 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/XCBuildSupport/PIFBuilder.swift:188— Sources/XCBuildSupport/PIFBuilder.swift:188-202 | Sources/XCBuildSupport/PIFBuilder.swift:1227-1241 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/PackageLoading/ManifestLoader+Validation.swift:435— Sources/PackageLoading/ManifestLoader+Validation.swift:435-449 | Sources/Workspace/Workspace+Dependencies.swift:1528-1543 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/PackageMetadata/PackageMetadata.swift:327— Sources/PackageMetadata/PackageMetadata.swift:327-341 | Sources/PackageMetadata/PackageMetadata.swift:343-359 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:1121— Sources/Runtimes/PackageDescription/Target.swift:1121-1138 | Sources/Runtimes/PackageDescription/Target.swift:1149-1163 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/PackageModel/Manifest/ProductDescription.swift:152— Sources/PackageModel/Manifest/ProductDescription.swift:152-166 | Sources/Runtimes/PackageDescription/Product.swift:313-327 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:130— Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:130-144 | Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:250-268 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 2) Sources/Basics/Environment/Environment.swift:175— Sources/Basics/Environment/Environment.swift:175-186 | Sources/Basics/Environment/Environment.swift:206-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Environment/Environment.swift:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/Basics/Graph/GraphAlgorithms.swift:34— Sources/Basics/Graph/GraphAlgorithms.swift:34-45 | Sources/Basics/Graph/GraphAlgorithms.swift:65-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Graph/GraphAlgorithms.swift:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Sources/Commands/CommandWorkspaceDelegate.swift:229— Sources/Commands/CommandWorkspaceDelegate.swift:229-240 | Sources/Commands/CommandWorkspaceDelegate.swift:243-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) Sources/DriverSupport/DriverSupportUtils.swift:26— Sources/DriverSupport/DriverSupportUtils.swift:26-37 | Sources/DriverSupport/DriverSupportUtils.swift:61-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/DriverSupport/DriverSupportUtils.swift:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:792— Sources/Runtimes/PackageDescription/Target.swift:792-803 | Sources/Runtimes/PackageDescription/Target.swift:1211-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:792` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/Runtimes/PackagePlugin/Command.swift:128— Sources/Runtimes/PackagePlugin/Command.swift:128-139 | Sources/Runtimes/PackagePlugin/Command.swift:175-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackagePlugin/Command.swift:128` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1056— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1056-1067 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:596-607 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1056` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1068` calls `Set` and `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:608` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) Sources/swift-bootstrap/main.swift:319— Sources/swift-bootstrap/main.swift:319-330 | Sources/swift-bootstrap/main.swift:365-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:545— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:545-556 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:558-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:36— Sources/PackageCollectionsSigning/CertificatePolicy.swift:36-47 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:36-47 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) Sources/PackageModel/InstalledSwiftPMConfiguration.swift:36— Sources/PackageModel/InstalledSwiftPMConfiguration.swift:36-47 | Utilities/InstalledSwiftPMConfiguration/Sources/InstalledSwiftPMConfiguration.swift:36-47 — before extracting anything, compare `Sources/PackageModel/InstalledSwiftPMConfiguration.swift` and `Utilities/InstalledSwiftPMConfiguration/Sources/InstalledSwiftPMConfiguration.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/Basics/Environment/Environment.swift:118— Sources/Basics/Environment/Environment.swift:118-124 | Sources/Basics/Environment/Environment.swift:127-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/PackageCollections/PackageIndex+Configuration.swift:69— Sources/PackageCollections/PackageIndex+Configuration.swift:69-75 | Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:100-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:49— Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:49-55 | Sources/PackageCollectionsSigning/Utilities/Base64URL.swift:67-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/PackageGraph/ResolvedPackagesStore.swift:216— Sources/PackageGraph/ResolvedPackagesStore.swift:216-222 | Sources/PackageGraph/ResolvedPackagesStore.swift:229-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageGraph/ResolvedPackagesStore.swift:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:309— Sources/PackageLoading/ManifestJSONParser.swift:309-315 | Sources/PackageLoading/ManifestJSONParser.swift:326-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageLoading/ManifestJSONParser.swift:309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/PackageRegistry/RegistryClient.swift:1973— Sources/PackageRegistry/RegistryClient.swift:1973-1979 | Sources/PackageRegistry/RegistryClient.swift:2052-2058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/Runtimes/PackagePlugin/Plugin.swift:539— Sources/Runtimes/PackagePlugin/Plugin.swift:539-547 | Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:731-737 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/Basics/Sandbox.swift:31— Sources/Basics/Sandbox.swift:31-37 | Sources/PackageModel/Module/PluginModule.swift:112-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:385— Sources/PackageCollectionsSigning/CertificatePolicy.swift:385-391 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:388-394 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:28— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:28-34 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:28-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/_InternalTestSupport/MockPackageContainer.swift:109— Sources/_InternalTestSupport/MockPackageContainer.swift:109-115 | Sources/_InternalTestSupport/MockPackageContainer.swift:142-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageContainer.swift:109` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×10
Edited copy of a member (11 corresponding lines) Sources/Basics/FileSystem/TSCAdapters.swift:29— Sources/Basics/FileSystem/TSCAdapters.swift:29-39 | Sources/Basics/FileSystem/TSCAdapters.swift:41-51 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift:56— Sources/PackageCollections/PackageIndex+Configuration.swift:56-66 | Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:87-97 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift:43— Sources/LLBuildManifest/LLBuildManifest.swift:43-53 | Sources/LLBuildManifest/LLBuildManifest.swift:143-155 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:34— Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:34-44 | Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:167-177 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/Runtimes/PackageDescription/Product.swift:336— Sources/Runtimes/PackageDescription/Product.swift:336-346 | Sources/PackageModel/Manifest/ProductDescription.swift:175-185 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:62— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:62-72 | Sources/_InternalTestSupport/MockPackageFingerprintStorage.swift:70-80 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift:100— Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift:100-110 | Sources/SwiftSDKCommand/SwiftSDKSubcommand.swift:46-56 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/_InternalTestSupport/Observability.swift:120— Sources/_InternalTestSupport/Observability.swift:120-131 | Sources/_InternalTestSupport/Observability.swift:133-143 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:213— Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:213-223 | Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:225-236 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/_InternalTestSupport/MockWorkspace.swift:598— Sources/_InternalTestSupport/MockWorkspace.swift:598-608 | Sources/_InternalTestSupport/MockWorkspace.swift:639-649 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×10
Edited copy of a member (13 corresponding lines) Sources/SPMBuildCore/BuildParameters/BuildParameters.swift:276— Sources/SPMBuildCore/BuildParameters/BuildParameters.swift:276-294 | Sources/XCBuildSupport/XcodeBuildSystem.swift:87-99 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/Workspace/Workspace+Delegation.swift:311— Sources/Workspace/Workspace+Delegation.swift:311-323 | Sources/Workspace/Workspace+Delegation.swift:356-368 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:140— Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:140-154 | Sources/PackageModel/RegistryReleaseMetadata.swift:41-53 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/Basics/Concurrency/ThreadSafeBox.swift:150— Sources/Basics/Concurrency/ThreadSafeBox.swift:150-162 | Sources/Basics/Concurrency/ThreadSafeBox.swift:176-188 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/Runtimes/PackageDescription/Product.swift:349— Sources/Runtimes/PackageDescription/Product.swift:349-361 | Sources/PackageModel/Manifest/ProductDescription.swift:188-200 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:77— Examples/package-registry/Sources/RegistryExample/Models/PackageRelease.swift:77-89 | Sources/PackageModel/RegistryReleaseMetadata.swift:62-74 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:315— Sources/Runtimes/PackagePlugin/PackageManagerProxy.swift:315-327 | Sources/SPMBuildCore/BuildSystem/BuildSystem.swift:53-67 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:74— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:74-86 | Sources/_InternalTestSupport/MockPackageFingerprintStorage.swift:82-94 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/_InternalTestSupport/MockArchiver.swift:76— Sources/_InternalTestSupport/MockArchiver.swift:76-91 | Sources/_InternalTestSupport/MockArchiver.swift:112-124 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) Sources/_InternalTestSupport/Observability.swift:145— Sources/_InternalTestSupport/Observability.swift:145-159 | Sources/_InternalTestSupport/Observability.swift:182-194 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) Sources/Basics/SQLiteBackedCache.swift:173— Sources/Basics/SQLiteBackedCache.swift:173-177 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:864-868 — before extracting anything, compare `Sources/Basics/SQLiteBackedCache.swift` and `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/SQLiteBackedCache.swift:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/PackageCollections/PackageIndex.swift:107— Sources/PackageCollections/PackageIndex.swift:107-111 | Sources/PackageCollections/PackageIndex.swift:141-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollections/PackageIndex.swift:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/PackageLoading/ToolsVersionParser.swift:659— Sources/PackageLoading/ToolsVersionParser.swift:659-664 | Sources/PackageModel/SwiftLanguageVersion.swift:79-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/PackageModel/ManifestSourceGeneration.swift:890— Sources/PackageModel/ManifestSourceGeneration.swift:890-894 | Sources/PackageModel/ManifestSourceGeneration.swift:912-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/PackageModel/ManifestSourceGeneration.swift:918` calls `SourceCodeFragment` and `Sources/PackageModel/ManifestSourceGeneration.swift:896` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) Sources/SBOMModel/Validator/SBOMValidator.swift:354— Sources/SBOMModel/Validator/SBOMValidator.swift:354-358 | Sources/SBOMModel/Validator/SBOMValidator.swift:386-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SBOMModel/Validator/SBOMValidator.swift:354` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/SwiftBuildSupport/PIF.swift:196— Sources/SwiftBuildSupport/PIF.swift:196-200 | Sources/SwiftBuildSupport/PIF.swift:233-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PIF.swift:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1157— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1157-1171 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:585-589 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1157` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) Sources/PackageRegistry/RegistryDownloadsManager.swift:303— Sources/PackageRegistry/RegistryDownloadsManager.swift:303-307 | Sources/SourceControl/RepositoryManager.swift:518-523 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Sources/PackageModel/ManifestSourceGeneration.swift:181— Sources/PackageModel/ManifestSourceGeneration.swift:181-185 | Sources/PackageModel/ManifestSourceGeneration.swift:193-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/ManifestSourceGeneration.swift:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Commands/SwiftTestCommand.swift:2078— Sources/Commands/SwiftTestCommand.swift:2078-2082 | Sources/Commands/SwiftTestCommand.swift:2085-2089 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×9
Edited copy of a member (14 corresponding lines) Sources/PackageCollections/PackageIndex+Configuration.swift:26— Sources/PackageCollections/PackageIndex+Configuration.swift:26-39 | Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:286-299 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/SourceControl/GitRepository.swift:1171— Sources/SourceControl/GitRepository.swift:1171-1185 | Sources/SourceControl/GitRepository.swift:1187-1200 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/Basics/ProgressAnimation/NinjaProgressAnimation.swift:18— Sources/Basics/ProgressAnimation/NinjaProgressAnimation.swift:18-31 | Sources/Basics/ProgressAnimation/PercentProgressAnimation.swift:18-36 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:131— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:131-144 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:161-175 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/Basics/DispatchTimeInterval+Extensions.swift:47— Sources/Basics/DispatchTimeInterval+Extensions.swift:47-60 | Sources/Basics/DispatchTimeInterval+Extensions.swift:62-75 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1028— Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1028-1041 | Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1049-1062 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/Basics/Concurrency/AsyncProcess.swift:954— Sources/Basics/Concurrency/AsyncProcess.swift:954-967 | Sources/Basics/Concurrency/AsyncProcess.swift:1136-1153 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/Workspace/Workspace+Delegation.swift:387— Sources/Workspace/Workspace+Delegation.swift:387-400 | Sources/Workspace/Workspace+Delegation.swift:402-415 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift:90— Sources/PackageGraph/ResolvedPackagesStore.swift:90-103 | Sources/Workspace/Workspace+Dependencies.swift:972-987 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:91— Sources/Basics/Archiver/TarArchiver.swift:91-101 | Sources/Basics/Archiver/ZipArchiver.swift:63-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/Basics/FileSystem/InMemoryFileSystem.swift:132— Sources/Basics/FileSystem/InMemoryFileSystem.swift:132-142 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:368-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/FileSystem/InMemoryFileSystem.swift:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/PackageLoading/ManifestLoader+Validation.swift:435— Sources/PackageLoading/ManifestLoader+Validation.swift:435-445 | Sources/Workspace/Workspace+Dependencies.swift:1528-1538 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageLoading/ManifestLoader+Validation.swift:435` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1031— Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1031-1041 | Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1052-1062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:1031` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) Sources/SPMBuildCore/Plugins/PluginInvocation.swift:184— Sources/SPMBuildCore/Plugins/PluginInvocation.swift:184-194 | Sources/SPMBuildCore/Plugins/PluginInvocation.swift:201-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:192— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:192-202 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:675-685 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:192` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:688` calls `insert` and `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:203` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1178— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1178-1188 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1261-1271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1178` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:497— Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:497-507 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:610-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) Sources/_InternalTestSupport/MockPackage.swift:40— Sources/_InternalTestSupport/MockPackage.swift:40-50 | Sources/_InternalTestSupport/MockPackage.swift:67-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackage.swift:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Low coverage: Fixtures/Macros/MacroWithDirectTestDependency/Sources/MacroImpl/StringifyMacro.swift Fixtures/Macros/MacroWithDirectTestDependency/Sources/MacroImpl/StringifyMacro.swift:1— 0.0% line coverage (0/73).
Low coverage: Fixtures/Macros/MacroWithDirectTestDependency/Sources/MacroImplHelpers/MacroImplHelpers.swift Fixtures/Macros/MacroWithDirectTestDependency/Sources/MacroImplHelpers/MacroImplHelpers.swift:1— 0.0% line coverage (0/3).
Low coverage: Fixtures/Miscellaneous/EmptyTestsPkg/Sources/EmptyTestsPkg/EmptyTestsPkg.swift Fixtures/Miscellaneous/EmptyTestsPkg/Sources/EmptyTestsPkg/EmptyTestsPkg.swift:1— 0.0% line coverage (0/2).
Low coverage: Fixtures/Miscellaneous/FlatPackage/MyExec.swift Fixtures/Miscellaneous/FlatPackage/MyExec.swift:1— 25.0% line coverage (1/4).
Low coverage: Fixtures/Miscellaneous/TestDebugging/Sources/TestDebugging/TestDebugging.swift Fixtures/Miscellaneous/TestDebugging/Sources/TestDebugging/TestDebugging.swift:1— 25.0% line coverage (4/16).
Low coverage: Fixtures/Miscellaneous/Plugins/CommandPluginTestStub/Sources/InternalModule/InternalModule.swift Fixtures/Miscellaneous/Plugins/CommandPluginTestStub/Sources/InternalModule/InternalModule.swift:1— 0.0% line coverage (0/3).
Low coverage: Fixtures/Miscellaneous/Plugins/IncorrectDependencies/Sources/MyExecutable/MyExecutable.swift Fixtures/Miscellaneous/Plugins/IncorrectDependencies/Sources/MyExecutable/MyExecutable.swift:1— 0.0% line coverage (0/3).
Low coverage: Fixtures/Miscellaneous/Plugins/MySourceGenPluginNoPreBuildCommands/Sources/MySourceGenRuntimeLib/library.swift Fixtures/Miscellaneous/Plugins/MySourceGenPluginNoPreBuildCommands/Sources/MySourceGenRuntimeLib/library.swift:1— 0.0% line coverage (0/3).
Low coverage: Fixtures/Miscellaneous/TargetPackageAccess/libPkg/Sources/DataManager/File.swift Fixtures/Miscellaneous/TargetPackageAccess/libPkg/Sources/DataManager/File.swift:1— 0.0% line coverage (0/3).
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×8
Edited copy of a member (17 corresponding lines) Sources/Commands/Snippets/Cards/SnippetGroupCard.swift:34— Sources/Commands/Snippets/Cards/SnippetGroupCard.swift:34-50 | Sources/Commands/Snippets/Cards/TopCard.swift:146-163 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/SBOMModel/Validator/SBOMValidator.swift:632— Sources/SBOMModel/Validator/SBOMValidator.swift:632-648 | Sources/SBOMModel/Validator/SBOMValidator.swift:694-714 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/PackageModel/WindowsToolchainInfo.swift:56— Sources/PackageModel/WindowsToolchainInfo.swift:56-72 | Sources/PackageModel/WindowsToolchainInfo.swift:108-124 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/Runtimes/PackagePlugin/Plugin.swift:536— Sources/Runtimes/PackagePlugin/Plugin.swift:536-556 | Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:728-744 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/PackageCollections/PackageIndex.swift:34— Sources/PackageCollections/PackageIndex.swift:34-58 | Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:37-53 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift:68— Sources/LLBuildManifest/LLBuildManifest.swift:68-87 | Sources/LLBuildManifest/LLBuildManifest.swift:97-113 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/PackageFingerprint/PackageFingerprintStorage.swift:49— Sources/PackageFingerprint/PackageFingerprintStorage.swift:49-65 | Sources/PackageFingerprint/PackageFingerprintStorage.swift:67-83 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) Sources/PackageModel/Manifest/PackageDependencyDescription.swift:414— Sources/PackageModel/Manifest/PackageDependencyDescription.swift:414-430 | Sources/PackageModel/Manifest/PackageDependencyDescription.swift:432-452 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (9 lines × 2) Sources/Basics/HTTPClient/HTTPClientRequest.swift:37— Sources/Basics/HTTPClient/HTTPClientRequest.swift:37-45 | Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift:37-45 — before extracting anything, compare `Sources/Basics/HTTPClient/HTTPClientRequest.swift` and `Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) Sources/CoreCommands/Options.swift:529— Sources/CoreCommands/Options.swift:529-537 | Sources/swift-bootstrap/main.swift:160-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:256— Sources/PackageRegistry/SignatureValidation.swift:256-264 | Sources/PackageRegistry/SignatureValidation.swift:517-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:256` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift:364— Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift:364-372 | Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift:378-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/SPMBuildCore/BinaryTarget+Extensions.swift:82— Sources/SPMBuildCore/BinaryTarget+Extensions.swift:82-90 | Sources/SPMBuildCore/BinaryTarget+Extensions.swift:108-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SPMBuildCore/BinaryTarget+Extensions.swift:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/Workspace/Workspace+State.swift:1238— Sources/Workspace/Workspace+State.swift:1238-1246 | Sources/Workspace/Workspace+State.swift:1481-1489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Sources/PackageModel/Manifest/TraitDescription.swift:31— Sources/PackageModel/Manifest/TraitDescription.swift:31-39 | Sources/Runtimes/PackageDescription/Trait.swift:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/_InternalTestSupport/MockWorkspace.swift:481— Sources/_InternalTestSupport/MockWorkspace.swift:481-489 | Sources/_InternalTestSupport/MockWorkspace.swift:504-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockWorkspace.swift:481` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) Sources/Basics/HTTPClient/HTTPClientRequest.swift:48— Sources/Basics/HTTPClient/HTTPClientRequest.swift:48-62 | Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift:48-62 — before extracting anything, compare `Sources/Basics/HTTPClient/HTTPClientRequest.swift` and `Sources/Basics/HTTPClient/LegacyHTTPClientRequest.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) Sources/PackageFingerprint/PackageFingerprintStorage.swift:51— Sources/PackageFingerprint/PackageFingerprintStorage.swift:51-65 | Sources/PackageFingerprint/PackageFingerprintStorage.swift:69-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageFingerprint/PackageFingerprintStorage.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) Sources/PackageRegistry/RegistryClient.swift:518— Sources/PackageRegistry/RegistryClient.swift:518-532 | Sources/PackageRegistry/RegistryClient.swift:662-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/RegistryClient.swift:518` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:461— Sources/Runtimes/PackageDescription/Target.swift:461-475 | Sources/Runtimes/PackageDescription/Target.swift:632-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:461` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) Sources/Runtimes/PackagePlugin/Plugin.swift:224— Sources/Runtimes/PackagePlugin/Plugin.swift:224-240 | Sources/Runtimes/PackagePlugin/Plugin.swift:304-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackagePlugin/Plugin.swift:224` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/_InternalTestSupport/misc.swift:139— Sources/_InternalTestSupport/misc.swift:139-153 | Sources/_InternalTestSupport/misc.swift:184-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/misc.swift:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/_InternalTestSupport/misc.swift:247— Sources/_InternalTestSupport/misc.swift:247-261 | Sources/_InternalTestSupport/misc.swift:292-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/misc.swift:247` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: PackageDescription (SwiftPM) — PackageDescription (SwiftPM): abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: Commands (SwiftPM) — Commands (SwiftPM): abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: Basics (SwiftPM) — Basics (SwiftPM): abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 23 project(s), so it's rigid to change.
Off the main sequence: PackageModel (SwiftPM) — PackageModel (SwiftPM): abstractness 0.03, instability 0.06, distance 0.91 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
Off the main sequence: Build (SwiftPM) — Build (SwiftPM): abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: PackageSigning (SwiftPM) — PackageSigning (SwiftPM): abstractness 0.18, instability 0.00, distance 0.82 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: PackageCollectionsSigning (SwiftPM) — PackageCollectionsSigning (SwiftPM): abstractness 0.19, instability 0.00, distance 0.81 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×6
Edited copy of a member (16 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift:364— Sources/PackageGraph/ResolvedPackagesStore.swift:364-379 | Sources/PackageGraph/ResolvedPackagesStore.swift:450-473 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/Basics/Archiver/TarArchiver.swift:147— Sources/Basics/Archiver/TarArchiver.swift:147-164 | Sources/Basics/Archiver/ZipArchiver.swift:127-142 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift:396— Sources/PackageGraph/ResolvedPackagesStore.swift:396-413 | Sources/PackageGraph/ResolvedPackagesStore.swift:487-502 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/PackageRegistry/RegistryDownloadsManager.swift:111— Sources/PackageRegistry/RegistryDownloadsManager.swift:111-126 | Sources/SourceControl/RepositoryManager.swift:105-124 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/_InternalTestSupport/MockPackageContainer.swift:102— Sources/_InternalTestSupport/MockPackageContainer.swift:102-117 | Sources/_InternalTestSupport/MockPackageContainer.swift:135-157 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Sources/_InternalTestSupport/Observability.swift:161— Sources/_InternalTestSupport/Observability.swift:161-180 | Sources/_InternalTestSupport/Observability.swift:213-228 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) Sources/Basics/Concurrency/AsyncProcess.swift:726— Sources/Basics/Concurrency/AsyncProcess.swift:726-739 | Sources/Basics/Concurrency/AsyncProcess.swift:758-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Concurrency/AsyncProcess.swift:726` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/SPMBuildCore/Plugins/PluginInvocation.swift:136— Sources/SPMBuildCore/Plugins/PluginInvocation.swift:136-149 | Sources/SPMBuildCore/Plugins/PluginInvocation.swift:161-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SPMBuildCore/Plugins/PluginInvocation.swift:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:67— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:67-80 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:865-878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:963— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:963-976 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:957-970 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:963` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Sources/_InternalTestSupport/Observability.swift:162— Sources/_InternalTestSupport/Observability.swift:162-175 | Sources/_InternalTestSupport/Observability.swift:214-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/Observability.swift:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/_InternalTestSupport/misc.swift:563— Sources/_InternalTestSupport/misc.swift:563-576 | Sources/_InternalTestSupport/misc.swift:585-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/misc.swift:563` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D10 · Test Quality· Test project verifies nothing · ×5
Test project verifies nothing: IgnoresLinuxMainTests Fixtures/Miscellaneous/TestDiscovery/IgnoresLinuxMain/Tests/IgnoresLinuxMainTests/SomeTest.swift:4— No conventional assertion call was detected in 1 of 1 tests in `IgnoresLinuxMainTests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Test project verifies nothing: Module1Tests Fixtures/Miscellaneous/TestDiscovery/Subclass/Tests/Module1Tests/Tests1.swift:4— No conventional assertion call was detected in 3 of 3 tests in `Module1Tests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Test project verifies nothing: Module2Tests Fixtures/Miscellaneous/TestDiscovery/Subclass/Tests/Module2Tests/Test1.swift:4— No conventional assertion call was detected in 3 of 3 tests in `Module2Tests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Test project verifies nothing: SwiftPMXCTestHelperTests Fixtures/Miscellaneous/SwiftPMXCTestHelper/Tests/SwiftPMXCTestHelperTests/SwiftPMXCTestHelperTests.swift:6— No conventional assertion call was detected in 2 of 2 tests in `SwiftPMXCTestHelperTests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Test project verifies nothing: SwiftTestingTests Fixtures/Miscellaneous/TestDiscovery/SwiftTesting/Tests/SwiftTestingTests/SwiftTestingTests.swift:2— No conventional assertion call was detected in 1 of 1 tests in `SwiftTestingTests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
Floating branch dependency: foo — Dependency `foo` is declared in Fixtures/DependencyResolution/External/Branch/Bar/Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
Floating branch dependency: foo — Dependency `foo` is declared in Fixtures/DependencyResolution/External/Mirror/App/Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
Floating branch dependency: bar — Dependency `bar` is declared in Fixtures/DependencyResolution/External/Mirror/App/Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
Floating branch dependency: foo — Dependency `foo` is declared in Fixtures/Miscellaneous/Edit/App/Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
Floating branch dependency: bar — Dependency `bar` is declared in Fixtures/Miscellaneous/Edit/App/Package.swift against branch `main` — the declaration pins no immutable point, so `swift package update` moves this dependency to whatever that branch holds at the time, which is code nobody reviewed. Pin it to a version requirement (`from:`, `.upToNextMajor(from:)`, `exact:`) or to a `revision:` commit SHA.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×5
Edited copy of a member (18 corresponding lines) Sources/Commands/CommandWorkspaceDelegate.swift:67— Sources/Commands/CommandWorkspaceDelegate.swift:67-84 | Sources/Commands/CommandWorkspaceDelegate.swift:145-166 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Sources/SwiftBuildSupport/PIF.swift:141— Sources/SwiftBuildSupport/PIF.swift:141-158 | Sources/XCBuildSupport/PIF.swift:114-131 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Sources/Basics/SQLiteBackedCache.swift:172— Sources/Basics/SQLiteBackedCache.swift:172-190 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:864-881 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Sources/Basics/HTTPClient/HTTPClient.swift:237— Sources/Basics/HTTPClient/HTTPClient.swift:237-254 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:268-290 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Sources/XCBuildSupport/PIF.swift:478— Sources/XCBuildSupport/PIF.swift:478-495 | Sources/XCBuildSupport/PIF.swift:573-595 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×5
Edited copy of a member (22 corresponding lines) Sources/SBOMModel/Extractor/SBOMExtractor.swift:241— Sources/SBOMModel/Extractor/SBOMExtractor.swift:241-264 | Sources/SBOMModel/Extractor/SBOMExtractor.swift:266-287 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) Sources/Basics/FileSystem/InMemoryFileSystem.swift:124— Sources/Basics/FileSystem/InMemoryFileSystem.swift:124-145 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:360-384 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) Sources/Basics/Cancellator.swift:270— Sources/Basics/Cancellator.swift:270-291 | Sources/Basics/Cancellator.swift:296-321 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) Sources/_InternalTestSupport/MockWorkspace.swift:543— Sources/_InternalTestSupport/MockWorkspace.swift:543-569 | Sources/_InternalTestSupport/MockWorkspace.swift:651-672 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) Sources/_InternalTestSupport/MockWorkspace.swift:477— Sources/_InternalTestSupport/MockWorkspace.swift:477-498 | Sources/_InternalTestSupport/MockWorkspace.swift:500-523 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×5
Edited copy of a member (12 corresponding lines) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:186— Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:186-197 | Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:318-340 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/SwiftBuildSupport/PIF.swift:195— Sources/SwiftBuildSupport/PIF.swift:195-206 | Sources/SwiftBuildSupport/PIF.swift:232-243 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/SBOMModel/Converter/CycloneDXConverter.swift:29— Sources/SBOMModel/Converter/CycloneDXConverter.swift:29-42 | Sources/SBOMModel/Converter/SPDXConverter.swift:23-34 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/_InternalTestSupport/MockWorkspace.swift:974— Sources/_InternalTestSupport/MockWorkspace.swift:974-985 | Sources/_InternalTestSupport/MockWorkspace.swift:987-998 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/_InternalTestSupport/PackageGraphTester.swift:160— Sources/_InternalTestSupport/PackageGraphTester.swift:160-171 | Sources/_InternalTestSupport/PackageGraphTester.swift:292-303 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 3) Sources/Basics/HTTPClient/LegacyHTTPClient.swift:306— Sources/Basics/HTTPClient/LegacyHTTPClient.swift:306-312 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:331-337 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:375-381 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/HTTPClient/LegacyHTTPClient.swift:306` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 3) Sources/PackageGraph/ResolvedPackagesStore.swift:214— Sources/PackageGraph/ResolvedPackagesStore.swift:214-220 | Sources/PackageGraph/ResolvedPackagesStore.swift:227-233 | Sources/PackageGraph/ResolvedPackagesStore.swift:240-246 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageGraph/ResolvedPackagesStore.swift:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) Sources/PackageCollections/PackageIndex.swift:191— Sources/PackageCollections/PackageIndex.swift:191-197 | Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:271-277 | Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:385-391 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) Sources/PackageGraph/Resolution/ResolvedModule.swift:212— Sources/PackageGraph/Resolution/ResolvedModule.swift:212-218 | Sources/PackageGraph/Resolution/ResolvedPackage.swift:82-88 | Sources/PackageGraph/Resolution/ResolvedProduct.swift:162-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) Sources/_InternalBuildTestSupport/PIFTester.swift:87— Sources/_InternalBuildTestSupport/PIFTester.swift:87-93 | Sources/_InternalBuildTestSupport/PIFTester.swift:132-138 | Sources/_InternalBuildTestSupport/PIFTester.swift:161-167 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalBuildTestSupport/PIFTester.swift:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Basics/FileSystem/FileSystem+Extensions.swift:264— Sources/Basics/FileSystem/FileSystem+Extensions.swift:264-286 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:296-318 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:343-425 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:450-483 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Workspace/Workspace+State.swift:592— Sources/Workspace/Workspace+State.swift:592-601 | Sources/Workspace/Workspace+State.swift:948-957 | Sources/Workspace/Workspace+State.swift:1275-1284 | Sources/Workspace/Workspace+State.swift:1520-1529 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/XCBuildSupport/PIF.swift:133— Sources/XCBuildSupport/PIF.swift:133-143 | Sources/XCBuildSupport/PIF.swift:218-246 | Sources/XCBuildSupport/PIF.swift:521-553 | Sources/XCBuildSupport/PIF.swift:641-692 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/_InternalTestSupport/MockPackageGraphs.swift:35— Sources/_InternalTestSupport/MockPackageGraphs.swift:35-136 | Sources/_InternalTestSupport/MockPackageGraphs.swift:138-295 | Sources/_InternalTestSupport/MockPackageGraphs.swift:297-328 | Sources/_InternalTestSupport/MockPackageGraphs.swift:330-373 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×4
Edited copy of a member (30 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:454— Sources/Runtimes/PackageDescription/Target.swift:454-483 | Sources/Runtimes/PackageDescription/Target.swift:509-540 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:625— Sources/Runtimes/PackageDescription/Target.swift:625-654 | Sources/Runtimes/PackageDescription/Target.swift:681-712 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) Sources/DriverSupport/DriverSupportUtils.swift:25— Sources/DriverSupport/DriverSupportUtils.swift:25-55 | Sources/DriverSupport/DriverSupportUtils.swift:60-89 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) Sources/Basics/Graph/GraphAlgorithms.swift:28— Sources/Basics/Graph/GraphAlgorithms.swift:28-57 | Sources/Basics/Graph/GraphAlgorithms.swift:59-88 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×4
Edited copy of a member (28 corresponding lines) Sources/Basics/Archiver/TarArchiver.swift:91— Sources/Basics/Archiver/TarArchiver.swift:91-119 | Sources/Basics/Archiver/ZipArchiver.swift:63-90 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift:43— Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift:43-73 | Sources/Runtimes/PackageDescription/Target.swift:402-429 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:45— Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:45-74 | Sources/_InternalTestSupport/MockPackageSigningEntityStorage.swift:40-67 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) Sources/_InternalBuildTestSupport/PIFTester.swift:78— Sources/_InternalBuildTestSupport/PIFTester.swift:78-105 | Sources/_InternalBuildTestSupport/PIFTester.swift:123-150 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×4
Edited copy of a member (24 corresponding lines) Sources/Basics/Environment/Environment.swift:171— Sources/Basics/Environment/Environment.swift:171-194 | Sources/Basics/Environment/Environment.swift:202-225 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) Sources/PackageRegistry/SigningEntityTOFU.swift:278— Sources/PackageRegistry/SigningEntityTOFU.swift:278-301 | Sources/PackageRegistry/SigningEntityTOFU.swift:303-328 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) Sources/PackageCollections/Storage/Trie.swift:46— Sources/PackageCollections/Storage/Trie.swift:46-69 | Sources/PackageCollections/Storage/Trie.swift:72-95 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:247— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:247-273 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:304-327 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×4
Edited copies of one member (3 members, 17+ corresponding lines) Sources/Runtimes/PackagePlugin/Command.swift:122— Sources/Runtimes/PackagePlugin/Command.swift:122-139 | Sources/Runtimes/PackagePlugin/Command.swift:168-186 | Sources/Runtimes/PackagePlugin/Command.swift:256-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) Sources/Basics/AuthorizationProvider.swift:354— Sources/Basics/AuthorizationProvider.swift:354-370 | Sources/Basics/AuthorizationProvider.swift:372-393 | Sources/Basics/AuthorizationProvider.swift:411-436 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift:335— Sources/LLBuildManifest/LLBuildManifest.swift:335-355 | Sources/LLBuildManifest/LLBuildManifest.swift:357-374 | Sources/LLBuildManifest/LLBuildManifest.swift:376-392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:149— Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:149-166 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:214-230 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:233-249 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:146— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:146-154 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:177-187 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:43— Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:43-51 | Sources/PackageCollections/Storage/FilePackageCollectionsSourcesStorage.swift:61-69 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:351— Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:351-359 | Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:362-370 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Sources/Workspace/Workspace+State.swift:541— Sources/Workspace/Workspace+State.swift:541-549 | Sources/Workspace/Workspace+State.swift:911-919 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×4
Edited copy of a member (5 corresponding lines) Sources/PackageModel/ManifestSourceGeneration.swift:1061— Sources/PackageModel/ManifestSourceGeneration.swift:1061-1065 | Sources/PackageModel/ManifestSourceGeneration.swift:1068-1072 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/PackageModel/ManifestSourceGeneration.swift:1041— Sources/PackageModel/ManifestSourceGeneration.swift:1041-1045 | Sources/PackageModel/ManifestSourceGeneration.swift:1048-1052 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/SBOMModel/Validator/SBOMValidator.swift:480— Sources/SBOMModel/Validator/SBOMValidator.swift:480-491 | Sources/SBOMModel/Validator/SBOMValidator.swift:546-550 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) Sources/PackageModel/PackageIdentity.swift:114— Sources/PackageModel/PackageIdentity.swift:114-118 | Sources/PackageModel/SwiftLanguageVersion.swift:136-140 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) Sources/PackageModel/Manifest/ProductDescription.swift:211— Sources/PackageModel/Manifest/ProductDescription.swift:211-227 | Sources/Runtimes/PackageDescription/Product.swift:411-427 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:325— Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:325-341 | Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:355-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Sources/Runtimes/PackagePlugin/Plugin.swift:268— Sources/Runtimes/PackagePlugin/Plugin.swift:268-284 | Sources/Runtimes/PackagePlugin/Plugin.swift:383-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackagePlugin/Plugin.swift:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `wireInput` to `0) case .createXcodeProjectBuildToolCommands(let` in one and `0) case .performXcodeProjectCommand(let` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) Sources/XCBuildSupport/PIFBuilder.swift:523— Sources/XCBuildSupport/PIFBuilder.swift:523-539 | Sources/XCBuildSupport/PIFBuilder.swift:758-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/XCBuildSupport/PIFBuilder.swift:523` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:55— Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:55-69 | Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:153-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:467— Sources/Runtimes/PackageDescription/Target.swift:467-481 | Sources/Runtimes/PackageDescription/Target.swift:523-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:638— Sources/Runtimes/PackageDescription/Target.swift:638-652 | Sources/Runtimes/PackageDescription/Target.swift:695-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:890— Sources/Runtimes/PackageDescription/Target.swift:890-904 | Sources/Runtimes/PackageDescription/Target.swift:943-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:890` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:319— Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:319-341 | Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:347-371 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) Sources/PackageModel/Module/BinaryModule.swift:33— Sources/PackageModel/Module/BinaryModule.swift:33-55 | Sources/PackageModel/Module/SystemLibraryModule.swift:28-51 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) Sources/_InternalTestSupport/ManifestExtensions.swift:271— Sources/_InternalTestSupport/ManifestExtensions.swift:271-294 | Sources/_InternalTestSupport/ManifestExtensions.swift:296-318 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:377— Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:377-396 | Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:398-417 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:1207— Sources/Runtimes/PackageDescription/Target.swift:1207-1226 | Sources/Runtimes/PackageDescription/Target.swift:1271-1291 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/Basics/Graph/DirectedGraph.swift:35— Sources/Basics/Graph/DirectedGraph.swift:35-55 | Sources/Basics/Graph/UndirectedGraph.swift:37-56 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×3
Edited copy of a member (19 corresponding lines) Sources/Commands/PackageCommands/Config.swift:127— Sources/Commands/PackageCommands/Config.swift:127-145 | Sources/PackageRegistryCommand/PackageRegistryCommand.swift:148-167 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/PackageModel/Manifest/PackageDependencyDescription.swift:356— Sources/PackageModel/Manifest/PackageDependencyDescription.swift:356-374 | Sources/PackageModel/Manifest/PackageDependencyDescription.swift:394-412 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) Sources/SBOMModel/Extractor/SBOMFilterStrategy.swift:55— Sources/SBOMModel/Extractor/SBOMFilterStrategy.swift:55-73 | Sources/SBOMModel/Extractor/SBOMFilterStrategy.swift:91-109 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 3) Sources/CoreCommands/BuildSystemSupport.swift:30— Sources/CoreCommands/BuildSystemSupport.swift:30-40 | Sources/CoreCommands/BuildSystemSupport.swift:82-92 | Sources/CoreCommands/BuildSystemSupport.swift:114-124 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CoreCommands/BuildSystemSupport.swift:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Sources/Commands/SwiftTestCommand.swift:376— Sources/Commands/SwiftTestCommand.swift:376-386 | Sources/Commands/SwiftTestCommand.swift:488-498 | Sources/Commands/SwiftTestCommand.swift:605-615 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) Sources/_InternalTestSupport/ManifestExtensions.swift:113— Sources/_InternalTestSupport/ManifestExtensions.swift:113-123 | Sources/_InternalTestSupport/ManifestExtensions.swift:154-164 | Sources/_InternalTestSupport/ManifestExtensions.swift:194-204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/ManifestExtensions.swift:113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) Sources/Runtimes/PackageDescription/Target.swift:455— Sources/Runtimes/PackageDescription/Target.swift:455-462 | Sources/Runtimes/PackageDescription/Target.swift:510-517 | Sources/Runtimes/PackageDescription/Target.swift:568-575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/Runtimes/PackageDescription/Target.swift:626— Sources/Runtimes/PackageDescription/Target.swift:626-633 | Sources/Runtimes/PackageDescription/Target.swift:682-689 | Sources/Runtimes/PackageDescription/Target.swift:740-747 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:626` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/Runtimes/PackageDescription/Target.swift:878— Sources/Runtimes/PackageDescription/Target.swift:878-885 | Sources/Runtimes/PackageDescription/Target.swift:930-937 | Sources/Runtimes/PackageDescription/Target.swift:985-992 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:878` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Swallowed exception (empty catch) Sources/PackageModel/MinimumDeploymentTarget.swift:95— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Sources/PackageLoading/Platform.swift:76— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Sources/Commands/PackageCommands/SwiftPackageCommand.swift:141— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
SourceCodeFragment.init (cyclomatic 16) Sources/PackageModel/ManifestSourceGeneration.swift:164— SourceCodeFragment.init has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: SourceCodeFragment.init (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
SourceCodeFragment.init (cyclomatic 16) Sources/PackageModel/ManifestSourceGeneration.swift:264— SourceCodeFragment.init has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceCodeFragment.init (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:468— Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:468-489 | Sources/PackageModel/Manifest/ProductDescription.swift:262-289 | Sources/PackageModel/Manifest/SystemPackageProviderDescription.swift:48-75 | Sources/PackageModel/Manifest/TargetDescription.swift:544-568 | Sources/PackageModel/Manifest/TargetDescription.swift:594-608 | Sources/PackageModel/Manifest/TargetDescription.swift:626-638 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/_InternalTestSupport/ManifestExtensions.swift:20— Sources/_InternalTestSupport/ManifestExtensions.swift:20-61 | Sources/_InternalTestSupport/ManifestExtensions.swift:63-102 | Sources/_InternalTestSupport/ManifestExtensions.swift:104-142 | Sources/_InternalTestSupport/ManifestExtensions.swift:144-182 | Sources/_InternalTestSupport/ManifestExtensions.swift:184-222 | Sources/_InternalTestSupport/ManifestExtensions.swift:224-269 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/Commands/PackageCommands/PluginCommand.swift:469— Sources/Commands/PackageCommands/PluginCommand.swift:469-477 | Sources/Commands/PackageCommands/PluginCommand.swift:493-501 | Sources/Commands/Utilities/DescribedPackage.swift:200-208 | Sources/PackageModel/Module/PluginModule.swift:92-100 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:280-288 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/_InternalTestSupport/misc.swift:486— Sources/_InternalTestSupport/misc.swift:486-507 | Sources/_InternalTestSupport/misc.swift:509-530 | Sources/_InternalTestSupport/misc.swift:532-556 | Sources/_InternalTestSupport/misc.swift:558-578 | Sources/_InternalTestSupport/misc.swift:580-600 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×2
Edited copy of a member (49 corresponding lines) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1030— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1030-1078 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1082-1143 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (49 corresponding lines) Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:123— Sources/PackageLoading/RegistryReleaseMetadataSerialization.swift:123-171 | Sources/PackageRegistry/RegistryClient.swift:2311-2362 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) Sources/Basics/SQLiteBackedCache.swift:192— Sources/Basics/SQLiteBackedCache.swift:192-223 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:883-925 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:985— Sources/Runtimes/PackageDescription/Target.swift:985-1016 | Sources/Runtimes/PackageDescription/Target.swift:1042-1074 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:143— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:143-179 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:198-237 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:275— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:275-311 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:329-366 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×2
Edited copies of one member (3 members, 18+ corresponding lines) Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:76— Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:76-93 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:95-113 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:115-135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) Sources/_InternalBuildTestSupport/PIFTester.swift:36— Sources/_InternalBuildTestSupport/PIFTester.swift:36-53 | Sources/_InternalBuildTestSupport/PIFTester.swift:152-170 | Sources/_InternalBuildTestSupport/PIFTester.swift:224-241 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) Sources/Runtimes/PackageDescription/PackageDependency.swift:697— Sources/Runtimes/PackageDescription/PackageDependency.swift:697-709 | Sources/Runtimes/PackageDescription/PackageDependency.swift:728-748 | Sources/Runtimes/PackageDescription/PackageDependency.swift:1108-1121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) Sources/Basics/FileSystem/InMemoryFileSystem.swift:309— Sources/Basics/FileSystem/InMemoryFileSystem.swift:309-321 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:340-352 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:386-402 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) Sources/PackageGraph/ResolvedPackagesStore.swift:331— Sources/PackageGraph/ResolvedPackagesStore.swift:331-338 | Sources/PackageGraph/ResolvedPackagesStore.swift:433-441 | Sources/PackageGraph/ResolvedPackagesStore.swift:514-524 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/Runtimes/PackageDescription/PackageDependency.swift:553— Sources/Runtimes/PackageDescription/PackageDependency.swift:553-560 | Sources/Runtimes/PackageDescription/PackageDependency.swift:629-636 | Sources/Runtimes/PackageDescription/PackageDependency.swift:1052-1059 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×2
Edited copies of one member (3 members, 4+ corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:1295— Sources/Runtimes/PackageDescription/Target.swift:1295-1298 | Sources/Runtimes/PackageDescription/Target.swift:1366-1374 | Sources/Runtimes/PackageDescription/Target.swift:1385-1393 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Sources/Basics/Sandbox.swift:251— Sources/Basics/Sandbox.swift:251-256 | Sources/Commands/Utilities/DOTManifestSerializer.swift:40-43 | Sources/PackageModel/ManifestSourceGeneration.swift:1236-1241 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) Sources/Workspace/PackageContainer/FileSystemPackageContainer.swift:97— Sources/Workspace/PackageContainer/FileSystemPackageContainer.swift:97-100 | Sources/Workspace/PackageContainer/RegistryPackageContainer.swift:114-117 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/_InternalTestSupport/PackageGraphTester.swift:177— Sources/_InternalTestSupport/PackageGraphTester.swift:177-182 | Sources/_InternalTestSupport/PackageGraphTester.swift:273-276 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) Sources/PackageModel/ManifestSourceGeneration.swift:1236— Sources/PackageModel/ManifestSourceGeneration.swift:1236-1241 | Sources/SwiftBuildSupport/DotPIFSerializer.swift:237-243 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) Examples/package-registry/Sources/RegistryExample/Routes/AvailabilityRoutes.swift:30— Examples/package-registry/Sources/RegistryExample/Routes/AvailabilityRoutes.swift:30-37 | Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:306-311 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (30 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:245— Sources/PackageCollectionsSigning/CertificatePolicy.swift:245-274 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:247-276 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:321— Sources/PackageCollectionsSigning/CertificatePolicy.swift:321-350 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:324-353 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) Sources/Basics/HTTPClient/HTTPClient.swift:91— Sources/Basics/HTTPClient/HTTPClient.swift:91-118 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:86-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (28 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:171— Sources/PackageCollectionsSigning/CertificatePolicy.swift:171-198 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:172-199 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (24–26 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:176— Sources/PackageRegistry/SignatureValidation.swift:176-199 | Sources/PackageRegistry/SignatureValidation.swift:449-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24–26 lines × 2) Sources/Workspace/InitPackage.swift:313— Sources/Workspace/InitPackage.swift:313-336 | Sources/Workspace/InitPackage.swift:448-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Workspace/InitPackage.swift:313` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:536— Sources/PackageCollectionsSigning/CertificatePolicy.swift:536-560 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:539-563 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:106— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:106-130 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:161-185 — before extracting anything, compare `Sources/PackageCollectionsSigning/PackageCollectionSigning.swift` and `Sources/Workspace/ManifestSigning/ManifestSigning.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `trustedRootCertsDir` to `URL? = nil` in one and `AbsolutePath? = nil` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (21 lines × 3) Sources/PackageCollectionsSigning/CertificatePolicy.swift:149— Sources/PackageCollectionsSigning/CertificatePolicy.swift:149-169 | Sources/PackageCollectionsSigning/CertificatePolicy.swift:223-243 | Sources/PackageCollectionsSigning/CertificatePolicy.swift:299-319 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3) Sources/Workspace/Workspace+State.swift:568— Sources/Workspace/Workspace+State.swift:568-588 | Sources/Workspace/Workspace+State.swift:924-944 | Sources/Workspace/Workspace+State.swift:1251-1271 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:235— Sources/PackageRegistry/SignatureValidation.swift:235-254 | Sources/PackageRegistry/SignatureValidation.swift:496-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:235` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) Sources/PackageModel/Manifest/ProductDescription.swift:241— Sources/PackageModel/Manifest/ProductDescription.swift:241-260 | Sources/PackageModel/Manifest/SystemPackageProviderDescription.swift:27-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:199— Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:199-214 | Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:342-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) Sources/SPMBuildCore/Plugins/PluginInvocation.swift:87— Sources/SPMBuildCore/Plugins/PluginInvocation.swift:87-101 | Sources/SPMBuildCore/Plugins/PluginInvocation.swift:398-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:792— Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:792-807 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:821-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:792` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:191— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:191-206 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:250-265 — before extracting anything, compare `Sources/PackageCollectionsSigning/PackageCollectionSigning.swift` and `Sources/Workspace/ManifestSigning/ManifestSigning.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) Sources/PackageRegistry/RegistryClient.swift:488— Sources/PackageRegistry/RegistryClient.swift:488-501 | Sources/PackageRegistry/RegistryClient.swift:632-645 | Sources/PackageRegistry/RegistryClient.swift:759-772 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) Sources/_InternalTestSupport/ManifestExtensions.swift:43— Sources/_InternalTestSupport/ManifestExtensions.swift:43-56 | Sources/_InternalTestSupport/ManifestExtensions.swift:85-98 | Sources/_InternalTestSupport/ManifestExtensions.swift:125-138 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 2) Sources/XCBuildSupport/PIFBuilder.swift:189— Sources/XCBuildSupport/PIFBuilder.swift:189-202 | Sources/XCBuildSupport/PIFBuilder.swift:1229-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/XCBuildSupport/PIFBuilder.swift:1229` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–14 lines × 2) Sources/_InternalTestSupport/MockPackageGraphs.swift:83— Sources/_InternalTestSupport/MockPackageGraphs.swift:83-96 | Sources/_InternalTestSupport/MockPackageGraphs.swift:159-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageGraphs.swift:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) Sources/PackageModel/Manifest/Manifest.swift:224— Sources/PackageModel/Manifest/Manifest.swift:224-236 | Sources/PackageModel/Manifest/Manifest.swift:240-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/Manifest/Manifest.swift:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:684— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:684-696 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:214-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:684` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) Sources/Runtimes/PackagePlugin/Plugin.swift:161— Sources/Runtimes/PackagePlugin/Plugin.swift:161-172 | Sources/Runtimes/PackagePlugin/Plugin.swift:331-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) Sources/Workspace/Workspace+Editing.swift:31— Sources/Workspace/Workspace+Editing.swift:31-42 | Sources/Workspace/Workspace.swift:768-778 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Workspace/Workspace+Editing.swift:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) Sources/Basics/FileSystem/InMemoryFileSystem.swift:364— Sources/Basics/FileSystem/InMemoryFileSystem.swift:364-374 | Sources/Basics/FileSystem/InMemoryFileSystem.swift:467-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/FileSystem/InMemoryFileSystem.swift:364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) Sources/Runtimes/PackageDescription/Target.swift:879— Sources/Runtimes/PackageDescription/Target.swift:879-889 | Sources/Runtimes/PackageDescription/Target.swift:931-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:879` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 3) Sources/Commands/PackageCommands/DumpCommands.swift:170— Sources/Commands/PackageCommands/DumpCommands.swift:170-179 | Sources/Commands/SwiftTestCommand.swift:997-1005 | Sources/Commands/SwiftTestCommand.swift:1369-1377 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–10 lines × 3) Sources/PackageCollectionsSigning/CertificatePolicy.swift:362— Sources/PackageCollectionsSigning/CertificatePolicy.swift:362-370 | Sources/PackageSigning/VerifierPolicies.swift:82-91 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:365-373 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/PackageSigning/VerifierPolicies.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:99— Sources/Basics/Archiver/TarArchiver.swift:99-108 | Sources/Basics/Archiver/TarArchiver.swift:126-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Basics/Archiver/TarArchiver.swift:95` calls `exists`, `FileSystemError` and `Sources/Basics/Archiver/TarArchiver.swift:125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) Sources/Basics/FileSystem/FileSystem+Extensions.swift:378— Sources/Basics/FileSystem/FileSystem+Extensions.swift:378-386 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:392-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/FileSystem/FileSystem+Extensions.swift:392` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/SourceControl/GitRepository.swift:1684— Sources/SourceControl/GitRepository.swift:1684-1692 | Sources/SourceControl/GitRepository.swift:1695-1703 | Sources/SourceControl/GitRepository.swift:1706-1714 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SourceControl/GitRepository.swift:1684` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 3) Sources/_InternalTestSupport/ManifestExtensions.swift:30— Sources/_InternalTestSupport/ManifestExtensions.swift:30-38 | Sources/_InternalTestSupport/ManifestExtensions.swift:72-80 | Sources/_InternalTestSupport/ManifestExtensions.swift:237-245 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/ManifestExtensions.swift:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Sync-over-async blocking Sources/SwiftSDKCommand/ConfigureSwiftSDK.swift:112— `run` is async and calls .wait() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/SwiftSDKCommand/SwiftSDKSubcommand.swift:58— `run` is async and calls .wait() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
PackageBuilder.buildSettings (cyclomatic 85) Sources/PackageLoading/PackageBuilder.swift:1182— PackageBuilder.buildSettings has cyclomatic complexity 85 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PackagePIFProjectBuilder.buildSourceModule (cyclomatic 77) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:365— PackagePIFProjectBuilder.buildSourceModule has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModulesGraph+Loading.swift.createResolvedPackages (cyclomatic 74) Sources/PackageGraph/ModulesGraph+Loading.swift:383— ModulesGraph+Loading.swift.createResolvedPackages has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackagePIFProjectBuilder.makeMainModuleProduct (cyclomatic 61) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— PackagePIFProjectBuilder.makeMainModuleProduct has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VersionSetSpecifier.difference (cyclomatic 58) Sources/PackageGraph/VersionSetSpecifier.swift:256— VersionSetSpecifier.difference has cyclomatic complexity 58 (threshold 15). Of this number, 54 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TargetDescription.init (cyclomatic 53) Sources/PackageModel/Manifest/TargetDescription.swift:216— TargetDescription.init has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductBuildDescription.linkArguments (cyclomatic 50) Sources/Build/BuildDescription/ProductBuildDescription.swift:157— ProductBuildDescription.linkArguments has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Target.init (cyclomatic 48) Sources/Runtimes/PackageDescription/Target.swift:233— Target.init has cyclomatic complexity 48 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SwiftBuildSystem.makeBuildParameters (cyclomatic 48) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:922— SwiftBuildSystem.makeBuildParameters has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildPlan.computeDependencies (cyclomatic 44) Sources/Build/BuildPlan/BuildPlan+Product.swift:121— BuildPlan.computeDependencies has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BuildPlan.computeDependencies::successors) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Kind.from (cyclomatic 42) Sources/PackageLoading/ManifestJSONParser.swift:713— Kind.from has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackageBuilder.createTarget (cyclomatic 39) Sources/PackageLoading/PackageBuilder.swift:869— PackageBuilder.createTarget has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftBuildSystem.startSWBuildOperation (cyclomatic 36) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:664— SwiftBuildSystem.startSWBuildOperation has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AsyncProcess.launch (cyclomatic 34) Sources/Basics/Concurrency/AsyncProcess.swift:468— AsyncProcess.launch has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackagePIFProjectBuilder.buildLibraryProduct (cyclomatic 34) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:699— PackagePIFProjectBuilder.buildLibraryProduct has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftBuildSystemMessageHandler.emitEvent (cyclomatic 34) Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:216— SwiftBuildSystemMessageHandler.emitEvent has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleAliasTracker.disambiguateAndApplyAliases (cyclomatic 33) Sources/PackageGraph/ModuleAliasTracker.swift:702— ModuleAliasTracker.disambiguateAndApplyAliases has cyclomatic complexity 33 (threshold 15). Of this number, 24 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackageBuilder.constructProducts (cyclomatic 33) Sources/PackageLoading/PackageBuilder.swift:1625— PackageBuilder.constructProducts has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftModuleBuildDescription.compileArguments (cyclomatic 32) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:498— SwiftModuleBuildDescription.compileArguments has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModuleError.description (cyclomatic 32) Sources/PackageLoading/PackageBuilder.swift:114— ModuleError.description has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PackageBuilder.createModules (cyclomatic 32) Sources/PackageLoading/PackageBuilder.swift:671— PackageBuilder.createModules has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PrebuiltsPlatform.hostPlatform (cyclomatic 32) Sources/PackageModel/PrebuiltLibrary.swift:149— PrebuiltsPlatform.hostPlatform has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PubGrubDependencyResolver.processInputs (cyclomatic 31) Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:388— PubGrubDependencyResolver.processInputs has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TargetSourcesBuilder.computeContents (cyclomatic 31) Sources/PackageLoading/TargetSourcesBuilder.swift:438— TargetSourcesBuilder.computeContents has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceCodeFragment.init (cyclomatic 28) Sources/PackageModel/ManifestSourceGeneration.swift:656— SourceCodeFragment.init has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceCodeFragment.init (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
PluginContextDeserializer.target (cyclomatic 28) Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:68— PluginContextDeserializer.target has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SBOMExtractor.extractDependenciesForProducts (cyclomatic 28) Sources/SBOMModel/Extractor/SBOMDependenciesExtractor.swift:59— SBOMExtractor.extractDependenciesForProducts has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 5 function items inside it that branch (processProductDependency, processModuleDependency, processDependencies, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Workspace._updateBinaryArtifacts (cyclomatic 28) Sources/Workspace/Workspace+BinaryArtifacts.swift:883— Workspace._updateBinaryArtifacts has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InitPackage.writeManifestFile (cyclomatic 28) Sources/Workspace/InitPackage.swift:160— InitPackage.writeManifestFile has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Collection.recursivelyTraverseTransitiveLinkageDependencies (cyclomatic 27) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:1094— Collection.recursivelyTraverseTransitiveLinkageDependencies has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 3 function items inside it that branch (visitDependency, widenReachability, stopsTraversal). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Workspace.computePackageStateChanges (cyclomatic 27) Sources/Workspace/Workspace+Dependencies.swift:1151— Workspace.computePackageStateChanges has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftPMBuildServer.handle (cyclomatic 27) Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:240— SwiftPMBuildServer.handle has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BuildPlan.init (cyclomatic 26) Sources/Build/BuildPlan/BuildPlan.swift:243— BuildPlan.init has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ResolvedModule.computeAllBuildSettings (cyclomatic 26) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:728— ResolvedModule.computeAllBuildSettings has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SQLitePackageCollectionsStorage.searchTargets (cyclomatic 25) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:426— SQLitePackageCollectionsStorage.searchTargets has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DiagnosticReportBuilder.visit (cyclomatic 25) Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift:79— DiagnosticReportBuilder.visit has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceCodeFragment.init (cyclomatic 25) Sources/PackageModel/ManifestSourceGeneration.swift:364— SourceCodeFragment.init has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: SourceCodeFragment.init (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
UserToolchain.init (cyclomatic 25) Sources/PackageModel/UserToolchain.swift:760— UserToolchain.init has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SwiftSDK.deriveTargetSwiftSDK (cyclomatic 25) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:748— SwiftSDK.deriveTargetSwiftSDK has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SwiftModuleBuildDescription.writeOutputFileMap (cyclomatic 23) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:817— SwiftModuleBuildDescription.writeOutputFileMap has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildPlan.plan (cyclomatic 23) Sources/Build/BuildPlan/BuildPlan+Product.swift:35— BuildPlan.plan has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleAliasTracker.addAliases (cyclomatic 23) Sources/PackageGraph/ModuleAliasTracker.swift:430— ModuleAliasTracker.addAliases has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackagePIFBuilder.build (cyclomatic 23) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:484— PackagePIFBuilder.build has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
XCBuildDelegate.xcBuildOutputParser (cyclomatic 23) Sources/XCBuildSupport/XCBuildDelegate.swift:64— XCBuildDelegate.xcBuildOutputParser has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClangModuleBuildDescription.basicArguments (cyclomatic 22) Sources/Build/BuildDescription/ClangModuleBuildDescription.swift:295— ClangModuleBuildDescription.basicArguments has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SwiftRunCommand.run (cyclomatic 22) Sources/Commands/SwiftRunCommand.swift:116— SwiftRunCommand.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginCommand.run (cyclomatic 22) Sources/Commands/PackageCommands/PluginCommand.swift:221— PluginCommand.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiagnosticReportBuilder.description (cyclomatic 22) Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift:188— DiagnosticReportBuilder.description has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitProgressParser.init (cyclomatic 21) Sources/SourceControl/GitRepository.swift:1670— GitProgressParser.init has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Sandbox.swift.macOSSandboxProfile (cyclomatic 20) Sources/Basics/Sandbox.swift:111— Sandbox.swift.macOSSandboxProfile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildOperation.build (cyclomatic 20) Sources/Build/BuildOperation.swift:430— BuildOperation.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BuildOperation.computeLLBuildTargetName (cyclomatic 20) Sources/Build/BuildOperation.swift:687— BuildOperation.computeLLBuildTargetName has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildPlan.computeDependencies::successors (cyclomatic 20) Sources/Build/BuildPlan/BuildPlan+Product.swift:160— BuildPlan.computeDependencies::successors has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (BuildPlan.computeDependencies) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BuildPlan.traverseModules (cyclomatic 20) Sources/Build/BuildPlan/BuildPlan.swift:1070— BuildPlan.traverseModules has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (successors). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PackageGraphError.description (cyclomatic 20) Sources/PackageGraph/ModulesGraph.swift:299— PackageGraphError.description has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ManifestLoader.evaluateManifest (cyclomatic 20) Sources/PackageLoading/ManifestLoader.swift:699— ManifestLoader.evaluateManifest has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Manifest.dependenciesTraitGuarded (cyclomatic 20) Sources/PackageModel/Manifest/Manifest.swift:214— Manifest.dependenciesTraitGuarded has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TestingSupport.constructTestEnvironment (cyclomatic 19) Sources/Commands/Utilities/TestingSupport.swift:263— TestingSupport.constructTestEnvironment has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PackageBuilder.constructV4Targets (cyclomatic 19) Sources/PackageLoading/PackageBuilder.swift:553— PackageBuilder.constructV4Targets has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (findPath). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TargetSourcesBuilder.computeContents (cyclomatic 19) Sources/PackageLoading/TargetSourcesBuilder.swift:557— TargetSourcesBuilder.computeContents has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSystem.getOrCreateSwiftPMConfigurationDirectory (cyclomatic 19) Sources/Basics/FileSystem/FileSystem+Extensions.swift:343— FileSystem.getOrCreateSwiftPMConfigurationDirectory has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackageSigningEntityTOFU.validateSigningEntity (cyclomatic 19) Sources/PackageRegistry/SigningEntityTOFU.swift:99— PackageSigningEntityTOFU.validateSigningEntity has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Plugin.handleMessage (cyclomatic 19) Sources/Runtimes/PackagePlugin/Plugin.swift:145— Plugin.handleMessage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SPDXConverter.convertToExternalIdentifiers (cyclomatic 19) Sources/SBOMModel/Converter/SPDXConverter.swift:172— SPDXConverter.convertToExternalIdentifiers has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Workspace._edit (cyclomatic 19) Sources/Workspace/Workspace+Editing.swift:26— Workspace._edit has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClangHostDefaultObjectsDetector.swift.detectDefaultObjects::handleArgument (cyclomatic 18) Sources/BinarySymbols/ClangHostDefaultObjectsDetector.swift:62— ClangHostDefaultObjectsDetector.swift.detectDefaultObjects::handleArgument has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LLBuildManifestBuilder.createClangCompileCommand (cyclomatic 18) Sources/Build/BuildManifest/LLBuildManifestBuilder+Clang.swift:23— LLBuildManifestBuilder.createClangCompileCommand has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginDelegate.performTestsForPlugin (cyclomatic 18) Sources/Commands/Utilities/PluginDelegate.swift:220— PluginDelegate.performTestsForPlugin has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SQLitePackageCollectionsStorage.populateTargetTrie (cyclomatic 18) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:743— SQLitePackageCollectionsStorage.populateTargetTrie has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModulesGraph+Loading.swift.checkAllDependenciesAreUsed (cyclomatic 18) Sources/PackageGraph/ModulesGraph+Loading.swift:236— ModulesGraph+Loading.swift.checkAllDependenciesAreUsed has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RegistryClient.publish (cyclomatic 18) Sources/PackageRegistry/RegistryClient.swift:1135— RegistryClient.publish has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: RegistryError.description (cyclomatic 53) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
PURL.extractNamespace (cyclomatic 18) Sources/SBOMModel/Extractor/PURL.swift:100— PURL.extractNamespace has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Workspace.prefetchPackages (cyclomatic 18) Sources/Workspace/Workspace+Dependencies.swift:1321— Workspace.prefetchPackages has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KeychainAuthorizationProvider.authentication (cyclomatic 17) Sources/Basics/AuthorizationProvider.swift:276— KeychainAuthorizationProvider.authentication has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs (cyclomatic 17) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:218— LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (LLBuildManifestBuilder.computeSwiftCompileCmdInputs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BuildPlan.computeDestinations (cyclomatic 17) Sources/Build/BuildPlan/BuildPlan.swift:982— BuildPlan.computeDestinations has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (successors). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginDelegate.performBuildForPlugin (cyclomatic 17) Sources/Commands/Utilities/PluginDelegate.swift:119— PluginDelegate.performBuildForPlugin has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SQLitePackageCollectionsStorage.searchPackages (cyclomatic 17) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:261— SQLitePackageCollectionsStorage.searchPackages has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuplicateProductsChecker.run (cyclomatic 17) Sources/PackageGraph/ModulesGraph+Loading.swift:1162— DuplicateProductsChecker.run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserToolchain.deriveSwiftCFlags (cyclomatic 17) Sources/PackageModel/UserToolchain.swift:587— UserToolchain.deriveSwiftCFlags has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginModule.invoke::handleMessage (cyclomatic 17) Sources/SPMBuildCore/Plugins/PluginInvocation.swift:266— PluginModule.invoke::handleMessage has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SignatureValidation.getAndValidateSourceArchiveSignature (cyclomatic 17) Sources/PackageRegistry/SignatureValidation.swift:124— SignatureValidation.getAndValidateSourceArchiveSignature has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SBOMValidator.collectSchemaMetadata (cyclomatic 17) Sources/SBOMModel/Validator/SBOMValidator.swift:728— SBOMValidator.collectSchemaMetadata has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultPluginScriptRunner.invoke (cyclomatic 17) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:452— DefaultPluginScriptRunner.invoke has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Workspace.tryResolveBasedOnResolvedVersionsFile (cyclomatic 17) Sources/Workspace/Workspace+Dependencies.swift:421— Workspace.tryResolveBasedOnResolvedVersionsFile has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Workspace.loadDependencyManifests (cyclomatic 17) Sources/Workspace/Workspace+Manifests.swift:494— Workspace.loadDependencyManifests has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Workspace.format (cyclomatic 17) Sources/Workspace/Workspace.swift:1518— Workspace.format has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PIFBuilder.swift.computeHostOnlyModuleIDsInRootPackages (cyclomatic 17) Sources/SwiftBuildSupport/PIFBuilder.swift:797— PIFBuilder.swift.computeHostOnlyModuleIDsInRootPackages has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Workspace.init (cyclomatic 17) Sources/Workspace/Workspace.swift:426— Workspace.init has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AsyncOperationQueue.waitIfNeeded (cyclomatic 16) Sources/Basics/Concurrency/ConcurrencyHelpers.swift:174— AsyncOperationQueue.waitIfNeeded has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs (cyclomatic 16) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:195— LLBuildManifestBuilder.computeSwiftCompileCmdInputs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BuildPlan.plan (cyclomatic 16) Sources/Build/BuildPlan/BuildPlan+Clang.swift:25— BuildPlan.plan has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
APIDiff.determineModulesToDiff (cyclomatic 16) Sources/Commands/PackageCommands/APIDiff.swift:327— APIDiff.determineModulesToDiff has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftCommandState.postprocessArgParserResult (cyclomatic 16) Sources/CoreCommands/SwiftCommandState.swift:530— SwiftCommandState.postprocessArgParserResult has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PubGrubDependencyResolver.resolve (cyclomatic 16) Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:680— PubGrubDependencyResolver.resolve has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ManifestValidator.validateBinaryTargets (cyclomatic 16) Sources/PackageLoading/ManifestLoader+Validation.swift:166— ManifestValidator.validateBinaryTargets has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TargetSourcesBuilder.computeRule (cyclomatic 16) Sources/PackageLoading/TargetSourcesBuilder.swift:241— TargetSourcesBuilder.computeRule has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserToolchain.deriveSwiftPMLibrariesLocation (cyclomatic 16) Sources/PackageModel/UserToolchain.swift:989— UserToolchain.deriveSwiftPMLibrariesLocation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultPluginScriptRunner.compilePluginScript (cyclomatic 16) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:242— DefaultPluginScriptRunner.compilePluginScript has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PluginContextSerializer.serialize (cyclomatic 16) Sources/SPMBuildCore/Plugins/PluginContextSerializer.swift:81— PluginContextSerializer.serialize has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Workspace._updateDependencies (cyclomatic 16) Sources/Workspace/Workspace+Dependencies.swift:63— Workspace._updateDependencies has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PIFBuilder.swift.buildAggregatePIFProject (cyclomatic 16) Sources/SwiftBuildSupport/PIFBuilder.swift:887— PIFBuilder.swift.buildAggregatePIFProject has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D12 · Dependency Hygiene· No Package.resolved committed (Benchmarks/Package.swift) · ×1
No Package.resolved committed (Benchmarks/Package.swift) — Benchmarks/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/DependencyResolution/External/CUsingCDep/Bar/Package.swift) · ×1
No Package.resolved committed (Fixtures/DependencyResolution/External/CUsingCDep/Bar/Package.swift) — Fixtures/DependencyResolution/External/CUsingCDep/Bar/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/DependencyResolution/External/Complex/app/Package.swift) · ×1
No Package.resolved committed (Fixtures/DependencyResolution/External/Complex/app/Package.swift) — Fixtures/DependencyResolution/External/Complex/app/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/DependencyResolution/External/Mirror/App/Package.swift) · ×1
No Package.resolved committed (Fixtures/DependencyResolution/External/Mirror/App/Package.swift) — Fixtures/DependencyResolution/External/Mirror/App/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/DependencyResolution/External/Simple/Bar/Package.swift) · ×1
No Package.resolved committed (Fixtures/DependencyResolution/External/Simple/Bar/Package.swift) — Fixtures/DependencyResolution/External/Simple/Bar/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/CWarningControlFlagsInManifest/downstream/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/CWarningControlFlagsInManifest/downstream/Package.swift) — Fixtures/Miscellaneous/CWarningControlFlagsInManifest/downstream/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/DependenciesWarnings/app/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/DependenciesWarnings/app/Package.swift) — Fixtures/Miscellaneous/DependenciesWarnings/app/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/DependenciesWarnings2/app/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/DependenciesWarnings2/app/Package.swift) — Fixtures/Miscellaneous/DependenciesWarnings2/app/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/DependencyEdges/External/dep2/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/DependencyEdges/External/dep2/Package.swift) — Fixtures/Miscellaneous/DependencyEdges/External/dep2/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/DependencyEdges/External/root/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/DependencyEdges/External/root/Package.swift) — Fixtures/Miscellaneous/DependencyEdges/External/root/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/Edit/App/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/Edit/App/Package.swift) — Fixtures/Miscellaneous/Edit/App/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/ExactDependencies/FooExec/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/ExactDependencies/FooExec/Package.swift) — Fixtures/Miscellaneous/ExactDependencies/FooExec/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/ExactDependencies/app/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/ExactDependencies/app/Package.swift) — Fixtures/Miscellaneous/ExactDependencies/app/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/LocalPackageAsURL/Bar/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/LocalPackageAsURL/Bar/Package.swift) — Fixtures/Miscellaneous/LocalPackageAsURL/Bar/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/MissingDependency/Bar/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/MissingDependency/Bar/Package.swift) — Fixtures/Miscellaneous/MissingDependency/Bar/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/PackageEdit/foo/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/PackageEdit/foo/Package.swift) — Fixtures/Miscellaneous/PackageEdit/foo/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/PackageNameFlag/appPkg/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/PackageNameFlag/appPkg/Package.swift) — Fixtures/Miscellaneous/PackageNameFlag/appPkg/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/PkgConfig/SystemModuleUser/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/PkgConfig/SystemModuleUser/Package.swift) — Fixtures/Miscellaneous/PkgConfig/SystemModuleUser/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/PkgConfig/SystemModuleUserClang/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/PkgConfig/SystemModuleUserClang/Package.swift) — Fixtures/Miscellaneous/PkgConfig/SystemModuleUserClang/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/SystemModules/TestExec/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/SystemModules/TestExec/Package.swift) — Fixtures/Miscellaneous/SystemModules/TestExec/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/UnreachableTargets/A/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/UnreachableTargets/A/Package.swift) — Fixtures/Miscellaneous/UnreachableTargets/A/Package.swift declares 2 dependencies and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/WarningControlFlagsInManifest/downstream/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/WarningControlFlagsInManifest/downstream/Package.swift) — Fixtures/Miscellaneous/WarningControlFlagsInManifest/downstream/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/WarningsAsErrorsInLocalPackage/downstream/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/WarningsAsErrorsInLocalPackage/downstream/Package.swift) — Fixtures/Miscellaneous/WarningsAsErrorsInLocalPackage/downstream/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/Miscellaneous/WarningsAsErrorsWithRemoteDep/downstream/Package.swift) · ×1
No Package.resolved committed (Fixtures/Miscellaneous/WarningsAsErrorsWithRemoteDep/downstream/Package.swift) — Fixtures/Miscellaneous/WarningsAsErrorsWithRemoteDep/downstream/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/ModuleMaps/Direct/App/Package.swift) · ×1
No Package.resolved committed (Fixtures/ModuleMaps/Direct/App/Package.swift) — Fixtures/ModuleMaps/Direct/App/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
D12 · Dependency Hygiene· No Package.resolved committed (Fixtures/ModuleMaps/Transitive/packageA/Package.swift) · ×1
No Package.resolved committed (Fixtures/ModuleMaps/Transitive/packageA/Package.swift) — Fixtures/ModuleMaps/Transitive/packageA/Package.swift declares 1 dependency and no `.library` product, so it is an APPLICATION — but no `Package.resolved` is committed beside it. Nothing records the versions a working build resolved to, so `swift build` re-resolves against whatever each dependency's git host serves today and two builds of this commit are not guaranteed to be the same build. Build once and commit the resulting `Package.resolved`. (A published LIBRARY correctly omits its resolution — SwiftPM ignores a library's `Package.resolved` when the package is consumed — which is why this is asked only of a package that ships no `.library` product.)
XxxComment Tests/PackageLoadingTests/ManifestSignatureParserTests.swift:138— // xxx — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
HackComment Sources/Commands/SwiftTestCommand.swift:1764— // HACK: tell the test bundle/executable that we want to run Swift Testing, not XCTest. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
ModulesGraph+Loading.swift.createResolvedPackages (cognitive 179) Sources/PackageGraph/ModulesGraph+Loading.swift:383— ModulesGraph+Loading.swift.createResolvedPackages has cognitive complexity 179 (threshold 15). Drivers by points: if/else 41 (116 pts), loops 15 (32 pts), boolean chains 14, match/switch 3 (9 pts), ternaries 3 (8 pts) (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFProjectBuilder.buildSourceModule (cognitive 111) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:365— PackagePIFProjectBuilder.buildSourceModule has cognitive complexity 111 (threshold 15). Drivers by points: if/else 50 (74 pts), ternaries 6 (13 pts), boolean chains 9, loops 6 (8 pts), match/switch 4 (7 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionSetSpecifier.difference (cognitive 108) Sources/PackageGraph/VersionSetSpecifier.swift:256— VersionSetSpecifier.difference has cognitive complexity 108 (threshold 15). Drivers by points: if/else 32 (91 pts), loops 5 (10 pts), match/switch 3 (7 pts) (nesting depth added 68). Of this number, 100 points are the body's own statements and 8 belong to 2 function items inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PackageBuilder.buildSettings (cognitive 102) Sources/PackageLoading/PackageBuilder.swift:1182— PackageBuilder.buildSettings has cognitive complexity 102 (threshold 15). Drivers by points: match/switch 23 (74 pts), if/else 10 (21 pts), ternaries 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 64). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PackagePIFProjectBuilder.makeMainModuleProduct (cognitive 98) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— PackagePIFProjectBuilder.makeMainModuleProduct has cognitive complexity 98 (threshold 15). Drivers by points: if/else 42 (71 pts), boolean chains 10, loops 4 (8 pts), ternaries 2 (6 pts), match/switch 2 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.computeDependencies (cognitive 88) Sources/Build/BuildPlan/BuildPlan+Product.swift:121— BuildPlan.computeDependencies has cognitive complexity 88 (threshold 15). Drivers by points: if/else 18 (59 pts), match/switch 8 (19 pts), loops 4 (16 pts), boolean chains 14, ternaries 1 (3 pts) (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BuildPlan.computeDependencies::successors) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TargetDescription.init (cognitive 86) Sources/PackageModel/Manifest/TargetDescription.swift:216— TargetDescription.init has cognitive complexity 86 (threshold 15). Drivers by points: if/else 42 (80 pts), boolean chains 5, match/switch 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftBuildSystem.startSWBuildOperation (cognitive 76) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:664— SwiftBuildSystem.startSWBuildOperation has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 6 (17 pts), match/switch 4 (11 pts), error handling 4 (6 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResolvedModule.computeAllBuildSettings (cognitive 67) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:728— ResolvedModule.computeAllBuildSettings has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (52 pts), loops 4 (10 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductBuildDescription.linkArguments (cognitive 65) Sources/Build/BuildDescription/ProductBuildDescription.swift:157— ProductBuildDescription.linkArguments has cognitive complexity 65 (threshold 15). Drivers by points: if/else 24 (40 pts), match/switch 6 (9 pts), loops 4 (8 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PubGrubDependencyResolver.processInputs (cognitive 63) Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:388— PubGrubDependencyResolver.processInputs has cognitive complexity 63 (threshold 15). Drivers by points: loops 12 (29 pts), if/else 12 (26 pts), match/switch 3 (8 pts) (nesting depth added 36). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ModuleAliasTracker.disambiguateAndApplyAliases (cognitive 62) Sources/PackageGraph/ModuleAliasTracker.swift:702— ModuleAliasTracker.disambiguateAndApplyAliases has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 11 (18 pts), boolean chains 5, ternaries 2 (nesting depth added 27). Of this number, 47 points are the body's own statements and 15 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncProcess.launch (cognitive 61) Sources/Basics/Concurrency/AsyncProcess.swift:468— AsyncProcess.launch has cognitive complexity 61 (threshold 15). Drivers by points: if/else 31 (51 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageBuilder.createTarget (cognitive 59) Sources/PackageLoading/PackageBuilder.swift:869— PackageBuilder.createTarget has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 9, ternaries 3 (7 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleAliasTracker.addAliases (cognitive 56) Sources/PackageGraph/ModuleAliasTracker.swift:430— ModuleAliasTracker.addAliases has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 7 (15 pts), boolean chains 7 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFProjectBuilder.buildLibraryProduct (cognitive 56) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:699— PackagePIFProjectBuilder.buildLibraryProduct has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 6, ternaries 3 (6 pts), loops 3 (5 pts), match/switch 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftBuildSystem.makeBuildParameters (cognitive 55) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:922— SwiftBuildSystem.makeBuildParameters has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (38 pts), loops 5 (8 pts), match/switch 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetSourcesBuilder.computeContents (cognitive 53) Sources/PackageLoading/TargetSourcesBuilder.swift:438— TargetSourcesBuilder.computeContents has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 10, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginDelegate.performTestsForPlugin (cognitive 52) Sources/Commands/Utilities/PluginDelegate.swift:220— PluginDelegate.performTestsForPlugin has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 6 (14 pts), ternaries 2 (10 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageBuilder.createModules (cognitive 52) Sources/PackageLoading/PackageBuilder.swift:671— PackageBuilder.createModules has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (41 pts), match/switch 4 (7 pts), boolean chains 3, loops 1 (nesting depth added 20). Of this number, 49 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.computePackageStateChanges (cognitive 51) Sources/Workspace/Workspace+Dependencies.swift:1151— Workspace.computePackageStateChanges has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 3 (9 pts), boolean chains 3, ternaries 1 (3 pts), loops 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PIFBuilder.makePIFBuilders (cognitive 50) Sources/SwiftBuildSupport/PIFBuilder.swift:267— PIFBuilder.makePIFBuilders has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 6 (18 pts), ternaries 2 (8 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Kind.from (cognitive 49) Sources/PackageLoading/ManifestJSONParser.swift:713— Kind.from has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (47 pts), loops 1, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagnosticReportBuilder.visit (cognitive 49) Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift:79— DiagnosticReportBuilder.visit has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 7 (19 pts), boolean chains 7 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace._updateBinaryArtifacts (cognitive 48) Sources/Workspace/Workspace+BinaryArtifacts.swift:883— Workspace._updateBinaryArtifacts has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 7, loops 6 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageBuilder.constructProducts (cognitive 47) Sources/PackageLoading/PackageBuilder.swift:1625— PackageBuilder.constructProducts has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (36 pts), loops 3 (4 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 18). Of this number, 45 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InitPackage.writeManifestFile (cognitive 47) Sources/Workspace/InitPackage.swift:160— InitPackage.writeManifestFile has cognitive complexity 47 (threshold 15). Drivers by points: if/else 32 (45 pts), boolean chains 1, loops 1 (nesting depth added 13). Of this number, 45 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APIDiff.determineModulesToDiff (cognitive 44) Sources/Commands/PackageCommands/APIDiff.swift:327— APIDiff.determineModulesToDiff has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrebuiltsPlatform.hostPlatform (cognitive 43) Sources/PackageModel/PrebuiltLibrary.swift:149— PrebuiltsPlatform.hostPlatform has cognitive complexity 43 (threshold 15). Drivers by points: match/switch 14 (33 pts), if/else 9 (10 pts) (nesting depth added 20). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Target.init (cognitive 43) Sources/Runtimes/PackageDescription/Target.swift:233— Target.init has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 42, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SwiftPMBuildServer.handle (cognitive 43) Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:240— SwiftPMBuildServer.handle has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 5 (13 pts), boolean chains 4, error handling 2 (4 pts), match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PackagePIFProjectBuilder.addManifestBuildSettings (cognitive 43) Sources/XCBuildSupport/PIFBuilder.swift:984— PackagePIFProjectBuilder.addManifestBuildSettings has cognitive complexity 43 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (16 pts), match/switch 2 (11 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleAliasTracker.proposeAliases (cognitive 42) Sources/PackageGraph/ModuleAliasTracker.swift:590— ModuleAliasTracker.proposeAliases has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (20 pts) (nesting depth added 27). Of this number, 40 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SBOMValidator.collectSchemaMetadata (cognitive 42) Sources/SBOMModel/Validator/SBOMValidator.swift:728— SBOMValidator.collectSchemaMetadata has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PubGrubDependencyResolver.resolve (cognitive 40) Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:680— PubGrubDependencyResolver.resolve has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftSDK.deriveTargetSwiftSDK (cognitive 39) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:748— SwiftSDK.deriveTargetSwiftSDK has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 3 (7 pts), boolean chains 5, error handling 2 (5 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Sandbox.swift.macOSSandboxProfile (cognitive 38) Sources/Basics/Sandbox.swift:111— Sandbox.swift.macOSSandboxProfile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 5 (12 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClangHostDefaultObjectsDetector.swift.detectDefaultObjects::handleArgument (cognitive 38) Sources/BinarySymbols/ClangHostDefaultObjectsDetector.swift:62— ClangHostDefaultObjectsDetector.swift.detectDefaultObjects::handleArgument has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BuildPlan.plan (cognitive 37) Sources/Build/BuildPlan/BuildPlan+Product.swift:35— BuildPlan.plan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 5 (6 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginCommand.run (cognitive 37) Sources/Commands/PackageCommands/PluginCommand.swift:221— PluginCommand.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 3 (7 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicateProductsChecker.run (cognitive 37) Sources/PackageGraph/ModulesGraph+Loading.swift:1162— DuplicateProductsChecker.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 7 (13 pts), ternaries 2 (7 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftModuleBuildDescription.writeOutputFileMap (cognitive 36) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:817— SwiftModuleBuildDescription.writeOutputFileMap has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (25 pts), error handling 3 (6 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftRunCommand.run (cognitive 36) Sources/Commands/SwiftRunCommand.swift:116— SwiftRunCommand.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 3 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLitePackageCollectionsStorage.populateTargetTrie (cognitive 36) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:743— SQLitePackageCollectionsStorage.populateTargetTrie has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (4 pts), boolean chains 3, error handling 2, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLitePackageCollectionsStorage.searchTargets (cognitive 35) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:426— SQLitePackageCollectionsStorage.searchTargets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 4 (9 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 14). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestValidator.validateBinaryTargets (cognitive 35) Sources/PackageLoading/ManifestLoader+Validation.swift:166— ManifestValidator.validateBinaryTargets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetSourcesBuilder.computeContents (cognitive 35) Sources/PackageLoading/TargetSourcesBuilder.swift:557— TargetSourcesBuilder.computeContents has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (34 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manifest.dependenciesTraitGuarded (cognitive 35) Sources/PackageModel/Manifest/Manifest.swift:214— Manifest.dependenciesTraitGuarded has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (9 pts), boolean chains 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.plan (cognitive 34) Sources/Build/BuildPlan/BuildPlan+Clang.swift:25— BuildPlan.plan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (9 pts), match/switch 2 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserToolchain.deriveSwiftCFlags (cognitive 34) Sources/PackageModel/UserToolchain.swift:587— UserToolchain.deriveSwiftCFlags has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 1 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UserToolchain.init (cognitive 34) Sources/PackageModel/UserToolchain.swift:760— UserToolchain.init has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 2 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PackageSigningEntityTOFU.validateSigningEntity (cognitive 34) Sources/PackageRegistry/SigningEntityTOFU.swift:99— PackageSigningEntityTOFU.validateSigningEntity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 5, loops 2 (5 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftBuildSystemMessageHandler.emitEvent (cognitive 34) Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:216— SwiftBuildSystemMessageHandler.emitEvent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PIFBuilder.swift.buildAggregatePIFProject (cognitive 34) Sources/SwiftBuildSupport/PIFBuilder.swift:887— PIFBuilder.swift.buildAggregatePIFProject has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (23 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts), ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.init (cognitive 33) Sources/Build/BuildPlan/BuildPlan.swift:243— BuildPlan.init has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 3 (5 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DumpSymbolGraph.run (cognitive 33) Sources/Commands/PackageCommands/DumpCommands.swift:55— DumpSymbolGraph.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Describe.run (cognitive 33) Sources/PackageCollectionsCommand/PackageCollectionsCommand.swift:285— Describe.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 4 (7 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftModuleBuildDescription.compileArguments (cognitive 32) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:498— SwiftModuleBuildDescription.compileArguments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 7, match/switch 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ModulesGraph+Loading.swift.checkAllDependenciesAreUsed (cognitive 32) Sources/PackageGraph/ModulesGraph+Loading.swift:236— ModulesGraph+Loading.swift.checkAllDependenciesAreUsed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SPDXConverter.convertToExternalIdentifiers (cognitive 31) Sources/SBOMModel/Converter/SPDXConverter.swift:172— SPDXConverter.convertToExternalIdentifiers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLBuildManifestBuilder.createClangCompileCommand (cognitive 30) Sources/Build/BuildManifest/LLBuildManifestBuilder+Clang.swift:23— LLBuildManifestBuilder.createClangCompileCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (7 pts), match/switch 2 (5 pts), ternaries 1 (5 pts), boolean chains 1 (nesting depth added 15). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.plan (cognitive 30) Sources/Build/BuildPlan/BuildPlan+Swift.swift:25— BuildPlan.plan has cognitive complexity 30 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 4 (12 pts), match/switch 2 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceCodeFragment.init (cognitive 30) Sources/PackageModel/ManifestSourceGeneration.swift:264— SourceCodeFragment.init has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (7 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPrebuilts.build (cognitive 30) Sources/swift-build-prebuilts/BuildPrebuilts.swift:80— BuildPrebuilts.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs (cognitive 29) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:195— LLBuildManifestBuilder.computeSwiftCompileCmdInputs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 7 (16 pts), match/switch 3 (6 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VersionSetSpecifier.union (cognitive 29) Sources/PackageGraph/VersionSetSpecifier.swift:100— VersionSetSpecifier.union has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BuildOperation.computeLLBuildTargetName (cognitive 28) Sources/Build/BuildOperation.swift:687— BuildOperation.computeLLBuildTargetName has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 2 (6 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagnosticReportBuilder.description (cognitive 28) Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift:188— DiagnosticReportBuilder.description has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 2 (4 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserToolchain.deriveSwiftPMLibrariesLocation (cognitive 28) Sources/PackageModel/UserToolchain.swift:989— UserToolchain.deriveSwiftPMLibrariesLocation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginModule.invoke (cognitive 28) Sources/SPMBuildCore/Plugins/PluginInvocation.swift:86— PluginModule.invoke has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 5 (8 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 12). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to one function item inside it that branches (handleMessage). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RegistryClient.publish (cognitive 28) Sources/PackageRegistry/RegistryClient.swift:1135— RegistryClient.publish has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Plugin.handleMessage (cognitive 28) Sources/Runtimes/PackagePlugin/Plugin.swift:145— Plugin.handleMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 4 (8 pts), match/switch 3 (7 pts), loops 2 (4 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RepositoryManager.fetchAndPopulateCache (cognitive 28) Sources/SourceControl/RepositoryManager.swift:276— RepositoryManager.fetchAndPopulateCache has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 13). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Term.relation (cognitive 27) Sources/PackageGraph/Resolution/PubGrub/Term.swift:144— Term.relation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (27 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestLoader.evaluateManifest (cognitive 27) Sources/PackageLoading/ManifestLoader.swift:699— ManifestLoader.evaluateManifest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (17 pts), error handling 5 (7 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SPDXValidator.validateObjectWithSPDXRules (cognitive 27) Sources/SBOMModel/Validator/SPDXValidator.swift:63— SPDXValidator.validateObjectWithSPDXRules has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceCodeFragment.init (cognitive 26) Sources/PackageModel/ManifestSourceGeneration.swift:656— SourceCodeFragment.init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
UserToolchain.deriveXCTestPath (cognitive 26) Sources/PackageModel/UserToolchain.swift:1181— UserToolchain.deriveXCTestPath has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitProgressParser.init (cognitive 26) Sources/SourceControl/GitRepository.swift:1670— GitProgressParser.init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 9 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestValidator.validateTraits (cognitive 25) Sources/PackageLoading/ManifestLoader+Validation.swift:97— ManifestValidator.validateTraits has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageBuilder.findTestEntryPoint (cognitive 25) Sources/PackageLoading/PackageBuilder.swift:1575— PackageBuilder.findTestEntryPoint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetSourcesBuilder.computeRule (cognitive 25) Sources/PackageLoading/TargetSourcesBuilder.swift:241— TargetSourcesBuilder.computeRule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystem.getOrCreateSwiftPMConfigurationDirectory (cognitive 25) Sources/Basics/FileSystem/FileSystem+Extensions.swift:343— FileSystem.getOrCreateSwiftPMConfigurationDirectory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultPluginScriptRunner.invoke (cognitive 25) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:452— DefaultPluginScriptRunner.invoke has cognitive complexity 25 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 8 (10 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.saveResolvedFile (cognitive 25) Sources/Workspace/Workspace+ResolvedPackages.swift:23— Workspace.saveResolvedFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs (cognitive 24) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:218— LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (LLBuildManifestBuilder.computeSwiftCompileCmdInputs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PackageIndexAndCollections.findPackages (cognitive 24) Sources/PackageCollections/PackageIndexAndCollections.swift:207— PackageIndexAndCollections.findPackages has cognitive complexity 24 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 3 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SQLitePackageCollectionsStorage.searchPackages (cognitive 24) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:261— SQLitePackageCollectionsStorage.searchPackages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftSDKBundle.selectSwiftSDK (cognitive 24) Sources/PackageModel/SwiftSDKs/SwiftSDKBundle.swift:82— SwiftSDKBundle.selectSwiftSDK has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 4 (10 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignatureValidation.getAndValidateSourceArchiveSignature (cognitive 24) Sources/PackageRegistry/SignatureValidation.swift:124— SignatureValidation.getAndValidateSourceArchiveSignature has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace._edit (cognitive 24) Sources/Workspace/Workspace+Editing.swift:26— Workspace._edit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PIFBuilder.swift.computeHostOnlyModuleIDsInRootPackages (cognitive 24) Sources/SwiftBuildSupport/PIFBuilder.swift:797— PIFBuilder.swift.computeHostOnlyModuleIDsInRootPackages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (9 pts), match/switch 3, boolean chains 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildSettings.addSwiftVersionSettings (cognitive 23) Sources/XCBuildSupport/PIFBuilder.swift:1844— BuildSettings.addSwiftVersionSettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 10). Of this number, 21 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceCodeFragment.generateSourceCode (cognitive 23) Sources/PackageModel/ManifestSourceGeneration.swift:1122— SourceCodeFragment.generateSourceCode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraitError.generateSetterDescription (cognitive 23) Sources/PackageModel/Manifest/Manifest+Traits.swift:471— TraitError.generateSetterDescription has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistryDownloadsManager.downloadAndPopulateCache (cognitive 23) Sources/PackageRegistry/RegistryDownloadsManager.swift:133— RegistryDownloadsManager.downloadAndPopulateCache has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 3 (8 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SignatureValidation.getAndValidateManifestSignature (cognitive 23) Sources/PackageRegistry/SignatureValidation.swift:383— SignatureValidation.getAndValidateManifestSignature has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.prefetchPackages (cognitive 23) Sources/Workspace/Workspace+Dependencies.swift:1321— Workspace.prefetchPackages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, match/switch 2 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XCBuildDelegate.xcBuildOutputParser (cognitive 23) Sources/XCBuildSupport/XCBuildDelegate.swift:64— XCBuildDelegate.xcBuildOutputParser has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
XcodeBuildSystem.build (cognitive 23) Sources/XCBuildSupport/XcodeBuildSystem.swift:179— XcodeBuildSystem.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildOperation.verifyTargetImports (cognitive 22) Sources/Build/BuildOperation.swift:365— BuildOperation.verifyTargetImports has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildOperation.build (cognitive 22) Sources/Build/BuildOperation.swift:430— BuildOperation.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8, match/switch 3 (6 pts), error handling 3 (4 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TestingSupport.constructTestEnvironment (cognitive 22) Sources/Commands/Utilities/TestingSupport.swift:263— TestingSupport.constructTestEnvironment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
JSONPackageCollectionProvider.decodeAndRunSignatureCheck (cognitive 22) Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:161— JSONPackageCollectionProvider.decodeAndRunSignatureCheck has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (5 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Package.targets (cognitive 22) Sources/swift-build-prebuilts/BuildPrebuilts.swift:352— Package.targets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), match/switch 1 (5 pts) (nesting depth added 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to one function item inside it that branches (transitTarget). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Manifest.dependenciesRequired (cognitive 22) Sources/PackageModel/Manifest/Manifest.swift:279— Manifest.dependenciesRequired has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Manifest.register (cognitive 22) Sources/PackageModel/Manifest/Manifest.swift:493— Manifest.register has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SPDXConverter.convertToRelationships (cognitive 22) Sources/SBOMModel/Converter/SPDXConverter.swift:252— SPDXConverter.convertToRelationships has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.loadDependencyManifests (cognitive 22) Sources/Workspace/Workspace+Manifests.swift:494— Workspace.loadDependencyManifests has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 6 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClangModuleBuildDescription.basicArguments (cognitive 21) Sources/Build/BuildDescription/ClangModuleBuildDescription.swift:295— ClangModuleBuildDescription.basicArguments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, loops 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UserToolchain.determineLibrarian (cognitive 21) Sources/PackageModel/UserToolchain.swift:307— UserToolchain.determineLibrarian has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftSDKBundleStore.install (cognitive 21) Sources/PackageModel/SwiftSDKs/SwiftSDKBundleStore.swift:212— SwiftSDKBundleStore.install has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultPluginScriptRunner.compilePluginScript (cognitive 21) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:242— DefaultPluginScriptRunner.compilePluginScript has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (6 pts), if/else 4 (6 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Collection.recursivelyTraverseTransitiveLinkageDependencies (cognitive 20) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:1094— Collection.recursivelyTraverseTransitiveLinkageDependencies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 8 (15 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Collection.recursivelyTraverseTransitiveLinkageDependencies::visitDependency) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ModuleAliasTracker.directlyDependedOnModules (cognitive 20) Sources/PackageGraph/ModuleAliasTracker.swift:675— ModuleAliasTracker.directlyDependedOnModules has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (9 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PackageBuilder.constructV4Targets::findPath (cognitive 20) Sources/PackageLoading/PackageBuilder.swift:571— PackageBuilder.constructV4Targets::findPath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultDependencyMapper.normalizeDependencyLocation (cognitive 20) Sources/PackageModel/DependencyMapper.swift:86— DefaultDependencyMapper.normalizeDependencyLocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 1 (4 pts), match/switch 2 (3 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SwiftSDKConfigurationStore.configure (cognitive 20) Sources/PackageModel/SwiftSDKs/SwiftSDKConfigurationStore.swift:144— SwiftSDKConfigurationStore.configure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CMSSignatureProvider.extractSigningEntity (cognitive 20) Sources/PackageSigning/SignatureProvider.swift:324— CMSSignatureProvider.extractSigningEntity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PURL.extractNamespace (cognitive 20) Sources/SBOMModel/Extractor/PURL.swift:100— PURL.extractNamespace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFProjectBuilder.processResources (cognitive 20) Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:270— PackagePIFProjectBuilder.processResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.init (cognitive 20) Sources/Workspace/Workspace.swift:426— Workspace.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BaseTarget.isLinkedAgainst (cognitive 20) Sources/SwiftBuildSupport/DotPIFSerializer.swift:171— BaseTarget.isLinkedAgainst has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (10 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserToolchain.deriveSwiftTestingPath (cognitive 19) Sources/PackageModel/UserToolchain.swift:1263— UserToolchain.deriveSwiftTestingPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftSDKBundleStore.validateSwiftSDKBundle (cognitive 19) Sources/PackageModel/SwiftSDKs/SwiftSDKBundleStore.swift:412— SwiftSDKBundleStore.validateSwiftSDKBundle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VerifierConfiguration.from (cognitive 19) Sources/PackageRegistry/SignatureValidation.swift:586— VerifierConfiguration.from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (6 pts), error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeychainAuthorizationProvider.authentication (cognitive 18) Sources/Basics/AuthorizationProvider.swift:276— KeychainAuthorizationProvider.authentication has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 2 (4 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.createAPIToolCommonArgs (cognitive 18) Sources/Build/BuildPlan/BuildPlan.swift:536— BuildPlan.createAPIToolCommonArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftCommandState.postprocessArgParserResult (cognitive 18) Sources/CoreCommands/SwiftCommandState.swift:530— SwiftCommandState.postprocessArgParserResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SourceCodeFragment.init (cognitive 18) Sources/PackageModel/ManifestSourceGeneration.swift:364— SourceCodeFragment.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PackagePIFBuilder.build (cognitive 18) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:484— PackagePIFBuilder.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFBuilder.addProjectBuildSettings (cognitive 18) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:606— PackagePIFBuilder.addProjectBuildSettings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (3 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceControlPackageContainer.getDependencies (cognitive 18) Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift:290— SourceControlPackageContainer.getDependencies has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFProjectBuilder.addLibraryTarget (cognitive 18) Sources/XCBuildSupport/PIFBuilder.swift:542— PackagePIFProjectBuilder.addLibraryTarget has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftModuleBuildDescription.init (cognitive 17) Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift:262— SwiftModuleBuildDescription.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 4 (5 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LLBuildManifestBuilder.createProductCommand (cognitive 17) Sources/Build/BuildManifest/LLBuildManifestBuilder+Product.swift:23— LLBuildManifestBuilder.createProductCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.computeDependencies::successors (cognitive 17) Sources/Build/BuildPlan/BuildPlan+Product.swift:160— BuildPlan.computeDependencies::successors has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), match/switch 2, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (BuildPlan.computeDependencies) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BuildPlan.invokeBuildToolPlugins (cognitive 17) Sources/Build/BuildPlan/BuildPlan.swift:740— BuildPlan.invokeBuildToolPlugins has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildPlan.traverseModules (cognitive 17) Sources/Build/BuildPlan/BuildPlan.swift:1070— BuildPlan.traverseModules has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (4 pts), match/switch 4, boolean chains 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (successors). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GitHubPackageMetadataProvider.get (cognitive 17) Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:59— GitHubPackageMetadataProvider.get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLitePackageCollectionsStorage.list (cognitive 17) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:202— SQLitePackageCollectionsStorage.list has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 6, boolean chains 2 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Version.init (cognitive 17) Sources/Runtimes/PackageDescription/Version+StringLiteralConvertible.swift:49— Version.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ManifestLoader.findManifest (cognitive 17) Sources/PackageLoading/ToolsVersionParser.swift:638— ManifestLoader.findManifest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2, ternaries 2, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PackageBuilder.resolvedSettings (cognitive 17) Sources/PackageLoading/PackageBuilder.swift:1127— PackageBuilder.resolvedSettings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PkgConfigParser.parseDependencies (cognitive 17) Sources/PackageLoading/PkgConfig.swift:322— PkgConfigParser.parseDependencies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (tokenize, peek). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ToolsVersionParser._parse (cognitive 17) Sources/PackageLoading/ToolsVersionParser.swift:100— ToolsVersionParser._parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceCodeFragment.init (cognitive 17) Sources/PackageModel/ManifestSourceGeneration.swift:759— SourceCodeFragment.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraitError.description (cognitive 17) Sources/PackageModel/Manifest/Manifest+Traits.swift:504— TraitError.description has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlainTextSnippetExtractor.init (cognitive 17) Sources/PackageModel/Snippets/Parsing/PlainTextSnippetExtractor.swift:101— PlainTextSnippetExtractor.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginContextSerializer.serialize (cognitive 17) Sources/SPMBuildCore/Plugins/PluginContextSerializer.swift:81— PluginContextSerializer.serialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace._updateDependencies (cognitive 17) Sources/Workspace/Workspace+Dependencies.swift:63— Workspace._updateDependencies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, match/switch 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PackagePIFProjectBuilder.addMainModuleTarget (cognitive 17) Sources/XCBuildSupport/PIFBuilder.swift:430— PackagePIFProjectBuilder.addMainModuleTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Environment.set (cognitive 16) Sources/Basics/Environment/Environment.swift:236— Environment.set has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APIDiff.runWithSwiftPMCoordinatedDiffing (cognitive 16) Sources/Commands/PackageCommands/APIDiff.swift:120— APIDiff.runWithSwiftPMCoordinatedDiffing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4, error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APIDiff.runWithIntegratedAPIDigesterSupport (cognitive 16) Sources/Commands/PackageCommands/APIDiff.swift:199— APIDiff.runWithIntegratedAPIDigesterSupport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShowTraits.run (cognitive 16) Sources/Commands/PackageCommands/ShowTraits.swift:36— ShowTraits.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Collection.recursivelyTraverseTransitiveLinkageDependencies::visitDependency (cognitive 16) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:1118— Collection.recursivelyTraverseTransitiveLinkageDependencies::visitDependency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Collection.recursivelyTraverseTransitiveLinkageDependencies) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ModuleAliasTracker.resolveModule (cognitive 16) Sources/PackageGraph/ModuleAliasTracker.swift:367— ModuleAliasTracker.resolveModule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageGraphError.description (cognitive 16) Sources/PackageGraph/ModulesGraph.swift:299— PackageGraphError.description has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlatformVersionProvider.getDerived (cognitive 16) Sources/PackageGraph/Resolution/PlatformVersionProvider.swift:66— PlatformVersionProvider.getDerived has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PubGrubDependencyResolver.solve (cognitive 16) Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift:274— PubGrubDependencyResolver.solve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestValidator.validateTargetDependencyReferences (cognitive 16) Sources/PackageLoading/ManifestLoader+Validation.swift:238— ManifestValidator.validateTargetDependencyReferences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PkgConfigParser.splitEscapingSpace (cognitive 16) Sources/PackageLoading/PkgConfig.swift:421— PkgConfigParser.splitEscapingSpace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target+PkgConfig.swift.pkgConfigArgs (cognitive 16) Sources/PackageLoading/Target+PkgConfig.swift:65— Target+PkgConfig.swift.pkgConfigArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Toolset.init (cognitive 16) Sources/PackageModel/Toolset.swift:63— Toolset.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistryClient.downloadSourceArchive (cognitive 16) Sources/PackageRegistry/RegistryClient.swift:712— RegistryClient.downloadSourceArchive has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 4 (6 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignatureValidation.validateManifestSignature (cognitive 16) Sources/PackageRegistry/SignatureValidation.swift:491— SignatureValidation.validateManifestSignature has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (5 pts), error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginContextDeserializer.target (cognitive 16) Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:68— PluginContextDeserializer.target has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (12 pts), boolean chains 2, if/else 2 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SBOMExtractor.extractDependenciesForProducts::processModuleDependency (cognitive 16) Sources/SBOMModel/Extractor/SBOMDependenciesExtractor.swift:98— SBOMExtractor.extractDependenciesForProducts::processModuleDependency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.tryResolveBasedOnResolvedVersionsFile (cognitive 16) Sources/Workspace/Workspace+Dependencies.swift:421— Workspace.tryResolveBasedOnResolvedVersionsFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), match/switch 3 (6 pts), loops 2, boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workspace.validateSignatures (cognitive 16) Sources/Workspace/Workspace+Signing.swift:44— Workspace.validateSignatures has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagePIFProjectBuilder.computePluginGeneratedFiles (cognitive 16) Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:417— PackagePIFProjectBuilder.computePluginGeneratedFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrimaryDiagnosticFilter.shouldSkip (cognitive 16) Sources/SwiftFixIt/SwiftFixIt.swift:136— PrimaryDiagnosticFilter.shouldSkip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FunctionTooLong: ModulesGraph+Loading.swift.createResolvedPackages Sources/PackageGraph/ModulesGraph+Loading.swift:383— FunctionTooLong — createResolvedPackages runs 373 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 273 over it, 3.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Near-duplicate member pair (51 shared lines) Sources/PackageRegistry/SignatureValidation.swift:231— Sources/PackageRegistry/SignatureValidation.swift:231-313 | Sources/PackageRegistry/SignatureValidation.swift:491-565 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:181— Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:181-245 | Sources/Workspace/ManifestSigning/ManifestSigning.swift:239-302 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) Sources/PackageGraph/ModulesGraph.swift:412— Sources/PackageGraph/ModulesGraph.swift:412-454 | Sources/swift-bootstrap/main.swift:606-648 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) Sources/SourceControl/GitRepository.swift:226— Sources/SourceControl/GitRepository.swift:226-265 | Sources/SourceControl/GitRepository.swift:607-644 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) Sources/PackageCollections/PackageIndex.swift:103— Sources/PackageCollections/PackageIndex.swift:103-133 | Sources/PackageCollections/PackageIndex.swift:135-169 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) Sources/CoreCommands/SwiftCommandState.swift:123— Sources/CoreCommands/SwiftCommandState.swift:123-166 | Sources/CoreCommands/SwiftCommandState.swift:239-285 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) Sources/Runtimes/PackageDescription/Target.swift:878— Sources/Runtimes/PackageDescription/Target.swift:878-906 | Sources/Runtimes/PackageDescription/Target.swift:930-960 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:234— Sources/SwiftBuildSupport/PackagePIFBuilder.swift:234-266 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:268-300 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) Sources/SPMBuildCore/BinaryTarget+Extensions.swift:74— Sources/SPMBuildCore/BinaryTarget+Extensions.swift:74-98 | Sources/SPMBuildCore/BinaryTarget+Extensions.swift:100-124 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:53— Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:53-89 | Sources/Basics/HTTPClient/URLSessionHTTPClient.swift:91-124 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) Sources/PackageRegistry/SignatureValidation.swift:61— Sources/PackageRegistry/SignatureValidation.swift:61-95 | Sources/PackageRegistry/SignatureValidation.swift:316-351 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) Sources/PackageRegistry/SignatureValidation.swift:97— Sources/PackageRegistry/SignatureValidation.swift:97-122 | Sources/PackageRegistry/SignatureValidation.swift:354-381 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×1
Edited copies of one member (5 members, 13+ corresponding lines) Sources/Basics/HTTPClient/LegacyHTTPClient.swift:304— Sources/Basics/HTTPClient/LegacyHTTPClient.swift:304-317 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:329-342 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:344-357 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:359-372 | Sources/Basics/HTTPClient/LegacyHTTPClient.swift:374-386 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) Utilities/helpers.py:66— Utilities/helpers.py:66-92 | Utilities/helpers.py:96-128 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) Sources/XCBuildSupport/XCBuildMessage.swift:347— Sources/XCBuildSupport/XCBuildMessage.swift:347-357 | Sources/XCBuildSupport/XCBuildMessage.swift:359-369 | Sources/XCBuildSupport/XCBuildMessage.swift:371-381 | Sources/XCBuildSupport/XCBuildMessage.swift:383-395 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:536— Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:536-546 | Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:548-558 | Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:560-570 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) Sources/Basics/HTTPClient/HTTPClient.swift:258— Sources/Basics/HTTPClient/HTTPClient.swift:258-266 | Sources/Basics/HTTPClient/HTTPClient.swift:268-276 | Sources/Basics/HTTPClient/HTTPClient.swift:278-287 | Sources/Basics/HTTPClient/HTTPClient.swift:289-298 | Sources/Basics/HTTPClient/HTTPClient.swift:300-308 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) Sources/LLBuildManifest/LLBuildManifest.swift:279— Sources/LLBuildManifest/LLBuildManifest.swift:279-287 | Sources/LLBuildManifest/LLBuildManifest.swift:289-297 | Sources/LLBuildManifest/LLBuildManifest.swift:316-324 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) Sources/Runtimes/PackageDescription/PackageDependency.swift:378— Sources/Runtimes/PackageDescription/PackageDependency.swift:378-385 | Sources/Runtimes/PackageDescription/PackageDependency.swift:441-448 | Sources/Runtimes/PackageDescription/PackageDependency.swift:504-511 | Sources/Runtimes/PackageDescription/PackageDependency.swift:580-587 | Sources/Runtimes/PackageDescription/PackageDependency.swift:670-677 | Sources/Runtimes/PackageDescription/PackageDependency.swift:830-838 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) Sources/Runtimes/PackageDescription/BuildSettings.swift:245— Sources/Runtimes/PackageDescription/BuildSettings.swift:245-253 | Sources/Runtimes/PackageDescription/BuildSettings.swift:415-423 | Sources/Runtimes/PackageDescription/BuildSettings.swift:655-663 | Sources/Runtimes/PackageDescription/BuildSettings.swift:737-745 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) Sources/PackageLoading/Diagnostics.swift:31— Sources/PackageLoading/Diagnostics.swift:31-33 | Sources/PackageLoading/TargetSourcesBuilder.swift:934-936 | Sources/Workspace/Diagnostics.swift:99-103 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (38 lines × 2) Sources/PackageRegistry/RegistryClient.swift:467— Sources/PackageRegistry/RegistryClient.swift:467-504 | Sources/PackageRegistry/RegistryClient.swift:611-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/RegistryClient.swift:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 2) Sources/PackageRegistry/RegistryDownloadsManager.swift:269— Sources/PackageRegistry/RegistryDownloadsManager.swift:269-301 | Sources/SourceControl/RepositoryManager.swift:526-558 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (31–32 lines × 2) Sources/Workspace/Workspace+Dependencies.swift:250— Sources/Workspace/Workspace+Dependencies.swift:250-281 | Sources/Workspace/Workspace+Dependencies.swift:773-803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Workspace/Workspace+Dependencies.swift:250` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (26 lines × 3) Sources/PackageCollectionsSigning/CertificatePolicy.swift:411— Sources/PackageCollectionsSigning/CertificatePolicy.swift:411-436 | Sources/PackageSigning/VerifierPolicies.swift:167-192 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:414-439 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/PackageSigning/VerifierPolicies.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19–24 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:193— Sources/PackageRegistry/SignatureValidation.swift:193-211 | Sources/PackageRegistry/SignatureValidation.swift:284-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22–23 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:272— Sources/PackageRegistry/SignatureValidation.swift:272-294 | Sources/PackageRegistry/SignatureValidation.swift:534-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–22 lines × 5) Sources/PackageModel/Manifest/TargetDescription.swift:274— Sources/PackageModel/Manifest/TargetDescription.swift:274-295 | Sources/PackageModel/Manifest/TargetDescription.swift:298-313 | Sources/PackageModel/Manifest/TargetDescription.swift:330-351 | Sources/PackageModel/Manifest/TargetDescription.swift:366-381 | Sources/PackageModel/Manifest/TargetDescription.swift:410-425 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/Manifest/TargetDescription.swift:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) Sources/Workspace/ManifestSigning/CertificatePolicy.swift:149— Sources/Workspace/ManifestSigning/CertificatePolicy.swift:149-170 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:224-245 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:301-322 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–22 lines × 2) Sources/CoreCommands/SwiftCommandState.swift:146— Sources/CoreCommands/SwiftCommandState.swift:146-166 | Sources/CoreCommands/SwiftCommandState.swift:264-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CoreCommands/SwiftCommandState.swift:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:502— Sources/PackageCollectionsSigning/CertificatePolicy.swift:502-523 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:505-526 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) Sources/PackageCollectionsSigning/CertificatePolicy.swift:452— Sources/PackageCollectionsSigning/CertificatePolicy.swift:452-472 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:455-475 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/Workspace/ManifestSigning/CertificatePolicy.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18–21 lines × 2) Sources/PackageRegistry/RegistryClient.swift:446— Sources/PackageRegistry/RegistryClient.swift:446-466 | Sources/PackageRegistry/RegistryClient.swift:591-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/RegistryClient.swift:446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–20 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:76— Sources/PackageRegistry/SignatureValidation.swift:76-95 | Sources/PackageRegistry/SignatureValidation.swift:333-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–19 lines × 6) Sources/PackageModel/Manifest/TargetDescription.swift:243— Sources/PackageModel/Manifest/TargetDescription.swift:243-255 | Sources/PackageModel/Manifest/TargetDescription.swift:292-304 | Sources/PackageModel/Manifest/TargetDescription.swift:310-322 | Sources/PackageModel/Manifest/TargetDescription.swift:348-366 | Sources/PackageModel/Manifest/TargetDescription.swift:398-416 | Sources/PackageModel/Manifest/TargetDescription.swift:441-453 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/Manifest/TargetDescription.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/PackageModel/Manifest/TargetDescription.swift:324` calls `binaryTargetRequiresEitherPathOrURL` and `Sources/PackageModel/Manifest/TargetDescription.swift:305` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) Sources/Basics/SQLiteBackedCache.swift:202— Sources/Basics/SQLiteBackedCache.swift:202-220 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:895-913 — before extracting anything, compare `Sources/Basics/SQLiteBackedCache.swift` and `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/SQLiteBackedCache.swift:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:894` calls `StringError` and `Sources/Basics/SQLiteBackedCache.swift:201` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:967— Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:967-984 | Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:999-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/SwiftSDKs/SwiftSDK.swift:967` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–17 lines × 2) Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:103— Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:103-114 | Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:126-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollections/Providers/JSONPackageCollectionProvider.swift:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–17 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:586— Sources/PackageLoading/ManifestJSONParser.swift:586-602 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:233-242 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16–17 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:103— Sources/PackageRegistry/SignatureValidation.swift:103-119 | Sources/PackageRegistry/SignatureValidation.swift:361-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageRegistry/SignatureValidation.swift:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 5) Sources/LLBuildManifest/LLBuildManifest.swift:415— Sources/LLBuildManifest/LLBuildManifest.swift:415-430 | Sources/PackageModel/Module/SwiftModule.swift:90-105 | Sources/Workspace/Workspace.swift:408-423 | Sources/Workspace/Workspace.swift:651-666 | Sources/_InternalTestSupport/ManifestExtensions.swift:45-60 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/LLBuildManifest/LLBuildManifest.swift:415` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/_InternalTestSupport/ManifestExtensions.swift:42` calls `root`, `plain`, `lowercased` and `Sources/Workspace/Workspace.swift:407` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 3) Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:94— Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:94-108 | Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:127-141 | Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:163-177 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 8) Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift:52— Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift:52-64 | Sources/Runtimes/PackageDescription/Target.swift:518-530 | Sources/Runtimes/PackageDescription/Target.swift:577-589 | Sources/Runtimes/PackageDescription/Target.swift:690-702 | Sources/Runtimes/PackageDescription/Target.swift:749-761 | Sources/Runtimes/PackageDescription/Target.swift:938-950 | Sources/Runtimes/PackageDescription/Target.swift:994-1006 | Sources/Runtimes/PackageDescription/Target.swift:1052-1064 — before extracting anything, compare `Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift` and `Sources/Runtimes/PackageDescription/Target.swift` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) Sources/PackageCollectionsSigning/CertificatePolicy.swift:393— Sources/PackageCollectionsSigning/CertificatePolicy.swift:393-405 | Sources/PackageSigning/VerifierPolicies.swift:149-161 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:396-408 — before extracting anything, compare `Sources/PackageCollectionsSigning/CertificatePolicy.swift` and `Sources/PackageSigning/VerifierPolicies.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:95— Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:95-106 | Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:128-139 | Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:164-175 | Sources/Runtimes/PackagePlugin/PluginContextDeserializer.swift:358-369 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–12 lines × 2) Sources/Runtimes/PackageDescription/PackageDependency.swift:701— Sources/Runtimes/PackageDescription/PackageDependency.swift:701-707 | Sources/Runtimes/PackageDescription/PackageDependency.swift:733-744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/PackageDependency.swift:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 9) Sources/PackageModel/Manifest/TargetDescription.swift:274— Sources/PackageModel/Manifest/TargetDescription.swift:274-284 | Sources/PackageModel/Manifest/TargetDescription.swift:286-296 | Sources/PackageModel/Manifest/TargetDescription.swift:304-314 | Sources/PackageModel/Manifest/TargetDescription.swift:330-340 | Sources/PackageModel/Manifest/TargetDescription.swift:342-352 | Sources/PackageModel/Manifest/TargetDescription.swift:372-382 | Sources/PackageModel/Manifest/TargetDescription.swift:392-402 | Sources/PackageModel/Manifest/TargetDescription.swift:416-426 | Sources/PackageModel/Manifest/TargetDescription.swift:435-445 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageModel/Manifest/TargetDescription.swift:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 5) Sources/Runtimes/PackageDescription/Target.swift:410— Sources/Runtimes/PackageDescription/Target.swift:410-420 | Sources/Runtimes/PackageDescription/Target.swift:463-473 | Sources/Runtimes/PackageDescription/Target.swift:634-644 | Sources/Runtimes/PackageDescription/Target.swift:836-846 | Sources/Runtimes/PackageDescription/Target.swift:886-896 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/Target.swift:410` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 4) Sources/Runtimes/PackageDescription/Target.swift:456— Sources/Runtimes/PackageDescription/Target.swift:456-466 | Sources/Runtimes/PackageDescription/Target.swift:511-520 | Sources/Runtimes/PackageDescription/Target.swift:627-637 | Sources/Runtimes/PackageDescription/Target.swift:683-692 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–11 lines × 2) Sources/Runtimes/PackageDescription/PackageDependency.swift:731— Sources/Runtimes/PackageDescription/PackageDependency.swift:731-741 | Sources/Runtimes/PackageDescription/PackageDependency.swift:1112-1119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Runtimes/PackageDescription/PackageDependency.swift:731` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 4) Sources/Basics/FileSystem/FileSystem+Extensions.swift:267— Sources/Basics/FileSystem/FileSystem+Extensions.swift:267-276 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:299-308 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:405-414 | Sources/Basics/FileSystem/FileSystem+Extensions.swift:464-473 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/FileSystem/FileSystem+Extensions.swift:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Basics/FileSystem/FileSystem+Extensions.swift:264` calls `getOrCreateSwiftPMCacheDirectory` and `Sources/Basics/FileSystem/FileSystem+Extensions.swift:401` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–10 lines × 3) Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:312— Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:312-314 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:533-542 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:555-564 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) Sources/PackageLoading/PackageBuilder.swift:177— Sources/PackageLoading/PackageBuilder.swift:177-184 | Sources/PackageLoading/PackageBuilder.swift:187-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:712— Sources/SwiftBuildSupport/PackagePIFBuilder.swift:712-720 | Sources/XCBuildSupport/PIFBuilder.swift:341-348 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 5) Sources/Commands/PackageCommands/PluginCommand.swift:470— Sources/Commands/PackageCommands/PluginCommand.swift:470-477 | Sources/Commands/PackageCommands/PluginCommand.swift:494-501 | Sources/Commands/Utilities/DescribedPackage.swift:201-208 | Sources/PackageModel/Module/PluginModule.swift:93-100 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:281-288 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 4) Sources/Workspace/Workspace+State.swift:593— Sources/Workspace/Workspace+State.swift:593-601 | Sources/Workspace/Workspace+State.swift:949-957 | Sources/Workspace/Workspace+State.swift:1276-1284 | Sources/Workspace/Workspace+State.swift:1521-1529 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 6) Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:468— Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:468-473 | Sources/PackageModel/Manifest/ProductDescription.swift:262-267 | Sources/PackageModel/Manifest/SystemPackageProviderDescription.swift:48-53 | Sources/PackageModel/Manifest/TargetDescription.swift:544-549 | Sources/PackageModel/Manifest/TargetDescription.swift:594-599 | Sources/PackageModel/Manifest/TargetDescription.swift:626-631 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:468` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) Sources/XCBuildSupport/PIF.swift:133— Sources/XCBuildSupport/PIF.swift:133-137 | Sources/XCBuildSupport/PIF.swift:218-222 | Sources/XCBuildSupport/PIF.swift:521-525 | Sources/XCBuildSupport/PIF.swift:641-645 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/XCBuildSupport/PIF.swift:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/XCBuildSupport/PIF.swift:215` calls `encode` and `Sources/XCBuildSupport/PIF.swift:130` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) Sources/_InternalTestSupport/MockManifestLoader.swift:90— Sources/_InternalTestSupport/MockManifestLoader.swift:90-132 | Sources/_InternalTestSupport/MockManifestLoader.swift:136-178 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) Sources/_InternalTestSupport/MockPackage.swift:32— Sources/_InternalTestSupport/MockPackage.swift:32-56 | Sources/_InternalTestSupport/MockPackage.swift:59-83 | Sources/_InternalTestSupport/MockPackage.swift:85-108 | Sources/_InternalTestSupport/MockPackage.swift:110-139 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) Sources/_InternalTestSupport/XCTAssertHelpers.swift:179— Sources/_InternalTestSupport/XCTAssertHelpers.swift:179-208 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:210-237 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:239-266 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) Sources/_InternalTestSupport/PackageDependencyDescriptionExtensions.swift:20— Sources/_InternalTestSupport/PackageDependencyDescriptionExtensions.swift:20-35 | Sources/_InternalTestSupport/PackageDependencyDescriptionExtensions.swift:37-56 | Sources/_InternalTestSupport/PackageDependencyDescriptionExtensions.swift:58-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:47— Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:47-63 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:65-81 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:98-114 | Sources/_InternalTestSupport/SwiftTesting+Helpers.swift:131-147 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) Sources/_InternalTestSupport/XCTAssertHelpers.swift:165— Sources/_InternalTestSupport/XCTAssertHelpers.swift:165-177 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:282-291 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:293-302 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:304-313 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:187— Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:187-198 | Sources/_InternalBuildTestSupport/MockBuildTestHelper.swift:200-211 | Sources/_InternalTestSupport/Observability.swift:238-251 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:108— Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift:108-114 | Examples/package-registry/Sources/RegistryExample/Routes/SearchRoutes.swift:96-104 | Examples/package-registry/Sources/RegistryExample/Routes/SearchRoutes.swift:108-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 3+ corresponding lines) · ×1
Edited copies of one member (7 members, 3+ corresponding lines) Sources/_InternalTestSupport/MockDependency.swift:135— Sources/_InternalTestSupport/MockDependency.swift:135-137 | Sources/_InternalTestSupport/MockDependency.swift:139-141 | Sources/_InternalTestSupport/MockDependency.swift:143-145 | Sources/_InternalTestSupport/MockDependency.swift:147-149 | Sources/_InternalTestSupport/MockDependency.swift:151-153 | Sources/_InternalTestSupport/MockDependency.swift:155-157 | Sources/_InternalTestSupport/MockDependency.swift:163-165 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Duplicated block (30–31 lines × 2) Sources/_InternalTestSupport/MockManifestLoader.swift:94— Sources/_InternalTestSupport/MockManifestLoader.swift:94-123 | Sources/_InternalTestSupport/MockManifestLoader.swift:139-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockManifestLoader.swift:94` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–19 lines × 4) Sources/_InternalTestSupport/MockPackageGraphs.swift:123— Sources/_InternalTestSupport/MockPackageGraphs.swift:123-136 | Sources/_InternalTestSupport/MockPackageGraphs.swift:277-295 | Sources/_InternalTestSupport/MockPackageGraphs.swift:316-328 | Sources/_InternalTestSupport/MockPackageGraphs.swift:356-373 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageGraphs.swift:123` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 3) Sources/_InternalTestSupport/MockPackageGraphs.swift:42— Sources/_InternalTestSupport/MockPackageGraphs.swift:42-59 | Sources/_InternalTestSupport/MockPackageGraphs.swift:149-166 | Sources/_InternalTestSupport/MockPackageGraphs.swift:377-394 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageGraphs.swift:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–18 lines × 2) Sources/_InternalTestSupport/MockPackageGraphs.swift:298— Sources/_InternalTestSupport/MockPackageGraphs.swift:298-313 | Sources/_InternalTestSupport/MockPackageGraphs.swift:331-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/MockPackageGraphs.swift:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 2) Sources/_InternalTestSupport/Observability.swift:255— Sources/_InternalTestSupport/Observability.swift:255-266 | Sources/_InternalTestSupport/Observability.swift:299-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/_InternalTestSupport/Observability.swift:255` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 5) Sources/_InternalTestSupport/ManifestExtensions.swift:25— Sources/_InternalTestSupport/ManifestExtensions.swift:25-34 | Sources/_InternalTestSupport/ManifestExtensions.swift:67-76 | Sources/_InternalTestSupport/ManifestExtensions.swift:108-117 | Sources/_InternalTestSupport/ManifestExtensions.swift:149-158 | Sources/_InternalTestSupport/ManifestExtensions.swift:189-198 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 6) Sources/_InternalTestSupport/ManifestExtensions.swift:28— Sources/_InternalTestSupport/ManifestExtensions.swift:28-35 | Sources/_InternalTestSupport/ManifestExtensions.swift:70-77 | Sources/_InternalTestSupport/ManifestExtensions.swift:111-118 | Sources/_InternalTestSupport/ManifestExtensions.swift:152-159 | Sources/_InternalTestSupport/ManifestExtensions.swift:192-199 | Sources/_InternalTestSupport/ManifestExtensions.swift:235-242 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) Sources/_InternalTestSupport/misc.swift:488— Sources/_InternalTestSupport/misc.swift:488-495 | Sources/_InternalTestSupport/misc.swift:510-517 | Sources/_InternalTestSupport/misc.swift:560-567 | Sources/_InternalTestSupport/misc.swift:582-589 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) Sources/_InternalTestSupport/misc.swift:511— Sources/_InternalTestSupport/misc.swift:511-517 | Sources/_InternalTestSupport/misc.swift:536-542 | Sources/_InternalTestSupport/misc.swift:561-567 | Sources/_InternalTestSupport/misc.swift:583-589 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Orphaned file Sources/PackageCollectionsCommand/PackageCollectionsCommand.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/_InternalTestSupport/InMemoryGitRepository.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/_InternalBuildTestSupport/PIFTester.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/_InternalTestSupport/MockPackageGraphs.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageSigning/SignatureProvider.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/LLBuildManifest/LLBuildManifest.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageCollections/PackageIndexAndCollections.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Runtimes/PackagePlugin/Command.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageRegistry/SigningEntityTOFU.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageLoading/ModuleMapGenerator.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageCollectionsSigning/PackageCollectionSigning.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Commands/Utilities/PlainTextEncoder.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Basics/FileSystem/AbsolutePath.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageLoading/Target+PkgConfig.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageModel/Manifest/ProductDescription.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Runtimes/PackageDescription/PackageRequirement.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/SourceControl/Repository.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/SourceKitLSPAPI/BuildDescription.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Commands/Utilities/DescribedPackage.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/SBOMModel/Extractor/SBOMDependenciesExtractor.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/LLBuildManifest/Tools.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageModel/Toolset.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/PackageCollections/PackageCollections+Validation.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
No direct assertions: testTrivialPackage Tests/PackageGraphTests/CrossCompilationPackageGraphTests.swift:24— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: productDependencies Tests/PackageGraphTests/ModulesGraphTests.swift:198— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: cycle Tests/PackageGraphTests/ModulesGraphTests.swift:246— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: localTargetCycle Tests/PackageGraphTests/ModulesGraphTests.swift:307— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: dependencyCycleWithoutTargetCycleV5 Tests/PackageGraphTests/ModulesGraphTests.swift:339— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: dependencyCycleWithoutTargetCycle Tests/PackageGraphTests/ModulesGraphTests.swift:393— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: dependencyCycleWithoutTargetCycleV6 Tests/PackageGraphTests/ModulesGraphTests.swift:463— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: libraryInvalidDependencyOnTestTarget Tests/PackageGraphTests/ModulesGraphTests.swift:516— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: executableInvalidDependencyOnTestTarget Tests/PackageGraphTests/ModulesGraphTests.swift:553— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: pluginInvalidDependencyOnTestTarget Tests/PackageGraphTests/ModulesGraphTests.swift:587— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: macroInvalidDependencyOnTestTarget Tests/PackageGraphTests/ModulesGraphTests.swift:626— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: validDependencyOnTestTarget Tests/PackageGraphTests/ModulesGraphTests.swift:665— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: testTargetDeclInExternalPackage Tests/PackageGraphTests/ModulesGraphTests.swift:698— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: targetPackageAccessParam Tests/PackageGraphTests/ModulesGraphTests.swift:746— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: duplicateModules Tests/PackageGraphTests/ModulesGraphTests.swift:799— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: multipleDuplicateModules Tests/PackageGraphTests/ModulesGraphTests.swift:844— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: severalDuplicateModules Tests/PackageGraphTests/ModulesGraphTests.swift:912— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: nestedDuplicateModules Tests/PackageGraphTests/ModulesGraphTests.swift:995— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: potentiallyDuplicatePackages Tests/PackageGraphTests/ModulesGraphTests.swift:1072— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: potentiallyDuplicatePackagesManyTargets Tests/PackageGraphTests/ModulesGraphTests.swift:1123— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: potentiallyDuplicatePackagesRegistrySCM Tests/PackageGraphTests/ModulesGraphTests.swift:1196— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: emptyDependency Tests/PackageGraphTests/ModulesGraphTests.swift:1250— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: targetOnlyContainingHeaders Tests/PackageGraphTests/ModulesGraphTests.swift:1300— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: productDependencyNotFound Tests/PackageGraphTests/ModulesGraphTests.swift:1332— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: byNameDependencyWithSimilarTargetName Tests/PackageGraphTests/ModulesGraphTests.swift:1362— No conventional assertion call was detected, and 112 of 219 tests in `PackageGraphTests` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: Sources/Commands/PackageCommands/BuildCacheCommand.swift, Sources/SwiftBuildSupport/TraceEventsWriter.swift, Sources/Basics/FileSystem/RelativePath.swift, Sources/SwiftBuildSupport/PIFGenerationInputs.swift, Sources/SwiftBuildSupport/BuildCacheConfiguration+SettingsOverrides.swift, Sources/PackageModel/PlatformRegistry.swift, Sources/Runtimes/CompilerPluginSupport/TargetExtensions.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/Basics/HTTPClient/HTTPClient.swift, Sources/PackageRegistryCommand/PackageRegistryCommand+Search.swift, Sources/Basics/HTTPClient/HTTPClientConfiguration.swift. Pair on, review, or document these before any departure.
Silent fallback default in catch Sources/PackageGraph/GraphLoadingNode.swift:49— `requiredDependencies` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch Sources/SourceKitLSPAPI/BuildDescription.swift:89— `sources` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 7 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (17 single-owned of 406 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 406 of the 585 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/PackageModel/PrebuiltLibrary.swift, Sources/PackageLoading/Diagnostics.swift, Sources/Runtimes/PackageDescription/Resource.swift, Sources/PackageModel/MinimumDeploymentTarget.swift, Sources/PackageModel/SwiftSDKs/SwiftSDKBundle.swift, Sources/PackageGraph/PackageModel+Extensions.swift, Sources/Basics/JSON+Extensions.swift.
D21 · Naming Consistency· `getReplProductName` spells `Repl` where 12 names in the project spell it `REPL` · ×1
`getReplProductName` spells `Repl` where 12 names in the project spell it `REPL` Sources/PackageGraph/ModulesGraph.swift:289— 12 of 13 names in project AppleProductTypes spell the token `REPL` (12 of 13; unit: names in project AppleProductTypes containing `REPL`). Peers: BuildPlan.createREPLArguments (Sources/Build/BuildPlan/BuildPlan.swift:590); ToolWorkspaceConfiguration.wantsREPLProduct (Sources/CoreCommands/SwiftCommandState.swift:72); ToolWorkspaceConfiguration.init(wantsREPLProduct) (Sources/CoreCommands/SwiftCommandState.swift:74); ModulesGraph.load(createREPLProduct) (Sources/PackageGraph/ModulesGraph+Loading.swift:25); ModulesGraph.swift.loadModulesGraph(createREPLProduct) (Sources/PackageGraph/ModulesGraph.swift:456). Rename to `getREPLProductName`. [rule N6]
D21 · Naming Consistency· `DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project spell it `API` · ×1
`DiagnoseApiBreakingChanges` spells `Api` where 22 names in the project spell it `API` Sources/_InternalTestSupport/SwiftTesting+Tags.swift:199— 22 of 24 names in project AppleProductTypes spell the token `API` (22 of 24; unit: names in project AppleProductTypes containing `API`). Peers: ClangModuleBuildDescription.pluginDerivedAPINotes (Sources/Build/BuildDescription/ClangModuleBuildDescription.swift:103); BuildOperation.hasIntegratedAPIDigesterSupport (Sources/Build/BuildOperation.swift:194); BuildPlan.createAPIToolCommonArgs (Sources/Build/BuildPlan/BuildPlan.swift:536); BuildExecutionContext.indexStoreAPICache (Sources/Build/LLBuildProgressTracker.swift:99); BuildExecutionContext.indexStoreAPI (Sources/Build/LLBuildProgressTracker.swift:102). Rename to `DiagnoseAPIBreakingChanges`. [rule N6]
D21 · Naming Consistency· `ExperimentalApiDiff` spells `Api` where 22 names in the project spell it `API` · ×1
`ExperimentalApiDiff` spells `Api` where 22 names in the project spell it `API` Sources/_InternalTestSupport/SwiftTesting+Tags.swift:203— 22 of 24 names in project AppleProductTypes spell the token `API` (22 of 24; unit: names in project AppleProductTypes containing `API`). Peers: ClangModuleBuildDescription.pluginDerivedAPINotes (Sources/Build/BuildDescription/ClangModuleBuildDescription.swift:103); BuildOperation.hasIntegratedAPIDigesterSupport (Sources/Build/BuildOperation.swift:194); BuildPlan.createAPIToolCommonArgs (Sources/Build/BuildPlan/BuildPlan.swift:536); BuildExecutionContext.indexStoreAPICache (Sources/Build/LLBuildProgressTracker.swift:99); BuildExecutionContext.indexStoreAPI (Sources/Build/LLBuildProgressTracker.swift:102). Rename to `ExperimentalAPIDiff`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (141381 LoC, 1741 module-visible types across 93 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 161 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Sources/PackageCollectionsCommand/PackageCollectionsCommand.swift, Sources/_InternalTestSupport/InMemoryGitRepository.swift, Sources/_InternalBuildTestSupport/PIFTester.swift, Sources/_InternalTestSupport/MockPackageGraphs.swift, Sources/PackageGraph/Resolution/PubGrub/DiagnosticReportBuilder.swift, Sources/PackageFingerprint/FilePackageFingerprintStorage.swift, Sources/PackageSigning/SignatureProvider.swift, Sources/LLBuildManifest/LLBuildManifest.swift (and 153 more) (173 orphaned of 406 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 406 of the 585 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `Documentation/Design/RefactoredModuleAliasTracker.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
README/code drift Sources/PackageModel/README.md:13— Sources/PackageModel/README.md links to `../PackageDescription/README.md`, but `Sources/PackageDescription/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Logging is not universal — Only 2/147 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `Fixtures/CFamilyTargets/CLibraryNoIncludeDir`, `Fixtures/CFamilyTargets/CLibraryWithSpaces`, `Fixtures/CFamilyTargets/MixedCxxUsesSwiftHeader`, `Fixtures/CFamilyTargets/MixedExecutableTestTarget`, `Fixtures/CFamilyTargets/MixedLanguageClient` and 140 more.
Duplicated predicate Sources/PackageCollectionsSigning/CertificatePolicy.swift:511— `chain.leaf.hasExtension(oid: ASN1ObjectIdentifier.NameAttributes.adpSwiftPackageCollectionMarker) || chain.leaf.hasExtension(oid: ASN1Object…` appears character-identically in 2 files — Sources/PackageCollectionsSigning/CertificatePolicy.swift, Sources/Workspace/ManifestSigning/CertificatePolicy.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Skipped (documented): doesNotDeadlockWhenTaskCompletesWhileNextTaskRegisters Tests/BasicsTests/ConcurrencyHelpersTests.swift:219— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): reportsMismatchedMessage Tests/BasicsTests/ObservabilitySystemTests.swift:301— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): reportsMismatchedSeverity Tests/BasicsTests/ObservabilitySystemTests.swift:316— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): diagnosticsCheckUnorderedReportsMismatchedSeverity Tests/BasicsTests/ObservabilitySystemTests.swift:331— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): fileDeleted Tests/BasicsTests/SQLiteBackedCacheTests.swift:61— Skipped with a documented reason — a deferral, not lazy debt: open file cannot be deleted on Windows
Skipped (documented): fileCorrupt Tests/BasicsTests/SQLiteBackedCacheTests.swift:112— Skipped with a documented reason — a deferral, not lazy debt: Disabling as tsan is enabled
Skipped (documented): simpleLibrary Tests/BuildMetalTests/BuildMetalTests.swift:30— Skipped with a documented reason — a deferral, not lazy debt: https://github.com/swiftlang/swift-package-manager/issues/9443: Require downloadable Metal toolchain
Skipped (documented): testAPIDiffOfModuleWithCDependency Tests/CommandsTests/APIDiffTests.swift:297— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): testAPIDiffOfVendoredCDependency Tests/CommandsTests/APIDiffTests.swift:339— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): testAPIDiffAfterAddingNewTarget Tests/CommandsTests/APIDiffTests.swift:386— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): importOfMissedDepWarning Tests/CommandsTests/BuildCommandTests.swift:411— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): importOfMissedDepWarningVerifyingErrorFlow Tests/CommandsTests/BuildCommandTests.swift:458— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): atMainSupport Tests/CommandsTests/BuildCommandTests.swift:860— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): xcodeBuildSystemWithAdditionalBuildFlags Tests/CommandsTests/BuildCommandTests.swift:1174— Skipped with a documented reason — a deferral, not lazy debt: Disabled for now because it is hitting 'IR generation failure: Cannot read legacy layout file' in CI (rdar://88828632)
Skipped (documented): buildCachePrefixMapping Tests/CommandsTests/BuildCommandTests.swift:1391— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): swiftDriverRawOutputGetsNewlines Tests/CommandsTests/BuildCommandTests.swift:1647— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): swiftGetVersion Tests/CommandsTests/BuildCommandTests.swift:1688— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): getTaskAllowEntitlement Tests/CommandsTests/BuildCommandTests.swift:1801— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): doesNotRebuildWithFlags Tests/CommandsTests/BuildCommandTests.swift:2011— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): parseAsLibraryCriteria Tests/CommandsTests/BuildCommandTests.swift:2077— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): buildingPackageWhichRequiresOlderDeploymentTarget Tests/CommandsTests/BuildCommandTests.swift:2222— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): dynamicLibrariesAsFrameworks Tests/CommandsTests/BuildCommandTests.swift:2296— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): xcovArgumentsArePassed Tests/CommandsTests/CoverageTests.swift:650— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): purgeCacheWithoutPackage Tests/CommandsTests/PackageCommandTests.swift:3726— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Skipped (documented): purgeCacheInPackageDirectory Tests/CommandsTests/PackageCommandTests.swift:3754— Skipped with a documented reason — a deferral, not lazy debt: wrapped in withKnownIssue — the body is expected to fail, so its failure is not reported
Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established — This repository's SwiftPM dependencies were read for PINNING discipline: 144 declaration(s) across 343 `Package.swift` manifest(s), against 0 committed pin(s). 31 pinning defect(s) are reported as separate rows below. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these packages has a newer release is the dependency-CURRENCY question, and no dependency here resolves to a VERSION to ask about — each is pinned to a branch or a revision, which tracks whatever that ref points at and therefore cannot be behind a release. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Note also what is deliberately NOT charged here: a published LIBRARY correctly commits no `Package.resolved` (SwiftPM ignores a library's resolution when the package is consumed), and a `path:` dependency is a local directory and the tightest possible binding, not a floating one. Known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 199 file(s) — `Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift`, `Examples/swift-sdl/Sources/SwiftSDL/SwiftSDL.swift`, `Examples/swift-sdl/Sources/SwiftSDLGenerator/SwiftSDLGenerator.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroClient/main.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroDef/MacroDef.swift`, … (+194 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
0
—
Run 01a1d960-43bc-7800-ab22-816d36cd618f · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 86 · Warnings: 1888 · Recommendations: 324 · Info: 195 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 09:25 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.