Public report of swiftlang/swift-package-manager, published 26 October 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.10.5). Watchdog 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, 26 October 2026, 11:26 UTC · Survey ID cd_64e87a8c511d4328bf188f2654ba7249
swiftlang/swift-package-manager
Measured 26 October 2026, 11:18 UTC, at code version 80c1fcb
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
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 scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 1 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: 153,533 lines of product code in 94 projects, tests not counted · Estimated rebuild effort: about 2.4 person-years · Weakest lens: Maturity, 53
Findings by how serious they are
87 critical1720 serious507 minor
20 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 11:18 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 Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸
62of 62 dimensions measured by tools.
2261of 2314 findings point to an exact file and line, so you can open each one in the code. The other 53 concern the repository as a whole, such as missing documentation.
62dimensions across 7 lenses, read from 153,533 lines of product code in 94 projects.
swiftlang/swift-package-manager falls short of our standard for a preview release, in part because we found no recorded design decisions and no architecture document or diagram. It scores 62 out of 100 and is rated Adequate, and 15 of its 87 critical findings are security problems.
Maturity, at 53, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 8 points. Fixing the password or key in the code is another step, worth about 2 points. Raising Maturity to 62 would lift the score to about 66.
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 eleven 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 153,533 lines, about €360,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.
Watchdog compares 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: 29 findings
These 29 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
God Classes · TooManyMethods: RegistryClient Sources/PackageRegistry/RegistryClient.swift
Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift
Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/Commands/PackageCommands/PluginCommand.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/LLBuildManifest/LLBuildManifest.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
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskStartedInfo.taskID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskStartedInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskStartedInfo.parentTaskID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskDiagnosticInfo.taskID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskDiagnosticInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskOutputInfo.taskID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TaskCompleteInfo.taskID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: TargetDiagnosticInfo.targetID Sources/XCBuildSupport/XCBuildMessage.swift
Strongly-typed ids · Raw-primitive id despite a typed-id idiom: MockToolchain.metalToolchainId Sources/_InternalTestSupport/MockBuildTestHelper.swift
Rebuild cost: about €360,000 · Estimate
Cost to rebuild
€120,000 to €590,000, for 1,970 to 6,250 hours of work, about 2.4 person-years for 1 to 5 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 62. 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: 153,533 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: Watchdog prices 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 No ADRs found finding(s) in ADR Quality.
Raises the score by about 8 points · Low effort · ADR Quality
2
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 €360,000 to build again, about 2.4 person-years of work. Its weakest lens is Maturity, at 53 (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 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 1 ADR Quality 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 7.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 25,698 lines over the last 90 days, which is about 104,220 lines a year. At that pace, the extra work comes to an estimated 5.2 to 34.7 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 Watchdog's 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 379 dependencies between them. One loop runs through 28 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.
_AsyncFileSystem uses PackageLoading, so a change to PackageLoading can break _AsyncFileSystem, while a change to _AsyncFileSystem 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→19 _AsyncFileSystem uses QueryEnginepart of a loop✕
Connections
14 pairs of types, where a type in _AsyncFileSystem uses a type in QueryEngine.
_AsyncFileSystem uses PackageModel, so a change to PackageModel can break _AsyncFileSystem, while a change to _AsyncFileSystem 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→24 _AsyncFileSystem uses DriverSupportpart of a loop✕
Connections
1 pair of types, where a type in _AsyncFileSystem uses a type in DriverSupport.
_AsyncFileSystem uses DriverSupport, so a change to DriverSupport can break _AsyncFileSystem, while a change to _AsyncFileSystem can't break DriverSupport.
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.
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.
6→10 PackageFingerprint uses Workspacepart of a loop✕
Connections
1 pair of types, where a type in PackageFingerprint uses a type in Workspace.
PackageFingerprint uses PackageGraph, so a change to PackageGraph can break PackageFingerprint, while a change to PackageFingerprint 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.
6→19 PackageFingerprint uses QueryEnginepart of a loop✕
Connections
3 pairs of types, where a type in PackageFingerprint uses a type in QueryEngine.
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.
6→21 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.
6→23 PackageFingerprint uses PackageModelpart of a loop✕
Connections
6 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.
6→24 PackageFingerprint uses DriverSupportpart of a loop✕
Connections
2 pairs of types, where a type in PackageFingerprint uses a type in DriverSupport.
PackageFingerprint uses DriverSupport, so a change to DriverSupport can break PackageFingerprint, while a change to PackageFingerprint can't break DriverSupport.
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→25 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.
6→31 PackageFingerprint uses Commandspart of a loop✕
Connections
1 pair of types, where a type in PackageFingerprint uses a type in Commands.
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.
7→9 PackageMetadata uses PackageRegistrypart of a loop✕
Connections
1 pair of types, where a type in PackageMetadata uses a type in PackageRegistry.
PackageMetadata uses PackageRegistry, so a change to PackageRegistry can break PackageMetadata, while a change to PackageMetadata can't break PackageRegistry.
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.
PackageMetadata uses PackageLoading, so a change to PackageLoading can break PackageMetadata, while a change to PackageMetadata 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.
7→16 PackageMetadata uses PackageGraphpart of a loop✕
Connections
2 pairs of types, where a type in PackageMetadata uses a type in PackageGraph.
PackageMetadata uses SourceControl, so a change to SourceControl can break PackageMetadata, while a change to PackageMetadata 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.
7→22 PackageMetadata uses PackageCollectionspart of a loop✕
Connections
2 pairs of types, where a type in PackageMetadata uses a type in PackageCollections.
PackageMetadata uses PackageCollections, so a change to PackageCollections can break PackageMetadata, while a change to PackageMetadata can't break PackageCollections.
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→23 PackageMetadata uses PackageModelpart of a loop✕
Connections
3 pairs of types, where a type in PackageMetadata uses a type in PackageModel.
PackageMetadata uses LLBuildManifest, so a change to LLBuildManifest can break PackageMetadata, while a change to PackageMetadata 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.
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 PackageMetadata, so a change to PackageMetadata can break PackageSigning, while a change to PackageSigning can't break PackageMetadata.
Position
Below the diagonal: PackageSigning uses a module listed above it, which is the healthy direction.
PackageSigning uses PackageLoading, so a change to PackageLoading can break PackageSigning, while a change to PackageSigning 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.
8→16 PackageSigning uses PackageGraphpart of a loop✕
Connections
4 pairs of types, where a type in PackageSigning uses a type in PackageGraph.
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.
8→19 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.
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.
PackageRegistry uses PackageMetadata, so a change to PackageMetadata can break PackageRegistry, while a change to PackageRegistry can't break PackageMetadata.
Position
Below the diagonal: PackageRegistry uses a module listed above it, which is the healthy direction.
PackageRegistry uses PackageSigning, so a change to PackageSigning can break PackageRegistry, while a change to PackageRegistry can't break PackageSigning.
Position
Below the diagonal: PackageRegistry uses a module listed above it, which is the healthy direction.
PackageRegistry uses PackageLoading, so a change to PackageLoading can break PackageRegistry, while a change to PackageRegistry 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.
9→16 PackageRegistry uses PackageGraphpart of a loop✕
Connections
13 pairs of types, where a type in PackageRegistry uses a type in PackageGraph.
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.
9→19 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.
9→23 PackageRegistry uses PackageModelpart of a loop✕
Connections
34 pairs of types, where a type in PackageRegistry uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
PackageRegistry uses DriverSupport, so a change to DriverSupport can break PackageRegistry, while a change to PackageRegistry can't break DriverSupport.
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→25 PackageRegistry uses LLBuildManifestpart of a loop✕
Connections
5 pairs of types, where a type in PackageRegistry uses a type in LLBuildManifest.
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.
32 pairs of types, where a type in Workspace uses a type in PackageGraph. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
10→22 Workspace uses PackageCollectionspart of a loop✕
Connections
1 pair of types, where a type in Workspace uses a type in PackageCollections.
70 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 DriverSupport, so a change to DriverSupport can break Workspace, while a change to Workspace can't break DriverSupport.
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→25 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.
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.
11→13 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.
11→14 SwiftBuildSupport uses Runtimespart of a loop✕
Connections
8 pairs of types, where a type in SwiftBuildSupport uses a type in Runtimes.
SwiftBuildSupport uses Runtimes, so a change to Runtimes can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break Runtimes.
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.
11→15 SwiftBuildSupport uses PackageLoadingpart of a loop✕
Connections
27 pairs of types, where a type in SwiftBuildSupport uses a type in PackageLoading. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
11→16 SwiftBuildSupport uses PackageGraphpart of a loop✕
Connections
29 pairs of types, where a type in SwiftBuildSupport uses a type in PackageGraph. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
11→17 SwiftBuildSupport uses PackageRegistryCommandpart of a loop✕
Connections
7 pairs of types, where a type in SwiftBuildSupport uses a type in PackageRegistryCommand.
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.
11→18 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.
11→19 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.
11→21 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.
11→22 SwiftBuildSupport uses PackageCollectionspart of a loop✕
Connections
1 pair of types, where a type in SwiftBuildSupport uses a type in PackageCollections.
SwiftBuildSupport uses PackageCollections, so a change to PackageCollections can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break PackageCollections.
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.
11→23 SwiftBuildSupport uses PackageModelpart of a loop✕
Connections
31 pairs of types, where a type in SwiftBuildSupport uses a type in PackageModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
11→24 SwiftBuildSupport uses DriverSupportpart of a loop✕
Connections
4 pairs of types, where a type in SwiftBuildSupport uses a type in DriverSupport.
SwiftBuildSupport uses DriverSupport, so a change to DriverSupport can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break DriverSupport.
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.
11→25 SwiftBuildSupport uses LLBuildManifestpart of a loop✕
Connections
34 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.
11→30 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.
SwiftBuildSupport uses Build, so a change to Build can break SwiftBuildSupport, while a change to SwiftBuildSupport can't break Build.
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.
11→33 SwiftBuildSupport uses Basicspart of a loop✕
Connections
39 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 _AsyncFileSystem, so a change to _AsyncFileSystem can break XCBuildSupport, while a change to XCBuildSupport can't break _AsyncFileSystem.
Position
Below the diagonal: XCBuildSupport uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in XCBuildSupport uses a type in SwiftBuildSupport. 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.
12→13 XCBuildSupport uses SPMBuildCorepart of a loop✕
Connections
5 pairs of types, where a type in XCBuildSupport uses a type in SPMBuildCore.
XCBuildSupport uses PackageLoading, so a change to PackageLoading can break XCBuildSupport, while a change to XCBuildSupport 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.
12→16 XCBuildSupport uses PackageGraphpart of a loop✕
Connections
6 pairs of types, where a type in XCBuildSupport uses a type in PackageGraph.
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.
12→19 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 DriverSupport, so a change to DriverSupport can break XCBuildSupport, while a change to XCBuildSupport can't break DriverSupport.
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→25 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
Below the diagonal: SPMBuildCore uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in SPMBuildCore uses a type in Runtimes. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
13→19 SPMBuildCore uses QueryEnginepart of a loop✕
Connections
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.
13→22 SPMBuildCore uses PackageCollectionspart of a loop✕
Connections
1 pair of types, where a type in SPMBuildCore uses a type in PackageCollections.
SPMBuildCore uses PackageCollections, so a change to PackageCollections can break SPMBuildCore, while a change to SPMBuildCore can't break PackageCollections.
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→23 SPMBuildCore uses PackageModelpart of a loop✕
Connections
21 pairs of types, where a type in SPMBuildCore uses a type in PackageModel.
SPMBuildCore uses DriverSupport, so a change to DriverSupport can break SPMBuildCore, while a change to SPMBuildCore can't break DriverSupport.
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→25 SPMBuildCore uses LLBuildManifestpart of a loop✕
Connections
58 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.
61 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.
65 pairs of types, where a type in Runtimes uses a type in PackageLoading. 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.
14→22 Runtimes uses PackageCollectionspart of a loop✕
Connections
1 pair of types, where a type in Runtimes uses a type in PackageCollections.
Runtimes uses DriverSupport, so a change to DriverSupport can break Runtimes, while a change to Runtimes can't break DriverSupport.
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→25 Runtimes uses LLBuildManifestpart of a loop✕
Connections
92 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.
PackageLoading uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageLoading, while a change to PackageLoading can't break _AsyncFileSystem.
Position
Below the diagonal: PackageLoading uses a module listed above it, which is the healthy direction.
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 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.
15→19 PackageLoading uses QueryEnginepart of a loop✕
Connections
24 pairs of types, where a type in PackageLoading uses a type in QueryEngine.
PackageLoading uses PackageCollectionsSigning, so a change to PackageCollectionsSigning can break PackageLoading, while a change to PackageLoading 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.
15→23 PackageLoading uses PackageModelpart of a loop✕
Connections
86 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 DriverSupport, so a change to DriverSupport can break PackageLoading, while a change to PackageLoading can't break DriverSupport.
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→25 PackageLoading uses LLBuildManifestpart of a loop✕
Connections
56 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.
49 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.
PackageGraph uses _AsyncFileSystem, so a change to _AsyncFileSystem can break PackageGraph, while a change to PackageGraph can't break _AsyncFileSystem.
Position
Below the diagonal: PackageGraph uses a module listed above it, which is the healthy direction.
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.
28 pairs of types, where a type in PackageGraph uses a type in PackageLoading. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
16→18 PackageGraph uses SourceControlpart of a loop✕
Connections
1 pair of types, where a type in PackageGraph uses a type in SourceControl.
PackageGraph uses SourceControl, so a change to SourceControl can break PackageGraph, while a change to PackageGraph 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.
16→19 PackageGraph uses QueryEnginepart of a loop✕
Connections
40 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 PackageCollections, so a change to PackageCollections can break PackageGraph, while a change to PackageGraph can't break PackageCollections.
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→23 PackageGraph uses PackageModelpart of a loop✕
Connections
95 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 DriverSupport, so a change to DriverSupport can break PackageGraph, while a change to PackageGraph can't break DriverSupport.
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→25 PackageGraph uses LLBuildManifestpart of a loop✕
Connections
35 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.
43 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.
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.
PackageRegistryCommand uses Runtimes, so a change to Runtimes can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break Runtimes.
Position
Below the diagonal: PackageRegistryCommand uses a module listed above it, which is the healthy direction.
PackageRegistryCommand uses PackageGraph, so a change to PackageGraph can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break PackageGraph.
Position
Below the diagonal: PackageRegistryCommand uses a module listed above it, which is the healthy direction.
17→19 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.
17→23 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.
17→24 PackageRegistryCommand uses DriverSupportpart of a loop✕
Connections
2 pairs of types, where a type in PackageRegistryCommand uses a type in DriverSupport.
PackageRegistryCommand uses DriverSupport, so a change to DriverSupport can break PackageRegistryCommand, while a change to PackageRegistryCommand can't break DriverSupport.
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.
17→25 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.
17→30 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.
17→33 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.
18→19 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.
46 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 Runtimes, so a change to Runtimes can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break Runtimes.
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.
21→23 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.
21→24 PackageCollectionsSigning uses DriverSupportpart of a loop✕
Connections
4 pairs of types, where a type in PackageCollectionsSigning uses a type in DriverSupport.
PackageCollectionsSigning uses DriverSupport, so a change to DriverSupport can break PackageCollectionsSigning, while a change to PackageCollectionsSigning can't break DriverSupport.
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.
21→25 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.
21→31 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.
21→33 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.
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 PackageLoading, so a change to PackageLoading can break PackageCollections, while a change to PackageCollections can't break PackageLoading.
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.
22→23 PackageCollections uses PackageModelpart of a loop✕
Connections
19 pairs of types, where a type in PackageCollections uses a type in PackageModel.
PackageCollections uses PackageModel, so a change to PackageModel can break PackageCollections, while a change to PackageCollections 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.
22→24 PackageCollections uses DriverSupportpart of a loop✕
Connections
12 pairs of types, where a type in PackageCollections uses a type in DriverSupport.
PackageCollections uses DriverSupport, so a change to DriverSupport can break PackageCollections, while a change to PackageCollections can't break DriverSupport.
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.
22→25 PackageCollections uses LLBuildManifestpart of a loop✕
Connections
27 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
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.
22→31 PackageCollections uses Commandspart of a loop✕
Connections
7 pairs of types, where a type in PackageCollections uses a type in Commands.
PackageCollections uses Commands, so a change to Commands can break PackageCollections, while a change to PackageCollections 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.
22→33 PackageCollections uses Basicspart of a loop✕
Connections
43 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.
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 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.
62 pairs of types, where a type in PackageModel uses a type in PackageLoading. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
63 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.
PackageModel uses PackageCollections, so a change to PackageCollections can break PackageModel, while a change to PackageModel can't break PackageCollections.
Position
Below the diagonal: PackageModel uses a module listed above it, which is the healthy direction.
23→24 PackageModel uses DriverSupportpart of a loop✕
Connections
10 pairs of types, where a type in PackageModel uses a type in DriverSupport.
PackageModel uses DriverSupport, so a change to DriverSupport can break PackageModel, while a change to PackageModel can't break DriverSupport.
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.
23→25 PackageModel uses LLBuildManifestpart of a loop✕
Connections
116 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.
116 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.
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
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.
LLBuildManifest uses PackageLoading, so a change to PackageLoading can break LLBuildManifest, while a change to LLBuildManifest can't break PackageLoading.
Position
Below the diagonal: LLBuildManifest uses a module listed above it, which is the healthy direction.
LLBuildManifest uses PackageCollections, so a change to PackageCollections can break LLBuildManifest, while a change to LLBuildManifest can't break PackageCollections.
Position
Below the diagonal: LLBuildManifest uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in LLBuildManifest uses a type in DriverSupport.
The types involved
LLBuildManifest.Error → DriverSupport.Error
Direction
LLBuildManifest uses DriverSupport, so a change to DriverSupport can break LLBuildManifest, while a change to LLBuildManifest can't break DriverSupport.
Position
Below the diagonal: LLBuildManifest uses a module listed above it, which is the healthy direction.
PackageCollectionsCommand uses Runtimes, so a change to Runtimes can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break Runtimes.
Position
Below the diagonal: PackageCollectionsCommand uses a module listed above it, which is the healthy direction.
PackageCollectionsCommand uses PackageGraph, so a change to PackageGraph can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break PackageGraph.
Position
Below the diagonal: PackageCollectionsCommand uses a module listed above it, which is the healthy direction.
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 DriverSupport, so a change to DriverSupport can break PackageCollectionsCommand, while a change to PackageCollectionsCommand can't break DriverSupport.
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.
26→30 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 PackageGraph, so a change to PackageGraph can break Utilities~InstalledSwiftPMConfiguration, while a change to Utilities~InstalledSwiftPMConfiguration can't break PackageGraph.
Position
Below the diagonal: Utilities~InstalledSwiftPMConfiguration uses a module listed above it, which is the healthy direction.
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 PackageModel, so a change to PackageModel can break Utilities~InstalledSwiftPMConfiguration, while a change to Utilities~InstalledSwiftPMConfiguration can't break PackageModel.
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 SwiftBuildSupport, so a change to SwiftBuildSupport can break CoreCommands, while a change to CoreCommands can't break SwiftBuildSupport.
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.
39 pairs of types, where a type in CoreCommands uses a type in Basics. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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.
37 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.
98 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.
38 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.
42 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.
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.
114 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.
30 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.
89 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.
SourceKitLSPAPI uses PackageLoading, so a change to PackageLoading can break SourceKitLSPAPI, while a change to SourceKitLSPAPI can't break PackageLoading.
Position
Below the diagonal: SourceKitLSPAPI uses a module listed above it, which is the healthy direction.
SourceKitLSPAPI uses DriverSupport, so a change to DriverSupport can break SourceKitLSPAPI, while a change to SourceKitLSPAPI can't break DriverSupport.
Position
Below the diagonal: SourceKitLSPAPI uses a module listed above it, which is the healthy direction.
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.
SwiftFixIt uses PackageCollections, so a change to PackageCollections can break SwiftFixIt, while a change to SwiftFixIt can't break PackageCollections.
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.
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 PackageModel, so a change to PackageModel can break SwiftPMBuildServer, while a change to SwiftPMBuildServer can't break PackageModel.
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
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
Begin by establishing architectural governance by documenting significant design decisions in a dedicated ADR folder and resolving the single missing ADR finding. Next, address knowledge freshness by removing 162 orphaned files, prioritizing Diagnostics.swift and X509Extensions.swift, followed by cleaning up 11 orphaned knowledge entries in files like PIF.swift. Finally, improve onboarding by adding a clear Testing section to the root README that explains how to run the test suite.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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 — 87
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 — 1720
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 — 507
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 20
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
Watchdog 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. 62 of 62 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 62 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, 2261 of 2314 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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 — Watchdog 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 — 138 SwiftPM declaration(s) across 340 `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 — Watchdog measured this, but not all of it. What it 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 — not measured this run — Watchdog 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. D21's deterministic naming 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. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog 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 — Watchdog 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.
D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroClient/main.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroDef/MacroDef.swift`, `Fixtures/Macros/MacroPackage/Sources/MacroClient/client.swift`, `Fixtures/Macros/MacroPackage/Sources/MacroDef/definition.swift`, … (+191 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 — Watchdog 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 — Watchdog 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 — Watchdog 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 — Watchdog 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) — shell Error Get "https://registry-1.docker.io/v2/": Forbidden bootstrap-clean Error Get "https://registry-1.docker.io/v2/": Forbidden failed to solve: swift:5.3-xenial: failed to resolve source metadata for docker.io/library/swift:5.3-xenial: failed to do request: Head "https://registry-1.docker.io/v2/library/swift/manifests/5.3-xenial": Forbidden; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog 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 — Watchdog 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 — Watchdog 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 — Watchdog measured this, but not all of it. What it 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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 — Watchdog 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 — Watchdog measured this, but not all of it. What it 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). 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 — Watchdog 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.
X16 Unfloored truncation loop — not measured this run — Watchdog 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 — Watchdog 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.
X2 Cancellation propagation — not measured this run — Watchdog 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; 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.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog 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, 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.
X5 Nullable reference types — not measured this run — Watchdog 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
Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's 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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
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 — Watchdog runs 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 REDACTED Scanning: REDACTED 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
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.
105 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.
+ 99 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 78), PackagePIFProjectBuilder.makeMainModuleProduct (cyclomatic 62). — 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.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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 136). — Refactoring it lifts Cognitive Complexity from 5.0 to about 5.2/10.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.4 / 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 36 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 (36 warning-level).
Resolve the 33 FileTooLong finding(s) in God Classes — start with PIFBuilder.swift (2), RegistryClient.swift, PackageBuilder.swift. — One of this dimension's main actionable groups (33 warning-level).
Resolve the 18 ClassTooLong finding(s) in God Classes — start with RegistryClient.swift, PackageBuilder.swift, UserToolchain.swift. — One of this dimension's main actionable groups (18 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
236 duplicated block group(s) detected. A further 13 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 42 of the 249 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.
+ 85 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with PackageDependency.swift (4), ManifestJSONParser.swift (2), AsyncProcess.swift. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 17 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with SQLiteBackedCache.swift (2), PIF.swift (2), ManifestSourceGeneration.swift (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with URLSessionHTTPClient.swift, SQLitePackageCollectionsStorage.swift, ManifestSignatureParser.swift. — One of this dimension's main actionable groups (16 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
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).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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 18 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 (18 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.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 coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, 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).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
3089 test methods: 3051 unit, 36 integration, 2 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.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.
338 skipped (182 with a documented reason), 480 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3089 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 · ×322Tests/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).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 14 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 14 — 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. 56 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 14 Hotspot finding(s) in Churn × Complexity Hotspots — start with SwiftBuildSystem.swift, PackagePIFProjectBuilder+Modules.swift, PackagePIFProjectBuilder+Products.swift. — One of this dimension's main actionable groups (14 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.7 / 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.
14 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/PackageGraph/ModuleAliasTracker.swift. Counted over 403 of the 581 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.
443 deducted task-comment markers across 153533 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 158 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 (158 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).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
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: REDACTED 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.
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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 166, line 193, line 212, …), `Sources/SwiftBuildSupport/PackagePIFBuilder.swift` (line 249, line 283, line 463, …), `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift` (line 220, line 222, line 399, …), … (+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 403 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 403 of the 581 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 162 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 (162 recommendation-level).
Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with PIF.swift, SBOMValidator.swift, Product.swift. — One of this dimension's main actionable groups (11 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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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. (×2) — Sources/PackageCollectionsSigning/CertificatePolicy.swift:283, Sources/Workspace/ManifestSigning/CertificatePolicy.swift:285
`_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. (×2) — Sources/PackageCollectionsSigning/CertificatePolicy.swift:449, Sources/Workspace/ManifestSigning/CertificatePolicy.swift:452
`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
`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:95
`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:810
`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:821
`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
`Name.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/Workspace/ManifestSigning/ManifestSigning.swift:57
`TargetDependency.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/XCBuildSupport/PIF.swift:411
`TargetStartedInfo.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/XCBuildSupport/XCBuildMessage.swift:55
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 repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 324 of 338 project(s) that lack one — worth up to 1.9 pts.
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.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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 the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 42 use(s) across 146,754 production line(s) (~0.3/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
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 the language 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 · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. 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?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. 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?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
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 — 59 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.
AC7 A11y enforcement — 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) — shell Error Get "https://registry-1.docker.io/v2/": Forbidden bootstrap-clean Error Get "https://registry-1.docker.io/v2/": Forbidden failed to solve: swift:5.3-xenial: failed to resolve source metadata for docker.io/library/swift:5.3-xenial: failed to do request: Head "https://registry-1.docker.io/v2/library/swift/manifests/5.3-xenial": Forbidden; 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 — 138 SwiftPM declaration(s) across 340 `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.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Swift not measured.
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+ projects each declaring an entity of their own. 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# and Visual Basic 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 — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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) — 196 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release). 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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
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
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
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.
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.
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
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
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.
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
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.
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 — 87 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: 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.
Raw-primitive id despite a typed-id idiom: SPDXLicenseExpression.creationInfoID Sources/SBOMModel/SPDX/SPDXLicenseExpression.swift:17— `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.
Raw-primitive id despite a typed-id idiom: SPDXPackage.id Sources/SBOMModel/SPDX/SPDXPackage.swift:21— `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.
Raw-primitive id despite a typed-id idiom: SPDXPackage.creationInfoID Sources/SBOMModel/SPDX/SPDXPackage.swift:27— `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.
Raw-primitive id despite a typed-id idiom: SPDXRelationship.id Sources/SBOMModel/SPDX/SPDXRelationship.swift:24— `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.
Raw-primitive id despite a typed-id idiom: SPDXRelationship.creationInfoID Sources/SBOMModel/SPDX/SPDXRelationship.swift:27— `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.
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/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/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/PackageCollectionsModel/PackageCollectionModel+v1.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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:1004— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:1059— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:177— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:191— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:238— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:574— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:966— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:1815— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:2205— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:2617— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:696— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:4147— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:2309— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:2629— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:2719— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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:12075— // 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:12763— // 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:12838— // 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:3938— // 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:697— // 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:151— // 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:881— // 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:15009— // 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:64— // 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:185— // 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:333— // 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:443— // 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:473— // 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:782— // 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 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.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: 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:692— MethodTooLong — buildLibraryProduct runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× 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:658— MethodTooLong — startSWBuildOperation runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.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: 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: 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: SwiftBuildSystem.makeBuildParameters Sources/SwiftBuildSupport/SwiftBuildSystem.swift:913— MethodTooLong — makeBuildParameters 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 — 1236 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 736 over it, 2.47× 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 — 1234 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: PackageBuilder (292-1922). The bar is 500 significant lines; this is 734 over it, 2.47× 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 — 1088 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 588 over it, 2.18× 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 — 1049 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 549 over it, 2.10× 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 — 1021 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: SwiftBuildSystem (268-1541). The bar is 500 significant lines; this is 521 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: CoreCommands/SwiftCommandState.swift Sources/CoreCommands/SwiftCommandState.swift— FileTooLong — 1018 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: SwiftCommandState (288-1433). The bar is 500 significant lines; this is 518 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 — 978 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 478 over it, 1.96× 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 — 880 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 380 over it, 1.76× 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: 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: SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift— FileTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 297 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: 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: 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: SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift— FileTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 200 over it, 1.40× 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+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:477— `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.
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:469— Sources/PackageLoading/ManifestJSONParser.swift:469-476 | 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/ToolsVersion.swift:110— Sources/PackageModel/ToolsVersion.swift:110-117 | Sources/PackageModel/ToolsVersion.swift:128-135 — 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/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:420— Sources/Runtimes/PackageDescription/PackageDependency.swift:420-427 | Sources/Runtimes/PackageDescription/PackageDependency.swift:483-490 — 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:441— Sources/Runtimes/PackageDescription/PackageDependency.swift:441-448 | Sources/Runtimes/PackageDescription/PackageDependency.swift:504-511 — 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/Runtimes/PackageDescription/PackageDependency.swift:463` calls `available` and `Sources/Runtimes/PackageDescription/PackageDependency.swift:530` 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 (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/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:568— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:568-575 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1199-1206 — 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:1199` 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/SwiftPMBuildServer/SwiftPMBuildServer.swift:549— Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:549-556 | Sources/SwiftPMBuildServer/SwiftPMBuildServer.swift:561-568 — 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/Module/Module.swift:108— Sources/PackageModel/Module/Module.swift:108-115 | 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:493— Sources/PackageLoading/ManifestJSONParser.swift:493-500 | 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) Sources/_InternalBuildTestSupport/PIFTester.swift:86— Sources/_InternalBuildTestSupport/PIFTester.swift:86-93 | Sources/_InternalBuildTestSupport/PIFTester.swift:131-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:86` 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/_InternalTestSupport/PackageGraphTester.swift:59— Sources/_InternalTestSupport/PackageGraphTester.swift:59-66 | Sources/_InternalTestSupport/PackageGraphTester.swift:68-75 — 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.
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 — 980 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 580 over it, 2.45× 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 — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 417 over it, 2.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: 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 — 712 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 312 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 — 527 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 127 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: 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 — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 10 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: 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: Workspace (LCOM4 9) Sources/SwiftBuildSupport/PIF.swift:116— Workspace's methods fall into 9 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 9 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:1790— 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:26— 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:2119— 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: Module (LCOM4 5) Sources/PackageModel/Module/Module.swift:19— Module'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:2049— 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.
Duplicated block (5 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:126— Sources/Basics/Archiver/TarArchiver.swift:126-130 | Sources/Basics/Archiver/ZipArchiver.swift:131-135 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:126` 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/Basics/SQLiteBackedCache.swift:173— Sources/Basics/SQLiteBackedCache.swift:173-177 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:864-868 — 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/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/Basics/SQLiteBackedCache.swift:193— Sources/Basics/SQLiteBackedCache.swift:193-197 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:884-888 — 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/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/PackageCollectionsSigning/CertificatePolicy.swift:43— Sources/PackageCollectionsSigning/CertificatePolicy.swift:43-47 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:43-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 217 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/CertificatePolicy.swift:43` 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 (5 lines × 2) Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:157— Sources/PackageFingerprint/FilePackageFingerprintStorage.swift:157-161 | Sources/PackageSigning/SigningEntity/FilePackageSigningEntityStorage.swift:190-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. 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 (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/Runtimes/PackageDescription/Version+StringLiteralConvertible.swift:77— Sources/Runtimes/PackageDescription/Version+StringLiteralConvertible.swift:77-81 | Sources/Runtimes/PackageDescription/Version+StringLiteralConvertible.swift:86-90 — 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/Version+StringLiteralConvertible.swift:77` 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 (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:1156— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1156-1170 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:578-582 — 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:1156` 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/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1037— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1037-1041 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:1084-1088 — 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:1037` 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:511-516 — 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:125— Sources/PackageModel/ManifestSourceGeneration.swift:125-129 | Sources/PackageModel/ManifestSourceGeneration.swift:131-135 — 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 (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/XCBuildSupport/PIF.swift:134— Sources/XCBuildSupport/PIF.swift:134-138 | Sources/XCBuildSupport/PIF.swift:219-223 — 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 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 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 (5 lines × 2) Sources/Commands/SwiftTestCommand.swift:2056— Sources/Commands/SwiftTestCommand.swift:2056-2060 | Sources/Commands/SwiftTestCommand.swift:2063-2067 — 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/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/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:498— Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:498-507 | Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift:611-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:498` 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 (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/PackageLoading/PackageBuilder.swift:1443— Sources/PackageLoading/PackageBuilder.swift:1443-1452 | Sources/PackageLoading/PackageBuilder.swift:1455-1464 — 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/PackageModel/ManifestSourceGeneration.swift:376— Sources/PackageModel/ManifestSourceGeneration.swift:376-385 | Sources/PackageModel/ManifestSourceGeneration.swift:397-406 — 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:376` 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/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:926— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:926-935 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:472-481 — 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/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:499-508 — 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:480— Sources/PackageLoading/ManifestJSONParser.swift:480-489 | 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:176— Sources/_InternalTestSupport/XCTAssertHelpers.swift:176-185 | Sources/_InternalTestSupport/XCTAssertHelpers.swift:207-216 — 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: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.
Hotspot: Sources/SwiftBuildSupport/SwiftBuildSystem.swift Sources/SwiftBuildSupport/SwiftBuildSystem.swift:913— 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 913. 2 of those changes were fix/bug commits, and the other 13 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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:362— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in PackagePIFProjectBuilder.buildSourceModule at line 362. 1 of those changes was a fix/bug commit, and the other 7 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in PackagePIFProjectBuilder.makeMainModuleProduct at line 42. 2 of those changes were fix/bug commits, and the other 7 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/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. 1 of those changes was a fix/bug commit, and the other 4 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/PackagePIFBuilder+Helpers.swift Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:720— Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in ResolvedModule.computeAllBuildSettings at line 720. 1 of those changes was a fix/bug commit, and the other 5 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07:00' --full-history --no-merges -- Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.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:697— Sources/PackageLoading/ManifestJSONParser.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Kind.from at line 697. 1 of those changes was a fix/bug commit, and the other 2 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/Commands/SwiftTestCommand.swift Sources/Commands/SwiftTestCommand.swift:317— Sources/Commands/SwiftTestCommand.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in SwiftTestCommand.run at line 317. 1 of those changes was a fix/bug commit, and the other 4 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07:00' --full-history --no-merges -- Sources/Commands/SwiftTestCommand.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/ManifestLoader.swift Sources/PackageLoading/ManifestLoader.swift:699— Sources/PackageLoading/ManifestLoader.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ManifestLoader.evaluateManifest at line 699. 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07:00' --full-history --no-merges -- Sources/PackageLoading/ManifestLoader.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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/SwiftBuildSupport/PIFBuilder.swift Sources/SwiftBuildSupport/PIFBuilder.swift:887— Sources/SwiftBuildSupport/PIFBuilder.swift changed 4 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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/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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07: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.
Hotspot: Sources/Commands/PackageCommands/DumpCommands.swift Sources/Commands/PackageCommands/DumpCommands.swift:55— Sources/Commands/PackageCommands/DumpCommands.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in DumpSymbolGraph.run at line 55. 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 15:33:39 -07:00' --until='2026-10-23 15:33:39 -07:00' --full-history --no-merges -- Sources/Commands/PackageCommands/DumpCommands.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.
Duplicated block (13 lines × 2) Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119— Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119-131 | Sources/SBOMModel/CycloneDX/CycloneDXComponent.swift:51-63 — 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 `Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119` 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:324— Sources/PackageLoading/ManifestJSONParser.swift:324-336 | 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/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/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:133— Sources/_InternalTestSupport/misc.swift:133-145 | Sources/_InternalTestSupport/misc.swift:221-233 — 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 (6 lines × 2) Sources/PackageLoading/ManifestJSONParser.swift:345— Sources/PackageLoading/ManifestJSONParser.swift:345-350 | Sources/Runtimes/PackageDescription/PackageDescriptionSerializationConversion.swift:463-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/PackageLoading/ManifestJSONParser.swift:345` 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 (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/ManifestSourceGeneration.swift:890— Sources/PackageModel/ManifestSourceGeneration.swift:890-895 | Sources/PackageModel/ManifestSourceGeneration.swift:912-917 — 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:890` 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/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 (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) 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) 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:98-105 — 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/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/_IntegrationTestSupport/Helpers.swift:125— Sources/_IntegrationTestSupport/Helpers.swift:125-130 | Sources/_IntegrationTestSupport/Helpers.swift:142-147 — 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:125` 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/_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.
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: 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.
TooManyMethods: PackagePIFProjectBuilder Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift:41— TooManyMethods — 34 methods, declared across 3 files: SwiftBuildSupport/PackagePIFProjectBuilder.swift (14), SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift (12), SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift (8). 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.
Duplicated block (12 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:113— Sources/Basics/Archiver/TarArchiver.swift:113-124 | Sources/Basics/Archiver/ZipArchiver.swift:118-129 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:113` 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 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 (12 lines × 2) Sources/Basics/Environment/Environment.swift:139— Sources/Basics/Environment/Environment.swift:139-150 | Sources/Basics/Environment/Environment.swift:170-181 — 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:139` 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:1055— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:1055-1066 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:589-600 — 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:1055` 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:1067` calls `Set` and `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:601` 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/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 (12 lines × 2) Sources/_InternalTestSupport/MockPackage.swift:40— Sources/_InternalTestSupport/MockPackage.swift:40-51 | Sources/_InternalTestSupport/MockPackage.swift:67-78 — 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.
Duplicated block (7 lines × 2) Sources/Basics/Environment/Environment.swift:82— Sources/Basics/Environment/Environment.swift:82-88 | Sources/Basics/Environment/Environment.swift:91-97 — 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:293— Sources/PackageLoading/ManifestJSONParser.swift:293-299 | Sources/PackageLoading/ManifestJSONParser.swift:310-316 — 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:293` 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/PackageModel/ManifestSourceGeneration.swift:868— Sources/PackageModel/ManifestSourceGeneration.swift:868-874 | Sources/PackageModel/ManifestSourceGeneration.swift:892-898 — 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:868` 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/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 217 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.
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/PackageCollections/PackageIndex+Configuration.swift:28— Sources/PackageCollections/PackageIndex+Configuration.swift:28-36 | Sources/PackageCollections/Providers/GitHubPackageMetadataProvider.swift:288-296 — 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/PackageCollections/PackageIndex+Configuration.swift:28` 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 (9 lines × 2) Sources/PackageModel/ManifestSourceGeneration.swift:765— Sources/PackageModel/ManifestSourceGeneration.swift:765-773 | Sources/PackageModel/ManifestSourceGeneration.swift:778-786 — 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:765` 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 × 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:1241— Sources/Workspace/Workspace+State.swift:1241-1249 | Sources/Workspace/Workspace+State.swift:1484-1492 — 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/Archiver/TarArchiver.swift:61— Sources/Basics/Archiver/TarArchiver.swift:61-75 | Sources/Basics/Archiver/ZipArchiver.swift:48-62 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:61` 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 (15 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:134— Sources/Basics/Archiver/TarArchiver.swift:134-148 | Sources/Basics/Archiver/ZipArchiver.swift:139-153 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:134` 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 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 (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:140— Sources/_InternalTestSupport/misc.swift:140-154 | Sources/_InternalTestSupport/misc.swift:185-199 — 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:140` 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:228— Sources/_InternalTestSupport/misc.swift:228-242 | Sources/_InternalTestSupport/misc.swift:273-287 — 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:228` 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/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:1525-1535 — 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:189— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:189-199 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:668-678 — 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:189` 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:681` calls `insert` and `Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:200` 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:412— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:412-422 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:726-736 — 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:412` 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/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:545— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:545-555 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:558-568 — 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.
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.
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:65— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:65-78 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:864-877 — 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:65` 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:962— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:962-975 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:942-955 — 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:962` 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:551— Sources/_InternalTestSupport/misc.swift:551-564 | Sources/_InternalTestSupport/misc.swift:573-586 — 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:551` 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Basics/Archiver/TarArchiver.swift:61— Sources/Basics/Archiver/TarArchiver.swift:61-96 | Sources/Basics/Archiver/TarArchiver.swift:126-148 | Sources/Basics/Archiver/ZipArchiver.swift:48-82 | Sources/Basics/Archiver/ZipArchiver.swift:131-153 — 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/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/PackageRegistry/SignatureValidation.swift:124— Sources/PackageRegistry/SignatureValidation.swift:124-229 | Sources/PackageRegistry/SignatureValidation.swift:231-313 | Sources/PackageRegistry/SignatureValidation.swift:383-489 | Sources/PackageRegistry/SignatureValidation.swift:491-565 — 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:595— Sources/Workspace/Workspace+State.swift:595-604 | Sources/Workspace/Workspace+State.swift:951-960 | Sources/Workspace/Workspace+State.swift:1278-1287 | Sources/Workspace/Workspace+State.swift:1523-1532 — 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.
Duplicated block (17 lines × 2) Sources/Basics/Archiver/TarArchiver.swift:80— Sources/Basics/Archiver/TarArchiver.swift:80-96 | Sources/Basics/Archiver/ZipArchiver.swift:66-82 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:80` 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 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 (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:521— Sources/XCBuildSupport/PIFBuilder.swift:521-537 | Sources/XCBuildSupport/PIFBuilder.swift:756-772 — 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:521` 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.
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/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:218— Sources/PackageGraph/Resolution/ResolvedModule.swift:218-224 | Sources/PackageGraph/Resolution/ResolvedPackage.swift:82-88 | Sources/PackageGraph/Resolution/ResolvedProduct.swift:168-174 — 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.
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:372— Sources/Commands/SwiftTestCommand.swift:372-382 | Sources/Commands/SwiftTestCommand.swift:484-494 | Sources/Commands/SwiftTestCommand.swift:601-611 — 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 (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 (10–11 lines × 2) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:685— Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:685-695 | Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:221-230 — 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:685` 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 × 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:474— Sources/_InternalTestSupport/misc.swift:474-495 | Sources/_InternalTestSupport/misc.swift:497-518 | Sources/_InternalTestSupport/misc.swift:520-544 | Sources/_InternalTestSupport/misc.swift:546-566 | Sources/_InternalTestSupport/misc.swift:568-588 — 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.
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 217 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 217 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 217 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/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 217 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:571— Sources/Workspace/Workspace+State.swift:571-591 | Sources/Workspace/Workspace+State.swift:927-947 | Sources/Workspace/Workspace+State.swift:1254-1274 — 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:1227-1239 — 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:1227` 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/SourceControl/GitRepository.swift:1174— Sources/SourceControl/GitRepository.swift:1174-1185 | Sources/SourceControl/GitRepository.swift:1188-1200 — 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 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–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 (9–10 lines × 3) Sources/Commands/PackageCommands/DumpCommands.swift:170— Sources/Commands/PackageCommands/DumpCommands.swift:170-179 | Sources/Commands/SwiftTestCommand.swift:993-1001 | Sources/Commands/SwiftTestCommand.swift:1347-1355 — 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 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.
Duplicated block (8 lines × 4) Sources/Workspace/Workspace+State.swift:597— Sources/Workspace/Workspace+State.swift:597-604 | Sources/Workspace/Workspace+State.swift:953-960 | Sources/Workspace/Workspace+State.swift:1280-1287 | Sources/Workspace/Workspace+State.swift:1525-1532 — 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/Workspace/Workspace+State.swift:597` 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 (8 lines × 4) Sources/_InternalTestSupport/misc.swift:476— Sources/_InternalTestSupport/misc.swift:476-483 | Sources/_InternalTestSupport/misc.swift:498-505 | Sources/_InternalTestSupport/misc.swift:548-555 | Sources/_InternalTestSupport/misc.swift:570-577 — 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.
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 78) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:362— PackagePIFProjectBuilder.buildSourceModule has cyclomatic complexity 78 (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 62) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— PackagePIFProjectBuilder.makeMainModuleProduct has cyclomatic complexity 62 (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 61) Sources/PackageGraph/ModulesGraph+Loading.swift:380— ModulesGraph+Loading.swift.createResolvedPackages 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:913— 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 43) Sources/Build/BuildPlan/BuildPlan+Product.swift:121— BuildPlan.computeDependencies has cyclomatic complexity 43 (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:697— 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.
ModulesGraph+Loading.swift.handlePrebuilts (cyclomatic 40) Sources/PackageGraph/ModulesGraph+Loading.swift:909— ModulesGraph+Loading.swift.handlePrebuilts has cyclomatic complexity 40 (threshold 15). Of this number, 30 points are the body's own statements and 10 belong to 3 function items inside it that branch. 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.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 35) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:658— SwiftBuildSystem.startSWBuildOperation has cyclomatic complexity 35 (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.
PackageBuilder.constructProducts (cyclomatic 33) Sources/PackageLoading/PackageBuilder.swift:1631— 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.
PackagePIFProjectBuilder.buildLibraryProduct (cyclomatic 33) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:692— PackagePIFProjectBuilder.buildLibraryProduct has cyclomatic complexity 33 (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.
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:154— 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.
SwiftBuildSystemMessageHandler.emitEvent (cyclomatic 29) Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:226— SwiftBuildSystemMessageHandler.emitEvent has cyclomatic complexity 29 (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:1075— 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.
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.
ResolvedModule.computeAllBuildSettings (cyclomatic 25) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:720— ResolvedModule.computeAllBuildSettings 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.
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.chainModuleAliases (cyclomatic 23) Sources/PackageGraph/ModuleAliasTracker.swift:297— ModuleAliasTracker.chainModuleAliases 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.
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.
PackagePIFBuilder.build (cyclomatic 22) Sources/SwiftBuildSupport/PackagePIFBuilder.swift:484— PackagePIFBuilder.build has cyclomatic complexity 22 (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.
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.
BuildPlan.plan (cyclomatic 19) Sources/Build/BuildPlan/BuildPlan+Swift.swift:25— BuildPlan.plan 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.
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.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs (cyclomatic 18) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:218— LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs has cyclomatic complexity 18 (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.
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.
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:113— 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:1251— 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.
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:1520— 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:335— 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.
PluginDelegate.performTestsForPlugin (cyclomatic 16) Sources/Commands/Utilities/PluginDelegate.swift:214— PluginDelegate.performTestsForPlugin 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.
DefaultPluginScriptRunner.invoke (cyclomatic 16) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:452— DefaultPluginScriptRunner.invoke 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:1742— // 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 136) Sources/PackageGraph/ModulesGraph+Loading.swift:380— ModulesGraph+Loading.swift.createResolvedPackages has cognitive complexity 136 (threshold 15). Drivers by points: if/else 33 (87 pts), loops 11 (20 pts), boolean chains 12, match/switch 3 (9 pts), ternaries 3 (8 pts) (nesting depth added 74). 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 114) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift:362— PackagePIFProjectBuilder.buildSourceModule has cognitive complexity 114 (threshold 15). Drivers by points: if/else 51 (76 pts), ternaries 6 (14 pts), boolean chains 9, loops 6 (8 pts), match/switch 4 (7 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.
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.
PackagePIFProjectBuilder.makeMainModuleProduct (cognitive 103) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:42— PackagePIFProjectBuilder.makeMainModuleProduct has cognitive complexity 103 (threshold 15). Drivers by points: if/else 43 (73 pts), boolean chains 10, ternaries 3 (9 pts), loops 4 (8 pts), match/switch 2 (3 pts) (nesting depth added 41). 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.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.
ModulesGraph+Loading.swift.handlePrebuilts (cognitive 97) Sources/PackageGraph/ModulesGraph+Loading.swift:909— ModulesGraph+Loading.swift.handlePrebuilts has cognitive complexity 97 (threshold 15). Drivers by points: loops 17 (45 pts), if/else 15 (43 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 60). Of this number, 65 points are the body's own statements and 32 belong to 3 function items inside it that branch. 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.
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 74) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:658— SwiftBuildSystem.startSWBuildOperation has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 6 (17 pts), match/switch 4 (11 pts), error handling 4 (6 pts), boolean chains 1 (nesting depth added 44). 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.
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.
SwiftBuildSystem.makeBuildParameters (cognitive 55) Sources/SwiftBuildSupport/SwiftBuildSystem.swift:913— 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.
ResolvedModule.computeAllBuildSettings (cognitive 54) Sources/SwiftBuildSupport/PackagePIFBuilder+Helpers.swift:720— ResolvedModule.computeAllBuildSettings has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 4 (10 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 32). 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 54) Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift:692— PackagePIFProjectBuilder.buildLibraryProduct has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (35 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.
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.
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:697— 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.
PluginDelegate.performTestsForPlugin (cognitive 48) Sources/Commands/Utilities/PluginDelegate.swift:214— PluginDelegate.performTestsForPlugin has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 6 (14 pts), ternaries 2 (10 pts), boolean chains 1 (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.
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:1631— 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:335— 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.
BuildPlan.plan (cognitive 43) Sources/Build/BuildPlan/BuildPlan+Swift.swift:25— BuildPlan.plan has cognitive complexity 43 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 5 (17 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 29). 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.chainModuleAliases (cognitive 43) Sources/PackageGraph/ModuleAliasTracker.swift:297— ModuleAliasTracker.chainModuleAliases has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 21). 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:154— 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:982— 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.
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:1251— 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.
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.
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 4 (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:269— 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.
SwiftBuildSystemMessageHandler.emitEvent (cognitive 28) Sources/SwiftBuildSupport/SwiftBuildSystemMessageHandler.swift:226— SwiftBuildSystemMessageHandler.emitEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 1 (2 pts), boolean chains 1, match/switch 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.
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.
LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs (cognitive 25) Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift:218— LLBuildManifestBuilder.computeSwiftCompileCmdInputs::addStaticTargetInputs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (9 pts), boolean chains 4, 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. 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.
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:1581— 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.
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.
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.
ModuleAliasTracker.propagate (cognitive 24) Sources/PackageGraph/ModuleAliasTracker.swift:150— ModuleAliasTracker.propagate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (9 pts), boolean chains 3 (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.
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.
DefaultPluginScriptRunner.invoke (cognitive 24) Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift:452— DefaultPluginScriptRunner.invoke has cognitive complexity 24 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 7 (9 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._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.
ModuleAliasTracker.merge (cognitive 23) Sources/PackageGraph/ModuleAliasTracker.swift:205— ModuleAliasTracker.merge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 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.
BuildSettings.addSwiftVersionSettings (cognitive 23) Sources/XCBuildSupport/PIFBuilder.swift:1842— 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:1075— 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.
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:603— 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:540— 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.
ModuleAliasTracker.fillInRest (cognitive 17) Sources/PackageGraph/ModuleAliasTracker.swift:266— ModuleAliasTracker.fillInRest has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 3 (5 pts) (nesting depth added 10). 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:428— 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:200— 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:1099— 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.
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:380— FunctionTooLong — createResolvedPackages runs 324 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 224 over it, 3.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.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) Sources/PackageCollectionsSigning/CertificatePolicy.swift:36— Sources/PackageCollectionsSigning/CertificatePolicy.swift:36-47 | Sources/Workspace/ManifestSigning/CertificatePolicy.swift:36-47 — 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.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
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.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (13 members, 50+ identical tokens) Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:107— Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:107-131 | Sources/LLBuildManifest/Tools.swift:276-310 | Sources/PackageMetadata/PackageMetadata.swift:78-108 | Sources/PackageModel/Manifest/Manifest.swift:122-167 | Sources/PackageModel/Manifest/TargetDescription.swift:216-516 | Sources/Runtimes/PackageDescription/Target.swift:233-339 | Sources/SBOMModel/CycloneDX/CycloneDXComponent.swift:39-63 | Sources/SPMBuildCore/BuildParameters/BuildParameters.swift:176-272 | Sources/SwiftBuildSupport/PIFBuilder.swift:100-117 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:234-266 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:766-796 | Sources/Workspace/Workspace+Configuration.swift:1071-1107 | Sources/Workspace/Workspace.swift:669-717 — These 13 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 13 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 13 times.
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:519-551 — 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 (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 (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 217 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 (20–22 lines × 2) Sources/PackageRegistry/SignatureValidation.swift:176— Sources/PackageRegistry/SignatureValidation.swift:176-195 | Sources/PackageRegistry/SignatureValidation.swift:449-470 — 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 (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 217 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 (14–20 lines × 4) Sources/PackageRegistry/SignatureValidation.swift:186— Sources/PackageRegistry/SignatureValidation.swift:186-199 | Sources/PackageRegistry/SignatureValidation.swift:277-294 | Sources/PackageRegistry/SignatureValidation.swift:459-474 | Sources/PackageRegistry/SignatureValidation.swift:536-555 — 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/PackageRegistry/SignatureValidation.swift:186` 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 (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 — 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/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:570— Sources/PackageLoading/ManifestJSONParser.swift:570-586 | 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 × 9) Sources/LLBuildManifest/Tools.swift:299— Sources/LLBuildManifest/Tools.swift:299-310 | Sources/PackageMetadata/PackageMetadata.swift:97-108 | Sources/PackageModel/Manifest/TargetDescription.swift:505-516 | Sources/SPMBuildCore/BuildParameters/BuildParameters.swift:261-272 | Sources/SwiftBuildSupport/PIFBuilder.swift:106-117 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:255-266 | Sources/SwiftBuildSupport/PackagePIFBuilder.swift:785-796 | Sources/Workspace/Workspace+Configuration.swift:1096-1107 | Sources/Workspace/Workspace.swift:702-717 — there are 9 copies across 8 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 9 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/Tools.swift:299` 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 (12 lines × 6) Sources/LLBuildManifest/Tools.swift:293— Sources/LLBuildManifest/Tools.swift:293-304 | Sources/PackageMetadata/PackageMetadata.swift:93-104 | Sources/PackageModel/Manifest/Manifest.swift:144-155 | Sources/Runtimes/PackageDescription/Target.swift:254-265 | Sources/Workspace/Workspace+Configuration.swift:1089-1100 | Sources/Workspace/Workspace.swift:690-703 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/LLBuildManifest/Tools.swift:293` 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 (12 lines × 3) Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119— Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119-130 | Sources/Runtimes/PackageDescription/Target.swift:254-265 | Sources/SBOMModel/CycloneDX/CycloneDXComponent.swift:51-62 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/package-registry/Sources/RegistryExample/Models/StoredRelease.swift:119` 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–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 (9–11 lines × 4) Sources/Basics/Archiver/TarArchiver.swift:77— Sources/Basics/Archiver/TarArchiver.swift:77-87 | Sources/Basics/Archiver/TarArchiver.swift:133-141 | Sources/Basics/Archiver/ZipArchiver.swift:64-73 | Sources/Basics/Archiver/ZipArchiver.swift:138-146 — before extracting anything, compare `Sources/Basics/Archiver/TarArchiver.swift` and `Sources/Basics/Archiver/ZipArchiver.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Basics/Archiver/TarArchiver.swift:77` 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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping @Sendable (Result<Void, Error>) -> Void` in one and `@escaping @Sendable (Result<Bool, Error>) -> Void` 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 (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 (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 (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:709— Sources/SwiftBuildSupport/PackagePIFBuilder.swift:709-717 | 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 (4–7 lines × 4) Sources/Runtimes/PackagePlugin/Plugin.swift:157— Sources/Runtimes/PackagePlugin/Plugin.swift:157-160 | Sources/Runtimes/PackagePlugin/Plugin.swift:264-267 | Sources/Runtimes/PackagePlugin/Plugin.swift:324-330 | Sources/Runtimes/PackagePlugin/Plugin.swift:376-382 — 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/Runtimes/PackagePlugin/Plugin.swift:324` 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 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 .performCommand(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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Runtimes/PackagePlugin/Plugin.swift:155` calls `PluginContextDeserializer`, `package`, `url` and `Sources/Runtimes/PackagePlugin/Plugin.swift:324` 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 (6 lines × 3) Sources/PackageModel/ManifestSourceGeneration.swift:88— Sources/PackageModel/ManifestSourceGeneration.swift:88-93 | Sources/PackageModel/ManifestSourceGeneration.swift:376-381 | Sources/PackageModel/ManifestSourceGeneration.swift:397-402 — 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/PackageModel/ManifestSourceGeneration.swift:88` 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/ManifestSourceGeneration.swift:405` calls `SourceCodeFragment` and `Sources/PackageModel/ManifestSourceGeneration.swift:95` 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 (5 lines × 6) Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:469— Sources/PackageCollectionsModel/PackageCollectionModel+v1.swift:469-473 | Sources/PackageModel/Manifest/ProductDescription.swift:263-267 | Sources/PackageModel/Manifest/SystemPackageProviderDescription.swift:49-53 | Sources/PackageModel/Manifest/TargetDescription.swift:545-549 | Sources/PackageModel/Manifest/TargetDescription.swift:595-599 | Sources/PackageModel/Manifest/TargetDescription.swift:627-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:469` 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 × 3) Sources/PackageGraph/ResolvedPackagesStore.swift:216— Sources/PackageGraph/ResolvedPackagesStore.swift:216-220 | Sources/PackageGraph/ResolvedPackagesStore.swift:229-233 | Sources/PackageGraph/ResolvedPackagesStore.swift:242-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: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.
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.
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 (26 lines × 2) Sources/_InternalTestSupport/MockPackageGraphs.swift:37— Sources/_InternalTestSupport/MockPackageGraphs.swift:37-62 | Sources/_InternalTestSupport/MockPackageGraphs.swift:144-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/MockPackageGraphs.swift:37` 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–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 (7 lines × 4) Sources/_InternalTestSupport/misc.swift:499— Sources/_InternalTestSupport/misc.swift:499-505 | Sources/_InternalTestSupport/misc.swift:524-530 | Sources/_InternalTestSupport/misc.swift:549-555 | Sources/_InternalTestSupport/misc.swift:571-577 — 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/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/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/SwiftBuildSupport/PIF.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/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.
Orphaned file Sources/Workspace/Workspace+Editing.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/SQLiteBackedCache.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, 4 significant file(s) lose their only recent owner: Sources/SwiftBuildSupport/TraceEventsWriter.swift, Sources/Basics/FileSystem/RelativePath.swift, Sources/SwiftBuildSupport/PIFGenerationInputs.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 (14 single-owned of 403 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; 403 of the 581 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/PackageGraph/ModuleAliasTracker.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.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
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)` (140249 LoC, 1723 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.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 162 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/PackageCollections/PackageIndexAndCollections.swift (and 154 more) (173 orphaned of 403 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; 403 of the 581 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.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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:275— 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:317— 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:364— 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:341— 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:388— 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:790— 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:1104— 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): swiftDriverRawOutputGetsNewlines Tests/CommandsTests/BuildCommandTests.swift:1488— 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:1529— 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:1642— 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:1852— 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:1918— 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:2055— 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:2129— 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:3655— 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:3686— 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): describeJson Tests/CommandsTests/PackageCommandTests.swift:1081— 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): migrateCommandWithBuildToolPlugins Tests/CommandsTests/PackageCommandTests.swift:4810— 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: 138 declaration(s) across 340 `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 196 file(s) — `Examples/package-registry/Sources/RegistryExample/Routes/MetadataRoutes.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroClient/main.swift`, `Fixtures/CFamilyTargets/MixedSourceMacro/Sources/MacroDef/MacroDef.swift`, `Fixtures/Macros/MacroPackage/Sources/MacroClient/client.swift`, `Fixtures/Macros/MacroPackage/Sources/MacroDef/definition.swift`, … (+191 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 01a177ee-c329-7a61-8ca9-945d48ba734c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 87 · Warnings: 1720 · Recommendations: 324 · Info: 183 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 11:18 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.