Public report of swiftlang/swift-build, published 29 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). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 29 October 2026, 09:25 UTC · Survey ID cd_bb692fdac93c40a4a6ceb05291043aec
swiftlang/swift-build
Measured 29 October 2026, 09:22 UTC, at code version 0126b77
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.
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: 148,839 lines of product code in 53 projects, tests not counted · Estimated rebuild effort: about 2.6 person-years · Weakest lens: Production Readiness, 53
Findings by how serious they are
25 critical2170 serious1209 minor
36 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
29 October 2026, 09:22 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 ▸
41of 41 dimensions measured by tools.
3385of 3404 findings point to an exact file and line, so you can open each one in the code. The other 19 concern the repository as a whole, such as missing documentation.
41dimensions across 6 lenses, read from 148,839 lines of product code in 53 projects.
swiftlang/swift-build falls short of our standard for production, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 61 out of 100 and is rated Adequate, and ten of its 25 critical findings are security problems in the build pipeline and in its automatic dependency updates.
Production Readiness, at 53, is the weakest lens and counts most in the score. The best first step for the work it takes is recording design decisions, worth about 5 points. Documenting the recovery plan would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 70 would lift the score to about 66.
Nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. One automatic update takes new releases before a bad one can be spotted, and fourteen parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, setting a waiting period for automatic updates and having someone learn the forgotten files would close these risks. The test that checks nothing needs to check the result it produces.
The product code is 148,839 lines, about €370,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.
Exception handling · Swallowed exception (caught, then discarded) Sources/SwiftBuild/SWBBuildServiceConnection.swift
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: 10 findings
These 10 critical or serious findings were in the previous survey, on 15 October 2026, and are gone from this one.
Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) Sources/SWBCore/BuildRuleAction.swift
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/SWBAndroidPlatform/Plugin.swift
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/SWBBuildService/BuildDescriptionMessages.swift
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/SWBTestSupport/BuildOperationTester.swift
€120,000 to €620,000, for 2,060 to 6,535 hours of work, about 2.6 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.8 at a score of 61. 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: 148,839 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 5 points · Low effort · ADR Quality
2
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with ServiceCoreTests.swift.
Raises the score by about 3 points · Low effort · Test Quality
3
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Raises the score by about 6 points · Medium effort · DR & Backup
Diagnosis: what the measurements show together
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 €370,000 to build again, about 2.6 person-years of work. Its weakest lens is Production Readiness, at 53 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
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 5 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 6.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 22,076 lines over the last 90 days, which is about 89,530 lines a year. At that pace, the extra work comes to an estimated 9.2 to 55.1 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.
33 modules, with 156 dependencies between them. One loop runs through 20 of the modules, marked above the diagonal.
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.
Uses a module listed above itPart of a loopThe module itself
11→18 SWBApplePlatform uses SWBTaskConstructionpart of a loop✕
Connections
44 pairs of types, where a type in SWBApplePlatform uses a type in SWBTaskConstruction. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBApplePlatform uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBApplePlatform, while a change to SWBApplePlatform can't break SWBTaskConstruction.
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 SWBApplePlatform uses SWBProjectModelpart of a loop✕
Connections
3 pairs of types, where a type in SWBApplePlatform uses a type in SWBProjectModel.
SWBApplePlatform uses SWBProjectModel, so a change to SWBProjectModel can break SWBApplePlatform, while a change to SWBApplePlatform can't break SWBProjectModel.
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→20 SWBApplePlatform uses SWBMacropart of a loop✕
Connections
21 pairs of types, where a type in SWBApplePlatform uses a type in SWBMacro.
SWBApplePlatform uses SWBMacro, so a change to SWBMacro can break SWBApplePlatform, while a change to SWBApplePlatform can't break SWBMacro.
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 SWBApplePlatform uses SWBUtilpart of a loop✕
Connections
85 pairs of types, where a type in SWBApplePlatform uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBApplePlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBApplePlatform, while a change to SWBApplePlatform can't break SWBTaskExecution.
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→27 SWBApplePlatform uses SWBAndroidPlatformpart of a loop✕
Connections
1 pair of types, where a type in SWBApplePlatform uses a type in SWBAndroidPlatform.
SWBApplePlatform uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBApplePlatform, while a change to SWBApplePlatform can't break SWBAndroidPlatform.
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→28 SWBApplePlatform uses SWBCorepart of a loop✕
Connections
212 pairs of types, where a type in SWBApplePlatform uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBServiceCore uses SWBBuildService, so a change to SWBBuildService can break SWBServiceCore, while a change to SWBServiceCore can't break SWBBuildService.
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→26 SWBServiceCore uses SWBTaskExecutionpart of a loop✕
Connections
1 pair of types, where a type in SWBServiceCore uses a type in SWBTaskExecution.
SWBServiceCore uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBServiceCore, while a change to SWBServiceCore can't break SWBTaskExecution.
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→27 SWBServiceCore uses SWBAndroidPlatformpart of a loop✕
Connections
1 pair of types, where a type in SWBServiceCore uses a type in SWBAndroidPlatform.
SWBServiceCore uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBServiceCore, while a change to SWBServiceCore can't break SWBAndroidPlatform.
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.
SWBUniversalPlatform uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBUniversalPlatform, while a change to SWBUniversalPlatform can't break SWBTaskConstruction.
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→20 SWBUniversalPlatform uses SWBMacropart of a loop✕
Connections
4 pairs of types, where a type in SWBUniversalPlatform uses a type in SWBMacro.
SWBUniversalPlatform uses SWBMacro, so a change to SWBMacro can break SWBUniversalPlatform, while a change to SWBUniversalPlatform can't break SWBMacro.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
13→21 SWBUniversalPlatform uses SWBUtilpart of a loop✕
Connections
13 pairs of types, where a type in SWBUniversalPlatform uses a type in SWBUtil.
SWBUniversalPlatform uses SWBBuildService, so a change to SWBBuildService can break SWBUniversalPlatform, while a change to SWBUniversalPlatform can't break SWBBuildService.
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→26 SWBUniversalPlatform uses SWBTaskExecutionpart of a loop✕
Connections
8 pairs of types, where a type in SWBUniversalPlatform uses a type in SWBTaskExecution.
SWBUniversalPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBUniversalPlatform, while a change to SWBUniversalPlatform can't break SWBTaskExecution.
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→28 SWBUniversalPlatform uses SWBCorepart of a loop✕
Connections
35 pairs of types, where a type in SWBUniversalPlatform uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBWindowsPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBWindowsPlatform, while a change to SWBWindowsPlatform can't break SWBTaskExecution.
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→28 SWBWindowsPlatform uses SWBCorepart of a loop✕
Connections
11 pairs of types, where a type in SWBWindowsPlatform uses a type in SWBCore.
84 pairs of types, where a type in SwiftBuild uses a type in SWBProtocol. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
147 pairs of types, where a type in SwiftBuild uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuild uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SwiftBuild, while a change to SwiftBuild can't break SWBAndroidPlatform.
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.
142 pairs of types, where a type in SwiftBuild uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuild uses MockToolchainCASPlugin, so a change to MockToolchainCASPlugin can break SwiftBuild, while a change to SwiftBuild can't break MockToolchainCASPlugin.
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.
SWBTestSupport uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBTestSupport, while a change to SWBTestSupport can't break SWBTaskConstruction.
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 SWBTestSupport uses SWBProjectModelpart of a loop✕
Connections
24 pairs of types, where a type in SWBTestSupport uses a type in SWBProjectModel.
SWBTestSupport uses SWBProjectModel, so a change to SWBProjectModel can break SWBTestSupport, while a change to SWBTestSupport can't break SWBProjectModel.
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.
212 pairs of types, where a type in SWBTestSupport uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTestSupport uses SWBBuildSystem, so a change to SWBBuildSystem can break SWBTestSupport, while a change to SWBTestSupport can't break SWBBuildSystem.
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 SWBTestSupport uses SWBBuildServicepart of a loop✕
Connections
5 pairs of types, where a type in SWBTestSupport uses a type in SWBBuildService.
SWBTestSupport uses SWBBuildService, so a change to SWBBuildService can break SWBTestSupport, while a change to SWBTestSupport can't break SWBBuildService.
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→26 SWBTestSupport uses SWBTaskExecutionpart of a loop✕
Connections
14 pairs of types, where a type in SWBTestSupport uses a type in SWBTaskExecution.
SWBTestSupport uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBTestSupport, while a change to SWBTestSupport can't break SWBTaskExecution.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→27 SWBTestSupport uses SWBAndroidPlatformpart of a loop✕
Connections
4 pairs of types, where a type in SWBTestSupport uses a type in SWBAndroidPlatform.
SWBTestSupport uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBTestSupport, while a change to SWBTestSupport can't break SWBAndroidPlatform.
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.
321 pairs of types, where a type in SWBTestSupport uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTestSupport uses MockToolchainCASPlugin, so a change to MockToolchainCASPlugin can break SWBTestSupport, while a change to SWBTestSupport can't break MockToolchainCASPlugin.
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.
SWBProtocol uses SWBTestSupport, so a change to SWBTestSupport can break SWBProtocol, while a change to SWBProtocol can't break SWBTestSupport.
Position
Below the diagonal: SWBProtocol uses a module listed above it, which is the healthy direction.
17→19 SWBProtocol uses SWBProjectModelpart of a loop✕
Connections
30 pairs of types, where a type in SWBProtocol uses a type in SWBProjectModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
436 pairs of types, where a type in SWBProtocol uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBProtocol uses SWBBuildService, so a change to SWBBuildService can break SWBProtocol, while a change to SWBProtocol can't break SWBBuildService.
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→27 SWBProtocol uses SWBAndroidPlatformpart of a loop✕
Connections
1 pair of types, where a type in SWBProtocol uses a type in SWBAndroidPlatform.
The types involved
SWBProtocol.EOFError → SWBAndroidPlatform.Error
Direction
SWBProtocol uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBProtocol, while a change to SWBProtocol can't break SWBAndroidPlatform.
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.
255 pairs of types, where a type in SWBProtocol uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBApplePlatform, so a change to SWBApplePlatform can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBApplePlatform.
Position
Below the diagonal: SWBTaskConstruction uses a module listed above it, which is the healthy direction.
SWBTaskConstruction uses SWBUniversalPlatform, so a change to SWBUniversalPlatform can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBUniversalPlatform.
Position
Below the diagonal: SWBTaskConstruction uses a module listed above it, which is the healthy direction.
SWBTaskConstruction uses SWBTestSupport, so a change to SWBTestSupport can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBTestSupport.
Position
Below the diagonal: SWBTaskConstruction uses a module listed above it, which is the healthy direction.
SWBTaskConstruction uses SWBProtocol, so a change to SWBProtocol can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBProtocol.
Position
Below the diagonal: SWBTaskConstruction uses a module listed above it, which is the healthy direction.
18→19 SWBTaskConstruction uses SWBProjectModelpart of a loop✕
Connections
20 pairs of types, where a type in SWBTaskConstruction uses a type in SWBProjectModel.
SWBTaskConstruction uses SWBProjectModel, so a change to SWBProjectModel can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBProjectModel.
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.
18→20 SWBTaskConstruction uses SWBMacropart of a loop✕
Connections
34 pairs of types, where a type in SWBTaskConstruction uses a type in SWBMacro. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBMacro, so a change to SWBMacro can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBMacro.
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.
18→21 SWBTaskConstruction uses SWBUtilpart of a loop✕
Connections
133 pairs of types, where a type in SWBTaskConstruction uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBBuildService, so a change to SWBBuildService can break SWBTaskConstruction, while a change to SWBTaskConstruction can't break SWBBuildService.
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.
18→28 SWBTaskConstruction uses SWBCorepart of a loop✕
Connections
336 pairs of types, where a type in SWBTaskConstruction uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBProjectModel uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBProjectModel, while a change to SWBProjectModel can't break SWBTaskConstruction.
Position
Below the diagonal: SWBProjectModel uses a module listed above it, which is the healthy direction.
19→20 SWBProjectModel uses SWBMacropart of a loop✕
Connections
2 pairs of types, where a type in SWBProjectModel uses a type in SWBMacro.
67 pairs of types, where a type in SWBProjectModel uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBProjectModel uses SWBUtil, so a change to SWBUtil can break SWBProjectModel, while a change to SWBProjectModel can't break SWBUtil.
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.
19→27 SWBProjectModel uses SWBAndroidPlatformpart of a loop✕
Connections
1 pair of types, where a type in SWBProjectModel uses a type in SWBAndroidPlatform.
The types involved
SWBProjectModel.Error → SWBAndroidPlatform.Error
Direction
SWBProjectModel uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBProjectModel, while a change to SWBProjectModel can't break SWBAndroidPlatform.
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.
42 pairs of types, where a type in SWBProjectModel uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildSystem uses SWBServiceCore, so a change to SWBServiceCore can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBServiceCore.
Position
Below the diagonal: SWBBuildSystem uses a module listed above it, which is the healthy direction.
SWBBuildSystem uses SWBTestSupport, so a change to SWBTestSupport can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBTestSupport.
Position
Below the diagonal: SWBBuildSystem uses a module listed above it, which is the healthy direction.
SWBBuildSystem uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBTaskConstruction.
Position
Below the diagonal: SWBBuildSystem uses a module listed above it, which is the healthy direction.
SWBBuildSystem uses SWBProjectModel, so a change to SWBProjectModel can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBProjectModel.
Position
Below the diagonal: SWBBuildSystem uses a module listed above it, which is the healthy direction.
53 pairs of types, where a type in SWBBuildSystem uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildSystem uses SWBBuildService, so a change to SWBBuildService can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBBuildService.
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.
24→26 SWBBuildSystem uses SWBTaskExecutionpart of a loop✕
Connections
21 pairs of types, where a type in SWBBuildSystem uses a type in SWBTaskExecution.
SWBBuildSystem uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBBuildSystem, while a change to SWBBuildSystem can't break SWBTaskExecution.
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.
82 pairs of types, where a type in SWBBuildSystem uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
145 pairs of types, where a type in SWBBuildService uses a type in SWBServiceCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildService uses SWBServiceCore, so a change to SWBServiceCore can break SWBBuildService, while a change to SWBBuildService can't break SWBServiceCore.
Position
Below the diagonal: SWBBuildService uses a module listed above it, which is the healthy direction.
138 pairs of types, where a type in SWBBuildService uses a type in SWBProtocol. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildService uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBBuildService, while a change to SWBBuildService can't break SWBTaskConstruction.
Position
Below the diagonal: SWBBuildService uses a module listed above it, which is the healthy direction.
SWBBuildService uses SWBProjectModel, so a change to SWBProjectModel can break SWBBuildService, while a change to SWBBuildService can't break SWBProjectModel.
Position
Below the diagonal: SWBBuildService uses a module listed above it, which is the healthy direction.
130 pairs of types, where a type in SWBBuildService uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildService uses SWBBuildSystem, so a change to SWBBuildSystem can break SWBBuildService, while a change to SWBBuildService can't break SWBBuildSystem.
Position
Below the diagonal: SWBBuildService uses a module listed above it, which is the healthy direction.
25→26 SWBBuildService uses SWBTaskExecutionpart of a loop✕
Connections
16 pairs of types, where a type in SWBBuildService uses a type in SWBTaskExecution.
SWBBuildService uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBBuildService, while a change to SWBBuildService can't break SWBTaskExecution.
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.
25→27 SWBBuildService uses SWBAndroidPlatformpart of a loop✕
Connections
13 pairs of types, where a type in SWBBuildService uses a type in SWBAndroidPlatform.
SWBBuildService uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBBuildService, while a change to SWBBuildService can't break SWBAndroidPlatform.
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.
178 pairs of types, where a type in SWBBuildService uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildService uses MockToolchainCASPlugin, so a change to MockToolchainCASPlugin can break SWBBuildService, while a change to SWBBuildService can't break MockToolchainCASPlugin.
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.
SWBTaskExecution uses SWBTestSupport, so a change to SWBTestSupport can break SWBTaskExecution, while a change to SWBTaskExecution can't break SWBTestSupport.
Position
Below the diagonal: SWBTaskExecution uses a module listed above it, which is the healthy direction.
SWBTaskExecution uses SWBTaskConstruction, so a change to SWBTaskConstruction can break SWBTaskExecution, while a change to SWBTaskExecution can't break SWBTaskConstruction.
Position
Below the diagonal: SWBTaskExecution uses a module listed above it, which is the healthy direction.
215 pairs of types, where a type in SWBTaskExecution uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskExecution uses SWBBuildService, so a change to SWBBuildService can break SWBTaskExecution, while a change to SWBTaskExecution can't break SWBBuildService.
Position
Below the diagonal: SWBTaskExecution uses a module listed above it, which is the healthy direction.
26→27 SWBTaskExecution uses SWBAndroidPlatformpart of a loop✕
Connections
1 pair of types, where a type in SWBTaskExecution uses a type in SWBAndroidPlatform.
The types involved
SWBTaskExecution.Error → SWBAndroidPlatform.Error
Direction
SWBTaskExecution uses SWBAndroidPlatform, so a change to SWBAndroidPlatform can break SWBTaskExecution, while a change to SWBTaskExecution can't break SWBAndroidPlatform.
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.
26→28 SWBTaskExecution uses SWBCorepart of a loop✕
Connections
268 pairs of types, where a type in SWBTaskExecution uses a type in SWBCore. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskExecution uses MockToolchainCASPlugin, so a change to MockToolchainCASPlugin can break SWBTaskExecution, while a change to SWBTaskExecution can't break MockToolchainCASPlugin.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29 pairs of types, where a type in SWBAndroidPlatform uses a type in SWBUtil. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBAndroidPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBAndroidPlatform, while a change to SWBAndroidPlatform can't break SWBTaskExecution.
Position
Below the diagonal: SWBAndroidPlatform uses a module listed above it, which is the healthy direction.
27→28 SWBAndroidPlatform uses SWBCorepart of a loop✕
Connections
17 pairs of types, where a type in SWBAndroidPlatform uses a type in SWBCore.
34 pairs of types, where a type in SWBCore uses a type in SWBProtocol. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
79 pairs of types, where a type in SWBCore uses a type in SWBProjectModel. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBGenericUnixPlatform uses SWBUtil, so a change to SWBUtil can break SWBGenericUnixPlatform, while a change to SWBGenericUnixPlatform can't break SWBUtil.
Position
Below the diagonal: SWBGenericUnixPlatform uses a module listed above it, which is the healthy direction.
SWBGenericUnixPlatform uses SWBBuildService, so a change to SWBBuildService can break SWBGenericUnixPlatform, while a change to SWBGenericUnixPlatform can't break SWBBuildService.
Position
Below the diagonal: SWBGenericUnixPlatform uses a module listed above it, which is the healthy direction.
SWBGenericUnixPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBGenericUnixPlatform, while a change to SWBGenericUnixPlatform can't break SWBTaskExecution.
Position
Below the diagonal: SWBGenericUnixPlatform uses a module listed above it, which is the healthy direction.
SWBGenericUnixPlatform uses SWBCore, so a change to SWBCore can break SWBGenericUnixPlatform, while a change to SWBGenericUnixPlatform can't break SWBCore.
Position
Below the diagonal: SWBGenericUnixPlatform uses a module listed above it, which is the healthy direction.
SWBMockCASPluginSupport uses SWBUtil, so a change to SWBUtil can break SWBMockCASPluginSupport, while a change to SWBMockCASPluginSupport can't break SWBUtil.
Position
Below the diagonal: SWBMockCASPluginSupport uses a module listed above it, which is the healthy direction.
SWBMockCASPluginSupport uses SWBCore, so a change to SWBCore can break SWBMockCASPluginSupport, while a change to SWBMockCASPluginSupport can't break SWBCore.
Position
Below the diagonal: SWBMockCASPluginSupport uses a module listed above it, which is the healthy direction.
SWBQNXPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBQNXPlatform, while a change to SWBQNXPlatform can't break SWBTaskExecution.
Position
Below the diagonal: SWBQNXPlatform uses a module listed above it, which is the healthy direction.
SWBWebAssemblyPlatform uses SWBUtil, so a change to SWBUtil can break SWBWebAssemblyPlatform, while a change to SWBWebAssemblyPlatform can't break SWBUtil.
Position
Below the diagonal: SWBWebAssemblyPlatform uses a module listed above it, which is the healthy direction.
SWBWebAssemblyPlatform uses SWBTaskExecution, so a change to SWBTaskExecution can break SWBWebAssemblyPlatform, while a change to SWBWebAssemblyPlatform can't break SWBTaskExecution.
Position
Below the diagonal: SWBWebAssemblyPlatform uses a module listed above it, which is the healthy direction.
SWBWebAssemblyPlatform uses SWBCore, so a change to SWBCore can break SWBWebAssemblyPlatform, while a change to SWBWebAssemblyPlatform can't break SWBCore.
Position
Below the diagonal: SWBWebAssemblyPlatform uses a module listed above it, which is the healthy direction.
MockToolchainCASPlugin uses SWBTestSupport, so a change to SWBTestSupport can break MockToolchainCASPlugin, while a change to MockToolchainCASPlugin can't break SWBTestSupport.
Position
Below the diagonal: MockToolchainCASPlugin uses a module listed above it, which is the healthy direction.
MockToolchainCASPlugin uses SWBMacro, so a change to SWBMacro can break MockToolchainCASPlugin, while a change to MockToolchainCASPlugin can't break SWBMacro.
Position
Below the diagonal: MockToolchainCASPlugin uses a module listed above it, which is the healthy direction.
MockToolchainCASPlugin uses SWBUtil, so a change to SWBUtil can break MockToolchainCASPlugin, while a change to MockToolchainCASPlugin can't break SWBUtil.
Position
Below the diagonal: MockToolchainCASPlugin uses a module listed above it, which is the healthy direction.
MockToolchainCASPlugin uses SWBCore, so a change to SWBCore can break MockToolchainCASPlugin, while a change to MockToolchainCASPlugin can't break SWBCore.
Position
Below the diagonal: MockToolchainCASPlugin uses a module listed above it, which is the healthy direction.
MockToolchainCASPlugin uses SWBMockCASPluginSupport, so a change to SWBMockCASPluginSupport can break MockToolchainCASPlugin, while a change to MockToolchainCASPlugin can't break SWBMockCASPluginSupport.
Position
Below the diagonal: MockToolchainCASPlugin uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 70% · Adequate · gated by D2 ·
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
A05:2025 — Injection
10
High / Critical
A02:2025 — Security Misconfiguration
1
Medium
Roadmap
First, codify backups and geo-recovery in infrastructure as code while documenting RTO, RPO, and restore procedures to ensure true disaster resilience. Next, address the lack of architectural decision records by documenting key design choices and resolving empty test assertions in ServiceCoreTests. Finally, clean up the codebase by removing 207 orphaned files, starting with BuildRule.swift, Project.swift, and BuildFile.swift.
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.
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.
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.
Resolve the 14 Orphaned knowledge finding(s) in Knowledge Freshness — start with TaskConstructionTester.swift, MacroExpressionParsing.swift, DiagnosticsEngine.swift.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 25
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 — 2170
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 — 1209
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 36
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. 41 of 41 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — 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 — 41 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, 3385 of 3404 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D11 Test Reliability — 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. Test source is present (.swift) and this repository declares a SwiftPM test suite (2 packages), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
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 — 12 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 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. 1 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: swift-tools-protocols.
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. `Plugins/generate-windows-installer-component-groups/generate-windows-installer-component-groups.swift`, `Plugins/run-xcodebuild/run-xcodebuild.swift`, `Sources/SWBAndroidPlatform/Plugin.swift`, `Sources/SWBApplePlatform/AssetCatalogCompiler.swift`, `Sources/SWBApplePlatform/RealityAssetsCompilerSpec.swift`, … (+130 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 Dockerfile) is simply not read here yet.
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 15 — the compose project is invalid) — time="2026-10-29T09:23:00Z" level=warning msg="The \"WORKSPACE_DIR\" variable is not set. Defaulting to a blank string." time="2026-10-29T09:23:00Z" level=warning msg="The \"WORKSPACE_DIR\" variable is not set. Defaulting to a blank string." invalid spec: ::rw: empty section between colons; 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.
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 Swift, c, cpp 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 Swift, c, cpp 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.
P8 Schema migrations — 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 EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, 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.
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.
X1 Async 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, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust 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.
X12 Unreachable branch — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X13 Undrained process stream — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X15 Unvalidated length from an untrusted reader — 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, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart 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.
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.
X17 Uncapped recursion over a caller-supplied document — 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, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X19 Unrestored process-global state — 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, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, 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 JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust 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.
X22 Contradicted release guard — 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 Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's C, C++, 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.
X23 Unguarded diagnostic materialisation — 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, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin 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.
X24 Document value interpolated into markup unescaped — 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, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python 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.
X25 Inert configuration knob — 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, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby 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.
X27 Collection changed while being enumerated — 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 Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's C, C++, Swift (Foundation mutable collections) 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.
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.
X30 Support guard that admits what it rejects — 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 Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — 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, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust 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, Cpp, 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.
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.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality 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.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
156 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SourcesTaskProducer.generateTasks at 163. A further 9 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 SwiftBuildMessage.encode at 28 — they are counted neither in the figure above nor in this dimension's score. 5 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift (SwiftBuildMessage.encode at 28), Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift (FileReference.fileTypeIdentifier at 23), Sources/SWBUtil/PropertyList.swift (PropertyListItem.== at 19), Sources/SWBProjectModel/PIFGenerationModel.swift (Array.toPlatformFilter at 16), Sources/SWBTestSupport/AssertMatch.swift (AssertMatch.swift.~= at 16). 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.
+ 149 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 Cyclomatic Complexity — start with SourcesTaskProducer.generateTasks (cyclomatic 163). — Refactoring it lifts Cyclomatic Complexity from 5.5 to about 5.8/10.
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.
+ 276 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 240 down to 240 or less in Cognitive Complexity — start with SourcesTaskProducer.generateTasks (cognitive 443), SourcesTaskProducer.computeLibraries (cognitive 306). — 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 2 together lifts Cognitive Complexity from 2.4 to about 3.4/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
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.2 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 37 MethodTooLong finding(s) in God Classes — start with Settings.swift (5), SourcesTaskProducer.swift (2), InfoPlistProcessorTaskAction.swift (2). — One of this dimension's main actionable groups (37 warning-level).
Resolve the 28 FileTooLong finding(s) in God Classes — start with BuildOperationMessages.swift (2), Settings.swift, BuildOperation.swift. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 14 TooManyMethods finding(s) in God Classes — start with FSProxy.swift (2), TaskProducer.swift, CapturingTaskGenerationDelegate.swift. — One of this dimension's main actionable groups (14 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.
246 duplicated block group(s) detected. A further 20 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 30 of the 266 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.
+ 89 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 24 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with Plugin.swift (2), PIFGenerationModel.swift (2), ClangCachingMaterializeKeyTaskAction.swift (2). — One of this dimension's main actionable groups (24 warning-level).
Resolve the 20 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with InterfaceBuilderCompiler.swift, MetalCompiler.swift, Messages.swift. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 20 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with MachO.swift (2), TaskGeneration.swift, XCFramework.swift. — One of this dimension's main actionable groups (20 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.0 / 10Stronggated by 6 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.
53 production modules (SwiftPM+CMake), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence, with abstractness counted on 26 of the 53 (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: SWBLLBuild (SwiftPM) · ×4
Unstable project SWBApplePlatform (CMake)
Unstable project SWBUniversalPlatform (CMake)
What to do
Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Unstable project SWBApplePlatform (CMake) finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project SWBUniversalPlatform (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 46 Low cohesion finding(s) in Cohesion (LCOM4) — start with CCompiler.swift (4), ProductTypes.swift (2), FSProxy.swift (2). — One of this dimension's main actionable groups (46 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?
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.
3011 test methods: 3004 unit, 7 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.0 / 10Adequategated by 1 critical finding✓ 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.
28 skipped (24 with a documented reason), 1137 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3011 tests (6 harness-style project(s) excluded from the assertion penalty).
No assertions (empty test): basicsTests/SWBServiceCoreTests/ServiceCoreTests.swift:16
No assertions: androidPlatformFilterIsActive · ×193Tests/SWBAndroidPlatformTests/SWBAndroidPlatformTests.swift:147
Test project verifies nothing: SWBServiceCoreTests · ×2Tests/SWBServiceCoreTests/ServiceCoreTests.swift:16
No direct assertions: testDynamicTaskScaling · ×943Tests/SWBBuildSystemPerfTests/ClangExplicitModulesPerfTests.swift:23
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with ServiceCoreTests.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 193 No assertions finding(s) in Test Quality — start with XCFrameworkTests.swift (25), MacroParsingTests.swift (20), MultiPlatformDependencyResolverTests.swift (15). — One of this dimension's main actionable groups (193 warning-level).
Resolve the 4 Skipped test finding(s) in Test Quality — start with BuildCommandTests.swift, BuildOperationTests.swift, PackageBuildOperationTests.swift. — One of this dimension's main actionable groups (4 warning-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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 5 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 5 — 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. 6 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. ★ 1 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: `swift-tools-protocols`.
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 24 Hotspot finding(s) in Churn × Complexity Hotspots — start with SwiftCompiler.swift, Settings.swift, SourcesTaskProducer.swift. — One of this dimension's main actionable groups (24 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.0 / 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.
50 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/SWBCore/XCFramework.swift. Counted over 501 of the 665 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 · ×5
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.
Do you agree with this assessment?
D17 · Explicit Debt8.6 / 10Strong✓ Tool-verified
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.
1084 deducted task-comment markers across 148839 LoC (0.7/KLoC) → score 8.6. 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.
FixmeComment repeated across 18 filesSources/SWBCore/SpecImplementations/LinkerSpec.swift:161
What to do
Resolve the 958 FixmeComment finding(s) in Explicit Debt — start with Settings.swift (77), BuildOperationTests.swift (31), CCompiler.swift (29). — One of this dimension's main actionable groups (958 warning-level).
Resolve the 102 TodoComment finding(s) in Explicit Debt — start with SDKRegistry.swift (5), Messages.swift (4), SwiftCompiler.swift (4). — One of this dimension's main actionable groups (102 warning-level).
Resolve the 6 HackComment finding(s) in Explicit Debt — start with Plugin.swift (2), BuildLogTests.swift, ClangCompilationCachingTests.swift. — One of this dimension's main actionable groups (6 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 1 build units (SwiftPM) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
10 finding(s): 0 critical, 10 high, 0 medium, 0 low. 9 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 5 file(s) — `Sources/SWBBuildService/BuildOperationMessages.swift` (line 15, line 22, line 62, …), `Sources/SWBCLibc/include/SWBCLibc.h` (line 66, line 68, line 93), `Sources/SWBCSupport/CLibclang.h` (line 92, line 95, line 98, …), `Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift` (line 13, line 14, line 16, …), `Sources/SwiftBuild/SWBBuildServiceConnection.swift` (lines 463–996) — 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
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 8 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 (8 issue-level, 0 of them charged here).
No action in Static Analysis (SAST) — all 1 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 (1 issue-level, 0 of them charged here).
Detailed fixes: d29_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.
221 of 501 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/SWBTestSupport/TaskConstructionTester.swift. Counted over 501 of the 665 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 207 Orphaned file finding(s) in Knowledge Freshness — start with BuildRule.swift (3), Project.swift (3), BuildFile.swift (2). — One of this dimension's main actionable groups (207 recommendation-level).
Resolve the 14 Orphaned knowledge finding(s) in Knowledge Freshness — start with TaskConstructionTester.swift, MacroExpressionParsing.swift, DiagnosticsEngine.swift. — One of this dimension's main actionable groups (14 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.
Resolve the 6 Change coupling finding(s) in Change Coupling — start with BuiltinTaskActionsExtension.swift (2), Plugin.swift, BuiltinMacros.swift. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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 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.
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.
242 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
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.
Review the README against recent changes; refresh the parts that drifted.
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.
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.
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.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
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 94 use(s) across 148,805 production line(s) (~0.6/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.
`sleep` is async and calls sleep — 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. — Sources/SWBTestSupport/MockClock.swift:42
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×19) — Sources/SwiftBuild/SWBBuildServiceConnection.swift:922, Sources/SWBUtil/FSProxy.swift:408, Sources/SWBUtil/FSProxy.swift:600, …
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. (×7) — Sources/SWBTaskExecution/BuildDescription.swift:344, Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1573, Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:561, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 8 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.
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 75 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 applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
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 15 — the compose project is invalid) — time="2026-10-29T09:23:00Z" level=warning msg="The \"WORKSPACE_DIR\" variable is not set. Defaulting to a blank string." time="2026-10-29T09:23:00Z" level=warning msg="The \"WORKSPACE_DIR\" variable is not set. Defaulting to a blank string." invalid spec: ::rw: empty section between colons; 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.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not scored — 12 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 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; 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+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .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) — 135 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
D8 Code Coverage — Coverage not measured — Swift suite
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
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 Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — 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
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not 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
X12 Unreachable branch — 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
X13 Undrained process stream — 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
X15 Unvalidated length from an untrusted reader — 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
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not 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
X19 Unrestored process-global state — 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.
X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. In C a `case` label must be a constant expression, and a switch has no guards, so no label can change state. In C++ a `case` label must be a constant expression, and a switch has no guards, so no label can change state. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — 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
X23 Unguarded diagnostic materialisation — 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
X24 Document value interpolated into markup unescaped — 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
X25 Inert configuration knob — 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
X27 Collection changed while being enumerated — 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
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not 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.
X4 Structured logging — 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
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.
Orphaned knowledge Sources/SWBTestSupport/TaskConstructionTester.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/SWBMacro/MacroExpressionParsing.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/SWBUtil/DiagnosticsEngine.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/SWBBuildSystem/DependencyCycleFormatter.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/SWBUtil/String.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/SWBCore/ProjectModel/PIFLoader.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/SWBMacro/MacroConfigFileParser.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/SWBBuildService/PlanningOperation.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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.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/SWBMacro/MacroEvaluationScope.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/SWBTestSupport/FSUtilities.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/SWBBuildService/Tools.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/SWBProtocol/PlanningOperationMessages.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/SWBUtil/OutputByteStream.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) · ×1
No assertions (empty test): basics Tests/SWBServiceCoreTests/ServiceCoreTests.swift:16— Test method has an empty body — it asserts nothing and exercises no code.
FixmeComment Tests/SwiftBuildTests/AppClipsTests.swift:147— // FIXME: Find a way to call the real thing, perhaps in the future this is `xcsigningtool` — 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/SwiftBuildTests/DriverKitTests.swift:141— // FIXME: Find a way to call the real thing, perhaps in the future this is `xcsigningtool` — 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/SwiftBuildTests/BuildLogTests.swift:48— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildLogTests.swift:168— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildLogTests.swift:187— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildLogTests.swift:274— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildLogTests.swift:810— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildOperationTests.swift:2264— // FIXME: There should be a way to automatically populate the version here, but since these tests are not CoreBasedTests, there isn't a good way to do so right now. — 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/SwiftBuildTests/BuildOperationTests.swift:261— // FIXME: We should check these events much more carefully. — 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/SwiftBuildTests/BuildOperationTests.swift:376— // FIXME: Check the hierarchical relationship when we have infrastructure to do so. — 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/SwiftBuildTests/BuildOperationTests.swift:540— // FIXME: Check the hierarchical relationship when we have infrastructure to do so. — 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/SwiftBuildTests/BuildOperationTests.swift:1447— // FIXME: This isn't yet reliable. — 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/SwiftBuildTests/BuildValidationUtilities.swift:23— // FIXME: Move this elsewhere. — 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/SwiftBuildTests/BuildValidationUtilities.swift:27— // FIXME: This is broken, we are trying to test integration across products without a strong guarantee about what we are testing. In practice, we set XCODEBUILD_PATH on our current bots. — 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/SwiftBuildTests/DocumentationInfoTests.swift:49— // FIXME: Move this test data elsewhere. — 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/SwiftBuildTests/IndexingInfoTests.swift:50— // FIXME: Move this test data elsewhere. — 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/SwiftBuildTests/MacroEvaluationTests.swift:118— // FIXME: Move this test data elsewhere. — 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/SwiftBuildPerfTests/BuildServicePerfTests.swift:94— // FIXME: Move this to a file, or something. — 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 Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift:120— // FIXME: Move this to a file, or something. — 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/SWBUtilTests/MsgPackSerializationTests.swift:995— // FIXME: I would like to get a Dictionary in here too. — 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/SWBUtilTests/OrderedSetTests.swift:17— // FIXME: Workaround: <rdar://problem/26249252> Unable to prefer my own type over NS renamed types — 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 Sources/SWBTestSupport/BuildOperationTester.swift:38— // FIXME: Workaround: <rdar://problem/26249252> Unable to prefer my own type over NS renamed types — 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 Sources/SWBBuildService/BuildOperationMessages.swift:26— // FIXME: Workaround: <rdar://problem/26249252> Unable to prefer my own type over NS renamed types — 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/SWBUtilPerfTests/UtilPerfTests.swift:43— // FIXME: Since the order of keys in dictionaries in the encoded string is nondeterministic, this validation check is currently rather fuzzy. — 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/SWBTaskExecutionTests/LSRegisterURLTaskTests.swift:45— // FIXME: We should have some kind of test that we LSRegisterURL correctly. This probably makes more sense in a Quicklook test that actually verifies the end to end integration. — 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.
No assertions: androidPlatformFilterIsActive Tests/SWBAndroidPlatformTests/SWBAndroidPlatformTests.swift:147— 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: androidCommandLineToolWithSwift_swiftSDK Tests/SWBAndroidPlatformTests/SWBAndroidPlatformTests.swift:439— 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: androidCommandLineToolWithSwift_toolchain Tests/SWBAndroidPlatformTests/SWBAndroidPlatformTests.swift:447— 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: assetCatalogCompilerOutputParser Tests/SWBApplePlatformTests/AppleCommandLineSpecTests.swift:22— 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: interfaceBuilderCompilerOutputParser Tests/SWBApplePlatformTests/AppleCommandLineSpecTests.swift:84— 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: stringCatalogCompilerOutputParser Tests/SWBApplePlatformTests/AppleCommandLineSpecTests.swift:185— 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: extractExtensionPoint Tests/SWBApplePlatformTests/EXUtilTaskConstructionTests.swift:25— 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: largeDirectoryHierarchyExportPerf Tests/SWBCASPerfTests/CASFSNodePerfTests.swift:79— 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: largeDirectoryHierarchyImportPerf Tests/SWBCASPerfTests/CASFSNodePerfTests.swift:105— 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: loadingPlugin Tests/SWBCASTests/ToolchainCASPluginTests.swift:27— 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: genericOutputParser Tests/SWBCoreTests/CommandLineSpecTests.swift:25— 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: shellScriptOutputParser Tests/SWBCoreTests/CommandLineSpecTests.swift:100— 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: ldLinkerOutputParser Tests/SWBCoreTests/CommandLineSpecTests.swift:133— 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: simulatedCommandLineToolSpecArchitectureFiltering Tests/SWBCoreTests/CommandLineSpecTests.swift:2581— 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: externalToolchainsDir Tests/SWBCoreTests/CoreTests.swift:352— 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: selectConfiguredTarget Tests/SWBCoreTests/IndexSelectConfiguredTargetTests.swift:21— 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: badFramework Tests/SWBCoreTests/ModuleVerifierFrameworkTests.swift:101— 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: newFramework Tests/SWBCoreTests/ModuleVerifierFrameworkTests.swift:164— 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: perfectFramework Tests/SWBCoreTests/ModuleVerifierFrameworkTests.swift:205— 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: privateOnlyPublicModuleFramework Tests/SWBCoreTests/ModuleVerifierFrameworkTests.swift:261— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — 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: privateOnlyPublicPrivateModule Tests/SWBCoreTests/ModuleVerifierFrameworkTests.swift:301— 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: header Tests/SWBCoreTests/ModuleVerifierHeaderTests.swift:27— 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: badFrameworkModules Tests/SWBCoreTests/ModuleVerifierModuleMapTests.swift:28— 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: newFrameworkModules Tests/SWBCoreTests/ModuleVerifierModuleMapTests.swift:54— 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: perfectFrameworkModules Tests/SWBCoreTests/ModuleVerifierModuleMapTests.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.
TodoComment Tests/SwiftBuildTests/BuildLogTests.swift:881— // TODO: Revert to .equal once appintentsmetadataprocessor output is removed — 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/SwiftBuildTests/BuildLogTests.swift:927— // TODO: Revert to .equals once appintentsmetadataprocessor output is removed — 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/SwiftBuildTests/PIFTests.swift:47— // TODO: Check specifically for `PIFLoadingError.invalidObject`, but we lose the type information over the wire — 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/SwiftBuildTests/PIFTests.swift:57— // TODO: Check specifically for `PIFLoadingError.invalidObject`, but we lose the type information over the wire — 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/SwiftBuildTests/ProductPlannerTests.swift:36— // TODO: rdar://problem/56446029 Implement real tests for product planner — 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/SwiftBuildTests/ProductPlannerTests.swift:69— // TODO: rdar://problem/56446029 Implement real tests for product planner — 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/SwiftBuildTests/ProductPlannerTests.swift:99— // TODO: rdar://problem/56446029 Implement real tests for product planner — 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/SWBUtilTests/MachOTests.swift:368— // "armv7", // TODO: how should we determine which archs to test against? — 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/SWBTaskExecutionTests/ProcessProductPackagingTaskTests.swift:73— // TODO: Presently we are not testing the expanded app entitlements. — 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/SWBTaskConstructionTests/PlatformTaskConstructionTests.swift:501— // TODO: PBX requires the target to already have a resources phase in order to inject the product type's storyboard, but it would be more robust to cons one up implicitly. No ERs about that yet. — 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/SWBTaskConstructionTests/PlatformTaskConstructionTests.swift:566— // TODO: This seems a little fragile. Is there some way we can check the result (i.e. what's in the resulting Info.plist?) instead of the specific implementation details? — 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/SWBCoreTests/CommandLineSpecTests.swift:834— // TODO: We could move this outside of this test and have other tests use it. — 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/SWBBuildSystemTests/BuildOperationDescriptionTests.swift:290— // TODO: Compare errors and warnings. — 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/SWBBuildSystemTests/BuildOperationDescriptionTests.swift:448— // TODO: Compare errors and warnings. — 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/SWBBuildSystemTests/DependencyValidationTests.swift:126— // TODO: rdar://80796520 (Re-enable dependency validator) — 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/SWBBuildSystemTests/DependencyValidationTests.swift:146— // TODO: rdar://80796520 (Re-enable dependency validator) — 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 Sources/SWBCore/Settings/Settings.swift:142— // TODO: rdar://80796520 (Re-enable dependency validator) — 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/SWBBuildSystemTests/OnDemandResourcesTests.swift:112— // Some of these tests could live in in lower-layered test targets, but on the other hand there's value in having all the tests for the feature in one place. TODO discuss. — 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/SWBBuildSystemTests/ShellScriptSandboxingTests.swift:1435— // TODO: we should get back to this scenario once better diagnostics is in place. — 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/SWBBuildServiceTests/BuildDependencyInfoTests.swift:336— // TODO: we should support positional arguments as well but that requires a complete understanding of all possible linker args, will come back to this — 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/SWBBuildServiceTests/BuildDependencyInfoTests.swift:551— // TODO: Check that the JSON we produce is correct. We don't do this yet so we can iterate on the format rapidly. — 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 Sources/SwiftBuildTestSupport/CoreQualificationTester.swift:85— // TODO: <rdar://59432231> Longer term, we should find a way to share code with BuildOperationTester, which has a number of APIs for building up a human readable build transcript. — 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 Sources/SwiftBuild/SWBBuildServiceConsole.swift:89— // TODO: Display each error type differently? — 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 Sources/SwiftBuild/SWBBuildServiceConsole.swift:188— // TODO: Document/define the parsing rules for the Swift Build console. <rdar://problem/38407408> — 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 Sources/SwiftBuild/ProjectModel/BuildRule.swift:151— // TODO: fold this into 'encode' — 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.
Low cohesion: CapturingTaskGenerationDelegate (LCOM4 51) Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift:19— CapturingTaskGenerationDelegate's methods fall into 51 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 51 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: TestTaskPlanningDelegate (LCOM4 48) Sources/SWBTestSupport/TaskPlanningTestSupport.swift:238— TestTaskPlanningDelegate's methods fall into 48 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 48 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: BuildSystemTaskPlanningDelegate (LCOM4 45) Sources/SWBTaskExecution/BuildDescriptionManager.swift:734— BuildSystemTaskPlanningDelegate's methods fall into 45 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 45 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: TaskProducerContext (LCOM4 29) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:55— TaskProducerContext's methods fall into 29 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 29 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: ProductTypeSpec (LCOM4 22) Sources/SWBCore/SpecImplementations/ProductTypes.swift:16— ProductTypeSpec's methods fall into 22 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 22 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: String (LCOM4 17) Sources/SWBCore/OptimizationRemarks.swift:195— String's methods fall into 17 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 17 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 15) Sources/SWBCore/FileToBuild.swift:173— Array's methods fall into 15 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 15 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: LocalFS (LCOM4 12) Sources/SWBUtil/FSProxy.swift:345— LocalFS's methods fall into 12 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 12 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: SwiftCompilerSpec (LCOM4 9) Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:742— SwiftCompilerSpec'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: Dictionary (LCOM4 9) Sources/SWBCore/PlatformEnvironment.swift:27— Dictionary'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: Sequence (LCOM4 9) Sources/SWBTestSupport/Misc.swift:26— Sequence'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: PseudoFS (LCOM4 9) Sources/SWBUtil/FSProxy.swift:848— PseudoFS'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: SourcesTaskProducer (LCOM4 8) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:207— SourcesTaskProducer'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: Session (LCOM4 7) Sources/SWBBuildService/Session.swift:30— Session'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: CustomTaskTypeDescription (LCOM4 7) Sources/SWBCore/CustomTaskTypeDescription.swift:15— CustomTaskTypeDescription'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: ProductPostprocessingTaskProducer (LCOM4 7) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:54— ProductPostprocessingTaskProducer'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: BuildResults (LCOM4 7) Sources/SWBTestSupport/BuildOperationTester.swift:378— BuildResults'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: CoreQualificationTesterResults (LCOM4 7) Sources/SwiftBuildTestSupport/CoreQualificationTester.swift:138— CoreQualificationTesterResults'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: WorkspaceContext (LCOM4 6) Sources/SWBCore/WorkspaceContext.swift:254— WorkspaceContext'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: ClangCompilerSpec (LCOM4 6) Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:564— ClangCompilerSpec'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: Collection (LCOM4 6) Sources/SWBTaskConstruction/DiagnosticSupport.swift:59— 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: MockCAS (LCOM4 5) Sources/MockToolchainCASPlugin/MockCAS.swift:97— MockCAS'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: Platform (LCOM4 5) Sources/SWBCore/PlatformRegistry.swift:28— Platform'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: FrameworkProductTypeSpec (LCOM4 5) Sources/SWBCore/SpecImplementations/ProductTypes.swift:455— FrameworkProductTypeSpec'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: SSAFSourceTransformationSpec (LCOM4 5) Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:2122— SSAFSourceTransformationSpec'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.
MethodTooLong: SourcesTaskProducer.generateTasks Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:891— MethodTooLong — generateTasks runs 579 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 479 over it, 5.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: SourcesTaskProducer.computeLibraries Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:373— MethodTooLong — computeLibraries runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× 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: SettingsBuilder.getCommonTargetTaskOverrides Sources/SWBCore/Settings/Settings.swift:4426— MethodTooLong — getCommonTargetTaskOverrides runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.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: BuildDescription.construct Sources/SWBTaskExecution/BuildDescription.swift:1140— MethodTooLong — construct runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ActoolCompilerSpec.constructTasks Sources/SWBApplePlatform/AssetCatalogCompiler.swift:129— MethodTooLong — constructTasks runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× 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: TargetDependencyResolver.computeGraph Sources/SWBCore/TargetDependencyResolver.swift:286— MethodTooLong — computeGraph runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× 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: SDKRegistry.registerSDK Sources/SWBCore/SDKRegistry.swift:636— MethodTooLong — registerSDK 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: BuildOperation._build Sources/SWBBuildSystem/BuildOperation.swift:538— MethodTooLong — _build runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: CopyFilesTaskProducer.addTasksForUngroupedFile Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:204— MethodTooLong — addTasksForUngroupedFile runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: InfoPlistProcessorTaskAction.performTaskAction Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:54— MethodTooLong — performTaskAction runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: SettingsBuilder.construct Sources/SWBCore/Settings/Settings.swift:1487— MethodTooLong — construct runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: SwiftDriverJobTaskAction.performTaskAction Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:343— MethodTooLong — performTaskAction 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: SettingsBuilder.analyzeSettings Sources/SWBCore/Settings/Settings.swift:5761— MethodTooLong — analyzeSettings runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× 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: FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:420— MethodTooLong — groupAndAddTasksForFiles runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× 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: SettingsBuilder.computeBoundProperties Sources/SWBCore/Settings/Settings.swift:1811— MethodTooLong — computeBoundProperties runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: InfoPlistProcessorTaskAction.parseConfiguration Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:378— MethodTooLong — parseConfiguration runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: DependencyResolver.lookupConfiguredTarget Sources/SWBCore/DependencyResolution.swift:793— MethodTooLong — lookupConfiguredTarget 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: RunningTask.init Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:229— MethodTooLong — init runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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: GenericCachingTaskAction.performTaskAction Sources/SWBTaskExecution/TaskActions/GenericCachingTaskAction.swift:67— MethodTooLong — performTaskAction runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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: SettingsBuilder.getBuildPhaseTargetTaskOverrides Sources/SWBCore/Settings/Settings.swift:5127— MethodTooLong — getBuildPhaseTargetTaskOverrides runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× 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: XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— MethodTooLong — generateXCTRunnerTasks runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× 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: AppIntentsMetadataCompilerSpec.constructTasks Sources/SWBApplePlatform/AppIntentsMetadataCompiler.swift:76— MethodTooLong — constructTasks runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: SWBBuildOperation.handleMessage Sources/SwiftBuild/SWBBuildOperation.swift:102— MethodTooLong — handleMessage runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: BuildPlan.init Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:88— MethodTooLong — init runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× 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: PlatformRegistry.registerPlatform Sources/SWBCore/PlatformRegistry.swift:441— MethodTooLong — registerPlatform runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× 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: Settings/Settings.swift Sources/SWBCore/Settings/Settings.swift— FileTooLong — 3256 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: SettingsBuilder (1229-6190). The bar is 500 significant lines; this is 2756 over it, 6.51× 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: SWBBuildSystem/BuildOperation.swift Sources/SWBBuildSystem/BuildOperation.swift— FileTooLong — 1543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1043 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: BuildPhaseTaskProducers/SourcesTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift— FileTooLong — 1401 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 901 over it, 2.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SWBTestSupport/BuildOperationTester.swift Sources/SWBTestSupport/BuildOperationTester.swift— FileTooLong — 1343 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 843 over it, 2.69× 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: TaskProducers/TaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift— FileTooLong — 1016 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 516 over it, 2.03× 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: SWBBuildService/Messages.swift Sources/SWBBuildService/Messages.swift— FileTooLong — 1009 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 509 over it, 2.02× 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: SWBUtil/MachO.swift Sources/SWBUtil/MachO.swift— FileTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 494 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: ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift— FileTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 480 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: ProductPlanning/ProductPlan.swift Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift— FileTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 473 over it, 1.95× 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: SWBTaskExecution/BuildDescription.swift Sources/SWBTaskExecution/BuildDescription.swift— FileTooLong — 935 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 435 over it, 1.87× 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: TaskActions/InfoPlistProcessorTaskAction.swift Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift— FileTooLong — 894 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: InfoPlistProcessorTaskAction (23-1628). The bar is 500 significant lines; this is 394 over it, 1.79× 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: SWBProjectModel/PIFGenerationModel.swift Sources/SWBProjectModel/PIFGenerationModel.swift— FileTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: PIF (22-1125). The bar is 500 significant lines; this is 363 over it, 1.73× 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: SWBProtocol/Message.swift Sources/SWBProtocol/Message.swift— FileTooLong — 861 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 361 over it, 1.72× 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: SWBUtil/FSProxy.swift Sources/SWBUtil/FSProxy.swift— FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 311 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: SWBBuildService/BuildOperationMessages.swift Sources/SWBBuildService/BuildOperationMessages.swift— FileTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 289 over it, 1.58× 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: SWBProtocol/BuildOperationMessages.swift Sources/SWBProtocol/BuildOperationMessages.swift— FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 282 over it, 1.56× 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: SWBCore/XCFramework.swift Sources/SWBCore/XCFramework.swift— FileTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 248 over it, 1.50× 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: SWBTestSupport/TaskConstructionTester.swift Sources/SWBTestSupport/TaskConstructionTester.swift— FileTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 236 over it, 1.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: SWBCore/SDKRegistry.swift Sources/SWBCore/SDKRegistry.swift— FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: SDKRegistry (522-1375). The bar is 500 significant lines; this is 210 over it, 1.42× 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: SWBCore/TaskGeneration.swift Sources/SWBCore/TaskGeneration.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: SWBCore/DependencyResolution.swift Sources/SWBCore/DependencyResolution.swift— FileTooLong — 649 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 149 over it, 1.30× 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: SWBUtil/PropertyList.swift Sources/SWBUtil/PropertyList.swift— FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 124 over it, 1.25× 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: SwiftBuild/SWBBuildServiceSession.swift Sources/SwiftBuild/SWBBuildServiceSession.swift— FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 93 over it, 1.19× 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: SWBUtil/Path.swift Sources/SWBUtil/Path.swift— FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 82 over it, 1.16× 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: OtherTaskProducers/ProductPostprocessingTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift— FileTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 76 over it, 1.15× 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.
Hotspot: Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:1205— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 267 in SwiftCompilerSpec.constructTasks at line 1205. 1 of those changes was a fix/bug commit, and the other 24 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.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/SWBCore/Settings/Settings.swift Sources/SWBCore/Settings/Settings.swift:4426— Sources/SWBCore/Settings/Settings.swift changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in SettingsBuilder.getCommonTargetTaskOverrides at line 4426. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/Settings/Settings.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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:891— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in SourcesTaskProducer.generateTasks at line 891. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.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/SWBCore/SpecImplementations/Tools/CCompiler.swift Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1107— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in ClangCompilerSpec.constructTasks at line 1107. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/SpecImplementations/Tools/CCompiler.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/SWBCore/SpecImplementations/Tools/LinkerTools.swift Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:454— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in LdLinkerSpec.constructLinkerTasks at line 454. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/SpecImplementations/Tools/LinkerTools.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/SWBTaskConstruction/ProductPlanning/ProductPlan.swift Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:752— Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in GlobalProductPlan.computeIPIClangInfo at line 752. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:420— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles at line 420. 2 of those changes were fix/bug commits, 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.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/SWBTaskConstruction/TaskProducers/TaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1554— Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles at line 1554. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/TaskProducer.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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:204— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in CopyFilesTaskProducer.addTasksForUngroupedFile at line 204. 1 of those changes was a fix/bug commit, and the other 1 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.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/SwiftBuild/SWBBuildOperation.swift Sources/SwiftBuild/SWBBuildOperation.swift:102— Sources/SwiftBuild/SWBBuildOperation.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in SWBBuildOperation.handleMessage at line 102. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SwiftBuild/SWBBuildOperation.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/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift:35— Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in XCFrameworkTaskProducer.prepare at line 35. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.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/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:343— Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in SwiftDriverJobTaskAction.performTaskAction at line 343. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.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/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift:34— Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in SwiftDriverTaskAction.performTaskAction at line 34. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.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/SwiftBuild/SWBBuildServer.swift Sources/SwiftBuild/SWBBuildServer.swift:425— Sources/SwiftBuild/SWBBuildServer.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in SWBBuildServer.reportEventStream at line 425. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SwiftBuild/SWBBuildServer.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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift:184— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in TAPISymbolExtractorTaskProducer.computeHeadersInputList at line 184. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.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/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.swift Sources/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.swift:332— Sources/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ClangModuleDependencyGraph.scanModuleDependencies at line 332. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.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/SWBCore/LinkageDependencyResolver.swift Sources/SWBCore/LinkageDependencyResolver.swift:215— Sources/SWBCore/LinkageDependencyResolver.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in LinkageDependencyResolver.dependencies at line 215. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/LinkageDependencyResolver.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/SWBTaskExecution/BuildDescription.swift Sources/SWBTaskExecution/BuildDescription.swift:1010— Sources/SWBTaskExecution/BuildDescription.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in BuildDescriptionBuilder.addSubprocessCommand at line 1010. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskExecution/BuildDescription.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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:1233— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in SwiftBuildMessage.encode at line 1233. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.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/SWBCore/ShellScript.swift Sources/SWBCore/ShellScript.swift:80— Sources/SWBCore/ShellScript.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in ShellScript.swift.computeScriptEnvironment at line 80. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBCore/ShellScript.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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift:190— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ModuleVerifierTaskProducer.generateClangModuleVerifierTask at line 190. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.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/SWBUtil/PbxCp.swift Sources/SWBUtil/PbxCp.swift:515— Sources/SWBUtil/PbxCp.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PbxCp.swift.copyTree at line 515. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBUtil/PbxCp.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/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:130— Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in PrecompileClangModuleTaskAction.performTaskAction at line 130. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.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/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift:27— Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CompilationCachingConfigFileTaskProducer.generateTasks at line 27. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 10:00:41 -04:00' --until='2026-10-28 10:00:41 -04:00' --full-history --no-merges -- Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.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 (5 lines × 2) Sources/SWBAndroidPlatform/Plugin.swift:117— Sources/SWBAndroidPlatform/Plugin.swift:117-121 | Sources/SWBQNXPlatform/Plugin.swift:91-96 — 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/SWBAndroidPlatform/Plugin.swift:117` 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/SWBAndroidPlatform/Plugin.swift:121— Sources/SWBAndroidPlatform/Plugin.swift:121-125 | Sources/SWBApplePlatform/PluginDCLT.swift:91-96 — 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/SWBAndroidPlatform/Plugin.swift:121` 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 (5 lines × 2) Sources/SWBApplePlatform/RealityAssetsTaskProducer.swift:70— Sources/SWBApplePlatform/RealityAssetsTaskProducer.swift:70-74 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/GenerateAppPlaygroundAssetCatalogTaskProducer.swift:32-36 — 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/SWBApplePlatform/StubBinaryTaskProducer.swift:57— Sources/SWBApplePlatform/StubBinaryTaskProducer.swift:57-61 | Sources/SWBApplePlatform/StubBinaryTaskProducer.swift:63-67 — 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/SWBApplePlatform/StubBinaryTaskProducer.swift:57` 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 (5 lines × 2) Sources/SWBCore/ClangModuleVerifier/ModuleVerifierTarget.swift:145— Sources/SWBCore/ClangModuleVerifier/ModuleVerifierTarget.swift:145-149 | Sources/SWBCore/ClangModuleVerifier/ModuleVerifierTarget.swift:158-162 — 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/SWBCore/ClangModuleVerifier/ModuleVerifierTarget.swift:145` 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 `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 (5 lines × 2) Sources/SWBCore/Settings/Settings.swift:1050— Sources/SWBCore/Settings/Settings.swift:1050-1054 | Sources/SWBTestSupport/DummyCommandProducer.swift:74-78 — 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/SWBCore/Settings/Settings.swift:1050` 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 (5 lines × 2) Sources/SWBProjectModel/PIFGenerationModel.swift:117— Sources/SWBProjectModel/PIFGenerationModel.swift:117-121 | Sources/SWBProjectModel/PIFGenerationModel.swift:229-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBProjectModel/PIFGenerationModel.swift:117` 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 (5 lines × 2) Sources/SWBProtocol/MessageSupport.swift:374— Sources/SWBProtocol/MessageSupport.swift:374-378 | Sources/SwiftBuild/SWBBuildParameters.swift:78-82 — 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/SWBProtocol/MessageSupport.swift:374` 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 (5 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift:393— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift:393-397 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift:402-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. 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/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:329— Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:329-333 | Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:347-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/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:329` 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 (5 lines × 2) Sources/SWBUtil/OutputByteStream.swift:505— Sources/SWBUtil/OutputByteStream.swift:505-509 | Sources/SWBUtil/OutputByteStream.swift:523-527 — 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/SWBUtil/OutputByteStream.swift:505` 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/SWBUtil/PropertyList.swift:263— Sources/SWBUtil/PropertyList.swift:263-267 | Sources/SWBUtil/PropertyList.swift:278-282 — 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/SWBUtil/PropertyList.swift:263` 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 (5 lines × 2) Sources/SWBApplePlatform/CoreMLCompiler.swift:42— Sources/SWBApplePlatform/CoreMLCompiler.swift:42-46 | Sources/SWBApplePlatform/IntentsCompiler.swift:37-41 — before extracting anything, compare `Sources/SWBApplePlatform/CoreMLCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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 (5 lines × 2) Sources/SWBProtocol/DocumentationMessages.swift:32— Sources/SWBProtocol/DocumentationMessages.swift:32-36 | Sources/SWBProtocol/IndexingMessages.swift:158-162 — 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 (5 lines × 2) Sources/SWBProtocol/ProjectModel/Target.swift:184— Sources/SWBProtocol/ProjectModel/Target.swift:184-188 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:288-294 — 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/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:203— Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:203-207 | Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift:210-214 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift` as WHOLE FILES: this scan already matched 5 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. 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 (5 lines × 2) Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:209— Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:209-213 | Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift:216-220 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift` as WHOLE FILES: this scan already matched 5 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. 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 (5 lines × 2) Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:134— Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:134-138 | Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift:28-32 — 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 (5 lines × 2) Sources/SWBCore/BuildConfigurationFiltering.swift:35— Sources/SWBCore/BuildConfigurationFiltering.swift:35-39 | Sources/SWBCore/PlatformFiltering.swift:77-81 — 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 (5 lines × 2) Sources/SWBCore/WorkspaceContext.swift:83— Sources/SWBCore/WorkspaceContext.swift:83-87 | Sources/SwiftBuild/SWBSystemInfo.swift:30-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `operatingSystemVersion` to `Version` in one and `OperatingSystemVersion` 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 (5 lines × 2) Sources/SWBCore/LinkageDependencyResolver.swift:118— Sources/SWBCore/LinkageDependencyResolver.swift:118-122 | Sources/SWBCore/TargetDependencyResolver.swift:305-309 — 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/SWBCore/LinkageDependencyResolver.swift:118` 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 (5 lines × 2) Sources/SWBMacro/MacroConditionExpression.swift:466— Sources/SWBMacro/MacroConditionExpression.swift:466-470 | Sources/SWBMacro/MacroConditionExpression.swift:482-486 — 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/SWBMacro/MacroConditionExpression.swift:466` 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/SWBProjectModel/PIFGenerationModel.swift:275— Sources/SWBProjectModel/PIFGenerationModel.swift:275-279 | Sources/SWBProjectModel/PIFGenerationModel.swift:540-544 — 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/SWBProjectModel/PIFGenerationModel.swift:275` 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/SWBCore/SpecImplementations/ProductTypes.swift:618— Sources/SWBCore/SpecImplementations/ProductTypes.swift:618-622 | Sources/SWBCore/SpecImplementations/ProductTypes.swift:856-860 — 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/SWBApplePlatform/InterfaceBuilderCompiler.swift:150— Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:150-156 | Sources/SWBApplePlatform/StoryboardLinker.swift:58-64 — 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 (7 lines × 2) Sources/SWBApplePlatform/MetalCompiler.swift:190— Sources/SWBApplePlatform/MetalCompiler.swift:190-196 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1900-1906 — 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/SWBApplePlatform/MetalCompiler.swift:190` 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 (7 lines × 2) Sources/SWBBuildService/Messages.swift:1186— Sources/SWBBuildService/Messages.swift:1186-1192 | Sources/SWBBuildService/Messages.swift:1230-1236 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `message` to `DescribeSchemesRequest` in one and `DescribeArchivableProductsRequest` 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 (7 lines × 2) Sources/SWBBuildSystem/BuildOperation.swift:1692— Sources/SWBBuildSystem/BuildOperation.swift:1692-1698 | Sources/SWBBuildSystem/BuildOperation.swift:1719-1725 — 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/SWBBuildSystem/BuildOperation.swift:1692` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift:100— Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift:100-106 | Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift:109-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.
Duplicated block (7 lines × 2) Sources/SWBCore/ProjectModel/Project.swift:18— Sources/SWBCore/ProjectModel/Project.swift:18-24 | Sources/SWBCore/ProjectModel/Workspace.swift:60-66 — 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/SWBCore/ProjectModel/Project.swift:18` 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/SWBTaskConstruction/DiagnosticSupport.swift:118— Sources/SWBTaskConstruction/DiagnosticSupport.swift:118-124 | Sources/SWBTaskConstruction/DiagnosticSupport.swift:165-172 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:250— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:250-256 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift:181-187 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:250` 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 (7 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/HeadermapTaskProducer.swift:240— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/HeadermapTaskProducer.swift:240-246 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/HeadermapTaskProducer.swift:340-346 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:481— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:481-487 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:490-500 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:488` calls `asJSON` and `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:480` 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 (7 lines × 2) Sources/SWBTaskExecution/BuildDescription.swift:1156— Sources/SWBTaskExecution/BuildDescription.swift:1156-1162 | Sources/SWBTestSupport/TaskExecutionTestSupport.swift:117-123 — 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/SWBTestSupport/LibraryGeneration.swift:280— Sources/SWBTestSupport/LibraryGeneration.swift:280-286 | Sources/SWBTestSupport/LibraryGeneration.swift:334-340 — 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/SWBUtil/Environment.swift:58— Sources/SWBUtil/Environment.swift:58-64 | Sources/SWBUtil/Environment.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. 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/SWBUtil/String.swift:620— Sources/SWBUtil/String.swift:620-632 | Sources/SWBUtil/String.swift:644-650 — 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 (7 lines × 2) Sources/SwiftBuild/SWBBuildServiceSession.swift:983— Sources/SwiftBuild/SWBBuildServiceSession.swift:983-989 | Sources/SwiftBuild/SWBBuildServiceSession.swift:1003-1009 — 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/SwiftBuild/SWBBuildServiceSession.swift:983` 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/SWBAndroidPlatform/Plugin.swift:140— Sources/SWBAndroidPlatform/Plugin.swift:140-146 | Sources/SWBWindowsPlatform/Plugin.swift:111-117 — 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/SWBApplePlatform/CoreDataCompiler.swift:28— Sources/SWBApplePlatform/CoreDataCompiler.swift:28-34 | Sources/SWBApplePlatform/IntentsCompiler.swift:106-112 — before extracting anything, compare `Sources/SWBApplePlatform/CoreDataCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (7 lines × 2) Sources/SWBMacro/MacroValueAssignmentTable.swift:475— Sources/SWBMacro/MacroValueAssignmentTable.swift:475-481 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:207-220 — 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/SwiftBuild/ProjectModel/References.swift:155— Sources/SwiftBuild/ProjectModel/References.swift:155-161 | Sources/SwiftBuild/ProjectModel/References.swift:247-253 — 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/SwiftBuild/ProjectModel/References.swift:155` 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/SWBCore/SpecImplementations/Tools/LinkerTools.swift:387— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:387-393 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:397-403 — 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/SWBCore/TaskGeneration.swift:308— Sources/SWBCore/TaskGeneration.swift:308-313 | Sources/SWBCore/TaskGeneration.swift:316-321 — 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 (6 lines × 2) Sources/SWBCore/XCFramework.swift:1128— Sources/SWBCore/XCFramework.swift:1128-1133 | Sources/SWBCore/XCFramework.swift:1144-1149 — 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/SWBCore/XCFramework.swift:1128` 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 (6 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift:196— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift:196-201 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift:258-263 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.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 (6 lines × 2) Sources/SWBTestSupport/BuildOperationTester.swift:1015— Sources/SWBTestSupport/BuildOperationTester.swift:1015-1020 | Sources/SWBTestSupport/BuildOperationTester.swift:1031-1036 — 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/SWBTestSupport/BuildOperationTester.swift:1015` 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/SWBTestSupport/TaskConstructionTester.swift:170— Sources/SWBTestSupport/TaskConstructionTester.swift:170-175 | Sources/SWBTestSupport/TaskConstructionTester.swift:189-194 — 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/SWBTestSupport/TaskConstructionTester.swift:170` 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/SWBUtil/MachO.swift:373— Sources/SWBUtil/MachO.swift:373-378 | Sources/SWBUtil/MachO.swift:395-400 — 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/SWBUtil/RegEx.swift:44— Sources/SWBUtil/RegEx.swift:44-49 | Sources/SWBUtil/RegEx.swift:79-84 — 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/SWBUtil/RegEx.swift:44` 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:503— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:503-508 | Sources/SwiftBuildTestSupport/TestBuildOperationDelegate.swift:40-45 — 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:503` 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/SWBApplePlatform/CoreMLCompiler.swift:35— Sources/SWBApplePlatform/CoreMLCompiler.swift:35-40 | Sources/SWBApplePlatform/IntentsCompiler.swift:30-35 — before extracting anything, compare `Sources/SWBApplePlatform/CoreMLCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `indexingPayload` to `CoreMLIndexingInfo` in one and `IntentsIndexingInfo` 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 (6 lines × 2) Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:166— Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:166-173 | Sources/SWBApplePlatform/StoryboardPostprocessor.swift:22-27 — 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 (6 lines × 2) Sources/SWBBuildService/BuildDependencyInfo.swift:206— Sources/SWBBuildService/BuildDependencyInfo.swift:206-211 | Sources/SWBCore/LinkageDependencyResolver.swift:607-612 — 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/SWBCore/ProjectModel/Target.swift:107— Sources/SWBCore/ProjectModel/Target.swift:107-112 | Sources/SWBProtocol/ProjectModel/TargetDependency.swift:21-26 — 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/SWBProtocol/DependencyGraphMessages.swift:150— Sources/SWBProtocol/DependencyGraphMessages.swift:150-155 | Sources/SWBProtocol/IndexingMessages.swift:112-117 — 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 (6 lines × 2) Sources/SWBCore/ProjectModel/BuildPhase.swift:235— Sources/SWBCore/ProjectModel/BuildPhase.swift:235-240 | Sources/SWBProtocol/ProjectModel/BuildPhase.swift:78-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `destinationSubfolder` to `MacroStringExpression` in one and `MacroExpressionSource` 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 (6 lines × 2) Sources/SWBProjectModel/PIFGenerationModel.swift:779— Sources/SWBProjectModel/PIFGenerationModel.swift:779-784 | Sources/SWBProtocol/ProjectModel/BuildRule.swift:51-56 — 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/SWBApplePlatform/EXUtil.swift:22— Sources/SWBApplePlatform/EXUtil.swift:22-27 | Sources/SWBApplePlatform/EXUtil.swift:74-79 — 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/SWBApplePlatform/EXUtil.swift:22` 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/SWBUtil/MachO.swift:1001— Sources/SWBUtil/MachO.swift:1001-1006 | Sources/SWBUtil/MachO.swift:1028-1033 — 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/SWBCore/SpecImplementations/Tools/GCCCompatibleCompilerSupport.swift:439— Sources/SWBCore/SpecImplementations/Tools/GCCCompatibleCompilerSupport.swift:439-444 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3853-3858 — 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 (6 lines × 2) Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:30— Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:30-35 | Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift:30-35 — 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/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.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. 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 (6 lines × 2) Sources/SWBTestSupport/TestWorkspaces.swift:915— Sources/SWBTestSupport/TestWorkspaces.swift:915-920 | Sources/SWBTestSupport/TestWorkspaces.swift:1349-1354 — 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/SWBTestSupport/TestWorkspaces.swift:915` 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 (caught, then discarded) Sources/SwiftBuild/SWBBuildServiceConnection.swift:922— `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/SWBUtil/FSProxy.swift:408— `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/SWBUtil/FSProxy.swift:600— `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/SWBUtil/FSProxy.swift:931— `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/SWBUtil/Path.swift:751— `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/SWBUtil/Path.swift:833— `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/SWBUtil/PbxCp.swift:29— `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/SWBTestSupport/AssertMatch.swift:139— `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/SWBTestSupport/Xcode.swift:72— `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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:366— `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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift:133— `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/SWBMacro/MacroCondition.swift:49— `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/SWBCore/MacroConfigFileLoader.swift:79— `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/SWBCore/SwiftOutputParsing.swift:150— `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/SWBCore/Settings/Settings.swift:1786— `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/SWBCore/ClangModuleVerifier/ModuleVerifierFilenameMap.swift:30— `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/SWBBuildSystem/BuildOperation.swift:673— `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/SWBBuildSystem/BuildOperation.swift:687— `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/SWBBuildService/BuildDependencyInfo.swift:117— `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.
TooManyMethods: TaskProducerContext Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:55— TooManyMethods — 76 methods, declared across 4 files: TaskProducers/TaskProducer.swift (72), WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift (2), SWBTaskConstruction/TaskProducerSandboxing.swift (1), BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift (1). The bar is 30 methods; this is 46 over it, 2.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: CapturingTaskGenerationDelegate Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift:19— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.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.
TooManyMethods: SWBBuildServiceSession Sources/SwiftBuild/SWBBuildServiceSession.swift:39— TooManyMethods — 65 methods, declared across 4 files: SwiftBuild/SWBBuildServiceSession.swift (57), ConsoleCommands/SWBServiceConsoleXcodeCommands.swift (5), SwiftBuildTestSupport/TestUtilities.swift (2), ConsoleCommands/SWBServiceConsoleBuildCommand.swift (1). The bar is 30 methods; this is 35 over it, 2.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OperationSystemAdaptor Sources/SWBBuildSystem/BuildOperation.swift:1459— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.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.
TooManyMethods: SettingsBuilder Sources/SWBCore/Settings/Settings.swift:1229— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.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.
TooManyMethods: BuildSystemTaskPlanningDelegate Sources/SWBTaskExecution/BuildDescriptionManager.swift:734— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: PseudoFS Sources/SWBUtil/FSProxy.swift:848— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. Most of these members implement SWBUtil.FSProxy (36 of 47 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: LocalFS Sources/SWBUtil/FSProxy.swift:345— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. Most of these members implement SWBUtil.FSProxy (37 of 41 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: BuildResults Sources/SWBTestSupport/BuildOperationTester.swift:378— TooManyMethods — 39 methods, declared across 2 files: SWBTestSupport/BuildOperationTester.swift (33), SwiftBuildTestSupport/TaskBacktraces.swift (6). The bar is 30 methods; this is 9 over it, 1.30× 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: Path Sources/SWBUtil/Path.swift:38— TooManyMethods — 37 methods, declared across 3 files: SWBUtil/Path.swift (35), LibSwiftDriver/PlannedBuild.swift (1), SWBUtil/PbxCp.swift (1). The bar is 30 methods; this is 7 over it, 1.23× 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: Core Sources/SWBCore/Core.swift:41— TooManyMethods — 34 methods, declared across 6 files: SWBCore/Core.swift (23), SWBTestSupport/CoreTestSupport.swift (4), SWBTestSupport/CoreBasedTests+SDKHelpers.swift (3), SWBCore/BuildRuleSet.swift (2), +2 more file(s). 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: GlobalProductPlan Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:31— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: MacroNamespace Sources/SWBMacro/MacroNamespace.swift:19— TooManyMethods — 31 methods, declared across 2 files: SWBMacro/MacroNamespace.swift (29), SWBCore/MacroExpressionSourceExtensions.swift (2). The bar is 30 methods; this is 1 over it, 1.03× 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: SWBBuildService Sources/SwiftBuild/SWBBuildService.swift:44— TooManyMethods — 31 methods, declared across 4 files: SwiftBuild/SWBBuildService.swift (28), ConsoleCommands/SWBServiceConsoleBuildCommand.swift (1), ConsoleCommands/SWBServiceConsoleXcodeCommands.swift (1), SwiftBuildTestSupport/TestUtilities.swift (1). The bar is 30 methods; this is 1 over it, 1.03× 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 (9 lines × 2) Sources/SWBApplePlatform/CoreDataCompiler.swift:54— Sources/SWBApplePlatform/CoreDataCompiler.swift:54-62 | Sources/SWBApplePlatform/IntentsCompiler.swift:126-134 — before extracting anything, compare `Sources/SWBApplePlatform/CoreDataCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. 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/SWBCore/LinkageDependencyResolver.swift:276— Sources/SWBCore/LinkageDependencyResolver.swift:276-284 | Sources/SWBCore/LinkageDependencyResolver.swift:316-324 — 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/SWBCore/LinkageDependencyResolver.swift:276` 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/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:76— Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:76-84 | Sources/SWBTestSupport/TestWorkspaces.swift:204-212 — 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.
Duplicated block (9 lines × 2) Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:283— Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:283-291 | Sources/SwiftBuild/ProjectModel/BuildRule.swift:179-187 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dependencyInfo` to `PIF.BuildRule.Action.DependencyInfoFormat?` in one and `Action.DependencyInfoFormat?` 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 (9 lines × 2) Sources/SWBProtocol/MessageSupport.swift:71— Sources/SWBProtocol/MessageSupport.swift:71-79 | Sources/SwiftBuild/SWBBuildRequest.swift:106-114 — 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/SWBProtocol/MessageSupport.swift:71` 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 (9 lines × 2) Sources/SWBTaskConstruction/DiagnosticSupport.swift:164— Sources/SWBTaskConstruction/DiagnosticSupport.swift:164-172 | Sources/SWBTaskConstruction/DiagnosticSupport.swift:196-204 — 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/SWBTaskConstruction/DiagnosticSupport.swift:164` 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/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift:46— Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift:46-54 | Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/PCHModuleMapTaskProducer.swift:55-63 — 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/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift:46` 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:143— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:143-151 | Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:154-162 — 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:143` 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/SWBUtil/IndexStore.swift:191— Sources/SWBUtil/IndexStore.swift:191-199 | Sources/SWBUtil/IndexStore.swift:237-245 — 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/SwiftBuild/SWBBuildService.swift:214— Sources/SwiftBuild/SWBBuildService.swift:214-222 | Sources/SwiftBuild/SWBBuildService.swift:228-236 — 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/SwiftBuild/SWBBuildService.swift:214` 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 (9 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:23— Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:23-31 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:68-78 — 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 (9 lines × 2) Sources/SWBCore/SpecImplementations/Tools/GCCCompatibleCompilerSupport.swift:430— Sources/SWBCore/SpecImplementations/Tools/GCCCompatibleCompilerSupport.swift:430-438 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3844-3852 — 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/SWBCore/SpecImplementations/Tools/GCCCompatibleCompilerSupport.swift:430` 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 (9 lines × 2) Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3154— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3154-3162 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3217-3226 — 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/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3154` 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:183— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:183-191 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:104-112 — 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. 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/SWBApplePlatform/AssetCatalogCompiler.swift:481— Sources/SWBApplePlatform/AssetCatalogCompiler.swift:481-488 | Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:176-183 — 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 (8 lines × 2) Sources/SWBBuildSystem/BuildOperation.swift:1680— Sources/SWBBuildSystem/BuildOperation.swift:1680-1687 | Sources/SWBBuildSystem/BuildOperation.swift:1707-1714 — 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/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:180— Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:180-187 | Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:212-219 — 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/SWBCore/TaskGeneration.swift:471— Sources/SWBCore/TaskGeneration.swift:471-478 | Sources/SWBCore/TaskGeneration.swift:499-506 — 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/SWBCore/TaskGeneration.swift:471` 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 × 2) Sources/SWBProtocol/Message.swift:472— Sources/SWBProtocol/Message.swift:472-479 | Sources/SwiftBuild/SWBBuildTargetInfo.swift:23-30 — 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/SWBProtocol/SwiftSDK.swift:50— Sources/SWBProtocol/SwiftSDK.swift:50-57 | Sources/SwiftBuild/SWBSwiftSDK.swift:25-32 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:49— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:49-56 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/CopySwiftPackageResourcesTaskProducer.swift:40-47 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:526— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:526-533 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:535-542 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:526` 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1189— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1189-1196 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1216-1223 — 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1189` 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1214` calls `contains` and `Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1187` 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/SWBUtil/OutputByteStream.swift:436— Sources/SWBUtil/OutputByteStream.swift:436-443 | Sources/SWBUtil/OutputByteStream.swift:455-462 — 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:62— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:62-69 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:244-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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:62` 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 (8 lines × 2) Sources/SWBCore/ProjectModel/Project.swift:170— Sources/SWBCore/ProjectModel/Project.swift:170-177 | Sources/SWBCore/ProjectModel/Target.swift:295-302 — 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:1468— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1468-1475 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1864-1871 — 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:1468` 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.
ClassTooLong: SettingsBuilder Sources/SWBCore/Settings/Settings.swift:1229— ClassTooLong — 2567 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 2167 over it, 6.42× 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: InfoPlistProcessorTaskAction Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:23— ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 453 over it, 2.13× 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/SWBProjectModel/PIFGenerationModel.swift:22— ClassTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 367 over it, 1.92× 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: OperationSystemAdaptor Sources/SWBBuildSystem/BuildOperation.swift:1459— ClassTooLong — 676 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 276 over it, 1.69× 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: TaskProducerContext Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:55— ClassTooLong — 572 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 172 over it, 1.43× 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: SwiftBuildMessage Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:23— ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 104 over it, 1.26× 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: SwiftDriverJobTaskAction Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:20— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 67 over it, 1.17× 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: SDKRegistry Sources/SWBCore/SDKRegistry.swift:522— ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 47 over it, 1.12× 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: EmbedSwiftStdLibTaskAction Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:78— ClassTooLong — 439 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 39 over it, 1.10× 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: MachO Sources/SWBUtil/MachO.swift:765— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 38 over it, 1.10× 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.
Duplicated block (13 lines × 2) Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:117— Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:117-129 | Sources/SWBCore/SpecImplementations/Tools/AppShortcutStringsMetadataCompiler.swift:80-92 — 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/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:117` 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/SWBApplePlatform/AssetCatalogCompilerOutputParser.swift:23— Sources/SWBApplePlatform/AssetCatalogCompilerOutputParser.swift:23-35 | Sources/SWBApplePlatform/InterfaceBuilderCompilerOutputParser.swift:24-36 — 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/SWBApplePlatform/AssetCatalogCompilerOutputParser.swift:23` 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/SWBBuildService/PlanningOperation.swift:323— Sources/SWBBuildService/PlanningOperation.swift:323-335 | Sources/SWBBuildService/PlanningOperation.swift:362-374 — 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/SWBBuildService/PlanningOperation.swift:323` 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/SWBCAS/ToolchainCASPlugin.swift:192— Sources/SWBCAS/ToolchainCASPlugin.swift:192-204 | Sources/SWBCAS/ToolchainCASPlugin.swift:293-305 — 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/SWBCAS/ToolchainCASPlugin.swift:192` 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 (13 lines × 2) Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:367— Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:367-379 | Sources/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.swift:665-677 — 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/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:367` 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/SWBProtocol/MessageSupport.swift:84— Sources/SWBProtocol/MessageSupport.swift:84-96 | Sources/SwiftBuild/SWBBuildRequest.swift:118-130 — 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/SWBProtocol/MessageSupport.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:79— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:79-91 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/CopySwiftPackageResourcesTaskProducer.swift:25-37 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:79` 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 (13 lines × 2) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:342— Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:342-354 | Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:273-285 — 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/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:342` 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/SWBTestSupport/BuildOperationTester.swift:330— Sources/SWBTestSupport/BuildOperationTester.swift:330-342 | Sources/SWBTestSupport/TaskConstructionTester.swift:127-139 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SWBTestSupport/TaskConstructionTester.swift:124` calls `filterDiagnostic`, `formatLocalizedDescription` and `Sources/SWBTestSupport/BuildOperationTester.swift:329` 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:80— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:80-92 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:258-270 — 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/SWBMacro/MacroExpressionParsing.swift:373— Sources/SWBMacro/MacroExpressionParsing.swift:373-382 | Sources/SWBMacro/MacroExpressionParsing.swift:394-403 — 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/SWBMacro/MacroExpressionParsing.swift:373` 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 `parser` to `self) advance() if currentQuotes == .noQuotes && currChar == UInt8(ascii: "\""` in one and `self) advance() if currentQuotes == .noQuotes && currChar == UInt8(ascii: "\'"` 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 lines × 2) Sources/SWBProjectModel/PIFGenerationModel.swift:799— Sources/SWBProjectModel/PIFGenerationModel.swift:799-808 | Sources/SWBProtocol/ProjectModel/CustomTask.swift:27-36 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `commandLine` to `[String]` in one and `[MacroExpressionSource]` 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 lines × 2) Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:115— Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:115-124 | Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift:122-131 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift` as WHOLE FILES: this scan already matched 5 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. 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/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:115` 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 (10 lines × 2) Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41— Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41-50 | Sources/SWBTaskExecution/TaskActions/DeferredExecutionTaskAction.swift:28-37 — 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/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41` 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 lines × 2) Sources/SWBTestSupport/LibraryGeneration.swift:157— Sources/SWBTestSupport/LibraryGeneration.swift:157-166 | Sources/SWBTestSupport/LibraryGeneration.swift:273-282 — 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/SWBTestSupport/LibraryGeneration.swift:157` 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 (10 lines × 2) Sources/SWBUtil/PbxCp.swift:529— Sources/SWBUtil/PbxCp.swift:529-538 | Sources/SWBUtil/PbxCp.swift:539-548 — 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 (10 lines × 2) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:76— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:76-85 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:248-257 — 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:76` 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 lines × 2) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:209— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:209-218 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:340-349 — 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 (10 lines × 2) Sources/SWBProjectModel/PIFGenerationModel.swift:660— Sources/SWBProjectModel/PIFGenerationModel.swift:660-669 | Sources/SWBTestSupport/TestWorkspaces.swift:608-617 — 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/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:83— Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:83-92 | Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift:42-51 — 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 (12 lines × 2) Sources/SWBApplePlatform/DevelopmentAssetsTaskProducer.swift:19— Sources/SWBApplePlatform/DevelopmentAssetsTaskProducer.swift:19-30 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/DevelopmentAssetsTaskProducer.swift:18-29 — before extracting anything, compare `Sources/SWBApplePlatform/DevelopmentAssetsTaskProducer.swift` and `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/DevelopmentAssetsTaskProducer.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 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.
Duplicated block (12 lines × 2) Sources/SWBCore/Settings/Settings.swift:5168— Sources/SWBCore/Settings/Settings.swift:5168-5179 | Sources/SWBTaskConstruction/StaleFileRemovalContext.swift:76-87 — 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 (12 lines × 2) Sources/SWBProtocol/MessageSupport.swift:394— Sources/SWBProtocol/MessageSupport.swift:394-405 | Sources/SwiftBuild/SWBBuildParameters.swift:98-109 — 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/SWBProtocol/MessageSupport.swift:394` 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 × 2) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellBasedTaskProducer.swift:75— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellBasedTaskProducer.swift:75-86 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellBasedTaskProducer.swift:93-104 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellBasedTaskProducer.swift:75` 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 × 2) Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:50— Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:50-61 | Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:106-117 — 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/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:50` 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1283— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1283-1294 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1297-1308 — 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 (12 lines × 2) Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:39— Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:39-50 | Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.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/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:39` 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 (12 lines × 2) Sources/SWBUtil/PluginManager.swift:181— Sources/SWBUtil/PluginManager.swift:181-192 | Sources/SWBUtil/PluginManager.swift:222-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.
Duplicated block (12 lines × 2) Sources/SWBCore/SpecImplementations/ProductTypes.swift:304— Sources/SWBCore/SpecImplementations/ProductTypes.swift:304-315 | Sources/SWBCore/SpecImplementations/ProductTypes.swift:318-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:72— Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:72-134 | Sources/SWBApplePlatform/EXUtil.swift:41-68 | Sources/SWBApplePlatform/EXUtil.swift:92-123 | Sources/SWBCore/SpecImplementations/Tools/AppShortcutStringsMetadataCompiler.swift:20-97 — 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/SWBBuildService/Tools.swift:69— Sources/SWBBuildService/Tools.swift:69-114 | Sources/SWBBuildService/Tools.swift:246-291 | Sources/SWBBuildService/Tools.swift:363-408 | Sources/SWBBuildService/Tools.swift:493-538 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:880— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:880-957 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:959-1002 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1006-1077 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1079-1118 — 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/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:28— Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:28-50 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:124-188 | Sources/SWBTaskExecution/TaskActions/DeferredExecutionTaskAction.swift:24-37 | Sources/SWBTaskExecution/TaskActions/LSRegisterURLTaskAction.swift:23-62 — 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:51— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:51-67 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:40-54 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:112-124 | Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:28-38 — 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/SWBTestSupport/BuildOperationTester.swift:351— Sources/SWBTestSupport/BuildOperationTester.swift:351-358 | Sources/SWBTestSupport/BuildOperationTester.swift:674-680 | Sources/SWBTestSupport/TaskConstructionTester.swift:148-155 | Sources/SwiftBuildTestSupport/CoreQualificationTester.swift:176-183 — 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/SWBTestSupport/LibraryGeneration.swift:53— Sources/SWBTestSupport/LibraryGeneration.swift:53-94 | Sources/SWBTestSupport/LibraryGeneration.swift:97-200 | Sources/SWBTestSupport/LibraryGeneration.swift:244-301 | Sources/SWBTestSupport/LibraryGeneration.swift:306-361 — 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/SWBUtil/MachO.swift:1356— Sources/SWBUtil/MachO.swift:1356-1390 | Sources/SWBUtil/MachO.swift:1392-1409 | Sources/SWBUtil/MachO.swift:1411-1428 | Sources/SWBUtil/MachO.swift:1430-1447 — 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 (15 lines × 2) Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:57— Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:57-71 | Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:139-153 — 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 lines × 2) Sources/SWBBuildSystem/BuildOperation.swift:725— Sources/SWBBuildSystem/BuildOperation.swift:725-739 | Sources/SWBBuildSystem/BuildOperation.swift:764-778 — 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 lines × 2) Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:645— Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:645-659 | Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:670-684 — 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/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:645` 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/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:644` calls `resolveArgumentList` and `Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:669` 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 × 2) Sources/SWBCore/ToolchainRegistry.swift:231— Sources/SWBCore/ToolchainRegistry.swift:231-245 | Sources/SWBCore/ToolchainRegistry.swift:248-262 — 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 lines × 2) Sources/SWBMacro/MacroNamespace.swift:497— Sources/SWBMacro/MacroNamespace.swift:497-511 | Sources/SWBMacro/MacroNamespace.swift:519-533 — 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 (15 lines × 2) Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:45— Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:45-59 | Sources/SWBTaskExecution/TaskActions/ClangCachingOutputMaterializerTaskAction.swift:45-59 — 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/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:45` 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 (15 lines × 2) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:308— Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:308-322 | Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:358-372 — 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/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:308` 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/SWBUtil/MsgPack.swift:501— Sources/SWBUtil/MsgPack.swift:501-516 | Sources/SWBUtil/MsgPack.swift:660-674 — 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/SWBUtil/MsgPack.swift:501` 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/SWBBuildService/BuildServiceEntryPoint.swift:107— Sources/SWBBuildService/BuildServiceEntryPoint.swift:107-117 | Sources/SWBTestSupport/CoreTestSupport.swift:129-139 — 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 (11 lines × 2) Sources/SWBBuildSystem/BuildOperation.swift:2497— Sources/SWBBuildSystem/BuildOperation.swift:2497-2507 | Sources/SWBBuildSystem/BuildOperation.swift:2510-2520 — 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 (11 lines × 2) Sources/SWBCore/LinkageDependencyResolver.swift:470— Sources/SWBCore/LinkageDependencyResolver.swift:470-480 | Sources/SWBCore/LinkageDependencyResolver.swift:499-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBCore/LinkageDependencyResolver.swift:470` 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 (11 lines × 2) Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3821— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3821-3831 | Sources/SWBCore/ToolInfo/ClangToolInfo.swift:203-213 — 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 (11 lines × 2) Sources/SWBProtocol/MacroEvaluationMessages.swift:187— Sources/SWBProtocol/MacroEvaluationMessages.swift:187-197 | Sources/SwiftBuild/SWBMacroEvaluation.swift:62-72 — 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 (11 lines × 2) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:115— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:115-125 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:273-283 — 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:115` 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:128` calls `failure`, `invalidCommandError` and `Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:285` 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:1454— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1454-1464 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1853-1863 — 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:1454` 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:1465` calls `Set`, `contains`, `next` and `Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1864` 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 (11 lines × 2) Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3124— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3124-3134 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3171-3181 — 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/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3124` 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/SWBBuildService/Messages.swift:1188— Sources/SWBBuildService/Messages.swift:1188-1192 | Sources/SWBBuildService/Messages.swift:1211-1215 | Sources/SWBBuildService/Messages.swift:1232-1236 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `DescribeSchemesRequest` in one and `DescribeProductsRequest` 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/SWBBuildService/Messages.swift:1208` calls `lookup`, `error` and `Sources/SWBBuildService/Messages.swift:1187` 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 × 3) Sources/SWBCore/ProjectModel/Reference.swift:230— Sources/SWBCore/ProjectModel/Reference.swift:230-234 | Sources/SWBCore/ProjectModel/Reference.swift:260-264 | Sources/SWBCore/ProjectModel/Reference.swift:298-302 — 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/SWBCore/ProjectModel/Reference.swift:230` 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 after the matched lines, `Sources/SWBCore/ProjectModel/Reference.swift:306` calls `parseValueForKeyAsString` and `Sources/SWBCore/ProjectModel/Reference.swift:238` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) Sources/SWBCore/TaskGeneration.swift:1327— Sources/SWBCore/TaskGeneration.swift:1327-1331 | Sources/SWBProtocol/MessageSupport.swift:613-617 | Sources/SwiftBuild/SWBLocalizationSupport.swift:60-64 — 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 (5 lines × 3) Sources/SWBProtocol/BuildSettingsInfoMessageTypes.swift:22— Sources/SWBProtocol/BuildSettingsInfoMessageTypes.swift:22-26 | Sources/SWBProtocol/ProjectDescriptorMessages.swift:29-33 | Sources/SWBProtocol/ProjectDescriptorMessages.swift:147-151 — 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 (5 lines × 3) Sources/SWBMacro/MacroConditionExpression.swift:434— Sources/SWBMacro/MacroConditionExpression.swift:434-438 | Sources/SWBMacro/MacroConditionExpression.swift:450-454 | Sources/SWBMacro/MacroConditionExpression.swift:498-502 — 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/SWBMacro/MacroConditionExpression.swift:434` 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/SWBCore/SpecImplementations/Tools/CCompiler.swift:894— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:894-903 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:320-324 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:823-833 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:894` 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/SWBTestSupport/TestWorkspaces.swift:919— Sources/SWBTestSupport/TestWorkspaces.swift:919-923 | Sources/SWBTestSupport/TestWorkspaces.swift:1353-1357 | Sources/SWBTestSupport/TestWorkspaces.swift:1415-1419 — 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/SWBTestSupport/TestWorkspaces.swift:919` 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.
Swallowed exception (empty catch) Sources/SWBTaskExecution/BuildDescription.swift:344— 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1573— 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:561— 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/SWBMacro/MacroCondition.swift:74— 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/SWBCore/BuildRuleCondition.swift:106— 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/SWBCore/Settings/RecursiveSearchPathResolver.swift:182— 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/SWBBuildSystem/CleanOperation.swift:191— 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.
HackComment Tests/SwiftBuildTests/BuildLogTests.swift:897— // HACK: <rdar://67845004> Work around false race in TSan; this second call to sendPIF() should not be needed but for some reason it makes the TSan issue go away. — 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.
HackComment Tests/SWBBuildSystemTests/ClangCompilationCachingTests.swift:1034— // Hack to reset the build system's cache of the `CommandLineToolSpecInfo`, — 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.
HackComment Sources/SWBCore/Core.swift:795— // NASTY HACK: If the productsPath is the CodeCoverage directory, then we try to find the 'real' products dir, since Xcode itself doesn't build into that folder. This scenario happens when running Swift Build unit tests on the desktop. — 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.
HackComment Sources/SWBCore/SpecImplementations/SpecRegistry.swift:618— // HACK: Force the class for the app extension product type. We do it in this way because we want to preserve the inheritance hierarchy (ApplicationExtensionProductType *is* a BundleProductType), so we can't use registerSpecOverrideClass. Going forward, we should set PBXApplicationExtensionProductType in the actual spec, but doing so would require changing the legacy build system, so this may be a light weight compromise for now. We also can't do a conformance check here, and wouldn't want to anyways, because we don't want to override a (potentially derived) class of PBXApplicationExtensionProductType. — 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.
HackComment Sources/SWBAndroidPlatform/Plugin.swift:31— // HACK: The place where this is used is challenging to convert to async, and effectiveInstallation() will be called before it is. — 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.
HackComment Sources/SWBAndroidPlatform/Plugin.swift:177— // HACK: All information in swift-toolset.json for Android Swift SDKs is redundant. — 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.
Change coupling: BuiltinTaskActionsExtension.swift ↔ CapturingTaskGenerationDelegate.swift Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift:1— `Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift` and `Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift` change together 92% of the time (11 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `9a760991` Indexing: build explicit module dependencies for leaf targets during …; `70f1baa6` Revert "Rewrite TouchTool to use FSProxy instead of shell utilities"; `e7cbaf49` Rewrite TouchTool to use FSProxy instead of shell utilities — run `git show` on any of them.
Change coupling: BuiltinTaskActionsExtension.swift ↔ TaskPlanningTestSupport.swift Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift:1— `Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift` and `Sources/SWBTestSupport/TaskPlanningTestSupport.swift` change together 92% of the time (11 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `9a760991` Indexing: build explicit module dependencies for leaf targets during …; `70f1baa6` Revert "Rewrite TouchTool to use FSProxy instead of shell utilities"; `e7cbaf49` Rewrite TouchTool to use FSProxy instead of shell utilities — run `git show` on any of them.
Change coupling: Plugin.swift ↔ Plugin.swift Sources/SWBAndroidPlatform/Plugin.swift:1— `Sources/SWBAndroidPlatform/Plugin.swift` and `Sources/SWBQNXPlatform/Plugin.swift` change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `12ab5c07` Fill out platformName extension point for other platforms; `3ab87e8a` Refactor the plugin loading a bit to minimize compile-time difference…; `e7543d15` Read hardcoded deployment targets list from features.json instead — run `git show` on any of them.
Change coupling: BuiltinMacros.swift ↔ TestEntryPointGenerationTaskAction.swift Sources/SWBCore/Settings/BuiltinMacros.swift:1— `Sources/SWBCore/Settings/BuiltinMacros.swift` and `Sources/SWBUniversalPlatform/TestEntryPointGenerationTaskAction.swift` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `f3e60781` Generate a test anchor runner executables can use to force linkage; `1d6c598a` Fix linker filelist parsing when discovering tests; `133a6108` Reapply "Allow opting into Swift Testing entrypoints for macOS test b… — run `git show` on any of them.
Change coupling: RunDestinationTestSupport.swift ↔ Plugin.swift Sources/SWBTestSupport/RunDestinationTestSupport.swift:1— `Sources/SWBTestSupport/RunDestinationTestSupport.swift` and `Sources/SWBWebAssemblyPlatform/Plugin.swift` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `fcfdc3be` Revert "Add support for Emscripten platform separate from WASI (#1335…; `30bbc84e` Add support for Emscripten platform separate from WASI (#1335); `48dcc97c` Cleanup old WebAssembly SDK synthesis — run `git show` on any of them.
Change coupling: PlatformInfoExtension.swift ↔ WorkspaceContext.swift Sources/SWBCore/Extensions/PlatformInfoExtension.swift:1— `Sources/SWBCore/Extensions/PlatformInfoExtension.swift` and `Sources/SWBCore/WorkspaceContext.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `e6a196c8` Remove the manual Swift SDK lookup from Linux/FreeBSD/OpenBSD platforms; `a25c8684` Cleanup old Android SDK synthesis; `3088ae7e` Reapply "Swift SDK for WASM using the run destination" — run `git show` on any of them.
Duplicated block (14 lines × 2) Sources/SWBBuildService/Tools.swift:319— Sources/SWBBuildService/Tools.swift:319-332 | Sources/SWBBuildService/Tools.swift:436-449 — 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/SWBBuildService/Tools.swift:319` 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/SWBBuildSystem/DependencyCycleFormatter.swift:302— Sources/SWBBuildSystem/DependencyCycleFormatter.swift:302-315 | Sources/SWBBuildSystem/DependencyCycleFormatter.swift:547-560 — 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/SWBBuildSystem/DependencyCycleFormatter.swift:302` 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 (14 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:128— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:128-141 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:117-130 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:128` 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/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:43— Sources/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:43-56 | Sources/SWBTaskExecution/TaskActions/SwiftCachingOutputMaterializerTaskAction.swift:45-58 — 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/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:43` 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/SWBTestSupport/TaskConstructionTester.swift:244— Sources/SWBTestSupport/TaskConstructionTester.swift:244-257 | Sources/SWBTestSupport/TaskConstructionTester.swift:287-300 — 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/SWBTestSupport/TaskConstructionTester.swift:244` 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 (11 lines × 3) Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:98— Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:98-108 | Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:59-69 | Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:141-151 — 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 (11 lines × 3) Sources/SWBCore/SDKRegistry.swift:844— Sources/SWBCore/SDKRegistry.swift:844-854 | Sources/SWBCore/SDKRegistry.swift:857-867 | Sources/SWBCore/SDKRegistry.swift:870-880 — 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/SWBCore/SDKRegistry.swift:844` 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/SWBCore/ToolchainRegistry.swift:209— Sources/SWBCore/ToolchainRegistry.swift:209-219 | Sources/SWBCore/ToolchainRegistry.swift:232-242 | Sources/SWBCore/ToolchainRegistry.swift:249-259 — 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/SWBCore/ToolchainRegistry.swift:209` 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 × 3) Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:244— Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:244-254 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:184-195 | Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:159-169 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 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/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:244` 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/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:499— Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:499-509 | Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift:163-173 | Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift:198-208 — 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 (17 lines × 2) Sources/SWBApplePlatform/CoreMLCompiler.swift:169— Sources/SWBApplePlatform/CoreMLCompiler.swift:169-185 | Sources/SWBApplePlatform/IntentsCompiler.swift:161-177 — before extracting anything, compare `Sources/SWBApplePlatform/CoreMLCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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/SWBApplePlatform/CoreMLCompiler.swift:169` 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 `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. 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 (17 lines × 2) Sources/SWBCore/Settings/CASOptions.swift:142— Sources/SWBCore/Settings/CASOptions.swift:142-158 | Sources/SWBProtocol/BuildOperationMessages.swift:1101-1117 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:279— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:279-295 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1759-1775 — 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 (17 lines × 2) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:131— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:131-147 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:285-301 — 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:131` 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 before the matched lines, `Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:128` calls `failure`, `invalidCommandError` and `Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:283` 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 (16 lines × 2) Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:186— Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:186-201 | Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift:193-208 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift` as WHOLE FILES: this scan already matched 5 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. 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/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:186` 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 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 (16 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:175— Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:175-190 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:124-139 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 83 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/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/SWBUtil/HashContext.swift:85— Sources/SWBUtil/HashContext.swift:85-100 | Sources/SWBUtil/HashContext.swift:126-141 — 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/SWBUtil/HashContext.swift:85` 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 (16 lines × 2) Sources/SWBUtil/Serialization.swift:628— Sources/SWBUtil/Serialization.swift:628-643 | Sources/SWBUtil/Serialization.swift:661-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.
Duplicated block (5 lines × 5) Sources/SWBApplePlatform/PluginDCLT.swift:91— Sources/SWBApplePlatform/PluginDCLT.swift:91-96 | Sources/SWBGenericUnixPlatform/Plugin.swift:121-125 | Sources/SWBQNXPlatform/Plugin.swift:62-66 | Sources/SWBUniversalPlatform/BareMetal.swift:25-29 | Sources/SWBWebAssemblyPlatform/Plugin.swift:40-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBApplePlatform/PluginDCLT.swift:91` 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 (5 lines × 5) Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:89— Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:89-93 | Sources/SWBTaskExecution/TaskActions/ClangCachingOutputMaterializerTaskAction.swift:85-89 | Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:259-263 | Sources/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:86-90 | Sources/SWBTaskExecution/TaskActions/SwiftCachingOutputMaterializerTaskAction.swift:81-85 — 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 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:85` calls `cancelDetached` and `Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:256` 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 × 5) Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:95— Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:95-99 | Sources/SWBTaskExecution/TaskActions/ClangCachingOutputMaterializerTaskAction.swift:91-95 | Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:265-269 | Sources/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:92-96 | Sources/SWBTaskExecution/TaskActions/SwiftCachingOutputMaterializerTaskAction.swift:87-91 — 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 5 call sites, so a change lands once.
Duplicated block (5 lines × 5) Sources/SwiftBuild/ProjectModel/BuildPhases.swift:261— Sources/SwiftBuild/ProjectModel/BuildPhases.swift:261-265 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:283-287 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:305-309 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:327-331 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:379-383 — 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/SwiftBuild/ProjectModel/BuildPhases.swift:261` 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.
Off the main sequence: SWBLLBuild (SwiftPM) — SWBLLBuild (SwiftPM): abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: SWBMacro (SwiftPM) — SWBMacro (SwiftPM): abstractness 0.09, instability 0.10, distance 0.81 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: SWBProtocol (SwiftPM) — SWBProtocol (SwiftPM): abstractness 0.05, instability 0.20, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: SWBUtil (SwiftPM) — SWBUtil (SwiftPM): abstractness 0.16, instability 0.10, distance 0.74 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
Options.init (cyclomatic 16) Sources/SWBTaskExecution/TaskActions/ClangModuleVerifierInputGeneratorTaskAction.swift:29— Options.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.
Options.init (cyclomatic 16) Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:74— Options.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.
Options.init (cyclomatic 16) Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:45— Options.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.
Duplicated block (23 lines × 2) Sources/SWBApplePlatform/CoreMLCompiler.swift:281— Sources/SWBApplePlatform/CoreMLCompiler.swift:281-303 | Sources/SWBApplePlatform/IntentsCompiler.swift:235-257 — before extracting anything, compare `Sources/SWBApplePlatform/CoreMLCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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 (23 lines × 2) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:93— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:93-115 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:162-184 — 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:93` 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 (23 lines × 2) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:63— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:63-85 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:121-143 — 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:63` 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 × 3) Sources/SWBCore/PlatformRegistry.swift:288— Sources/SWBCore/PlatformRegistry.swift:288-301 | Sources/SWBCore/PlatformRegistry.swift:309-322 | Sources/SWBCore/PlatformRegistry.swift:332-345 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `considerTargetDeviceOSVersion` to `Bool = true` in one and `Bool` 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 (14 lines × 3) Sources/SWBMacro/MacroEvaluationScope.swift:204— Sources/SWBMacro/MacroEvaluationScope.swift:204-217 | Sources/SWBMacro/MacroEvaluationScope.swift:237-250 | Sources/SWBMacro/MacroEvaluationScope.swift:268-281 — 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/SWBMacro/MacroEvaluationScope.swift:204` 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:131— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:131-144 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:200-213 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:269-282 — 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:131` 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 × 3) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:123— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:123-134 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:174-187 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:120-133 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:123` 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) Sources/SWBUtil/MachO.swift:1393— Sources/SWBUtil/MachO.swift:1393-1404 | Sources/SWBUtil/MachO.swift:1412-1423 | Sources/SWBUtil/MachO.swift:1431-1442 — 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. 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 × 3) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:117— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:117-128 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:186-197 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:255-266 — 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 (7 lines × 3) Sources/SWBBuildService/BuildOperationMessages.swift:546— Sources/SWBBuildService/BuildOperationMessages.swift:546-552 | Sources/SWBBuildService/BuildOperationMessages.swift:558-564 | Sources/SWBBuildService/BuildOperationMessages.swift:570-576 — 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/SWBBuildService/BuildOperationMessages.swift:546` 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 × 3) Sources/SWBCore/ProjectModel/Reference.swift:238— Sources/SWBCore/ProjectModel/Reference.swift:238-244 | Sources/SWBCore/ProjectModel/Reference.swift:269-275 | Sources/SWBCore/ProjectModel/Reference.swift:308-314 — 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/SWBCore/ProjectModel/Reference.swift:269` 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/SWBCore/ProjectModel/Reference.swift:306` calls `parseValueForKeyAsString` and `Sources/SWBCore/ProjectModel/Reference.swift:236` 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 (7 lines × 3) Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:20— Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:20-26 | Sources/SWBCore/SpecImplementations/Tools/SwiftABIGenerationTool.swift:20-26 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3743-3749 — 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. 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 × 4) Sources/SWBTestSupport/BuildOperationTester.swift:354— Sources/SWBTestSupport/BuildOperationTester.swift:354-358 | Sources/SWBTestSupport/BuildOperationTester.swift:676-680 | Sources/SWBTestSupport/TaskConstructionTester.swift:151-155 | Sources/SwiftBuildTestSupport/CoreQualificationTester.swift:179-183 — there are 4 copies across 3 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 4 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/SWBTestSupport/BuildOperationTester.swift:354` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `kind` to `DiagnosticKind` in one and `BuildOperationTester.DiagnosticKind` 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 (5 lines × 4) Sources/SWBTestSupport/LibraryGeneration.swift:54— Sources/SWBTestSupport/LibraryGeneration.swift:54-58 | Sources/SWBTestSupport/LibraryGeneration.swift:163-167 | Sources/SWBTestSupport/LibraryGeneration.swift:279-283 | Sources/SWBTestSupport/LibraryGeneration.swift:333-337 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:32— Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:32-36 | Sources/SWBTaskExecution/TaskActions/RegisterExecutionPolicyExceptionTaskAction.swift:28-32 | Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:26-30 | Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:25-29 — 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 4 call sites, so a change lands once.
D10 · Test Quality· Test project verifies nothing · ×2
Test project verifies nothing: SWBServiceCoreTests Tests/SWBServiceCoreTests/ServiceCoreTests.swift:16— No conventional assertion call was detected in 1 of 1 tests in `SWBServiceCoreTests` — 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: SWBWebAssemblyPlatformTests Tests/SWBWebAssemblyPlatformTests/SWBWebAssemblyPlatformTests.swift:22— No conventional assertion call was detected in 3 of 3 tests in `SWBWebAssemblyPlatformTests` — 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.
Options.init (cognitive 17) Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:138— Options.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), boolean chains 1, 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.
Options.init (cognitive 17) Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:89— Options.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), boolean chains 1, 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.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/SWBAndroidPlatform/Plugin.swift:116— Sources/SWBAndroidPlatform/Plugin.swift:116-138 | Sources/SWBApplePlatform/PluginDCLT.swift:51-113 | Sources/SWBGenericUnixPlatform/Plugin.swift:100-128 | Sources/SWBQNXPlatform/Plugin.swift:56-68 | Sources/SWBQNXPlatform/Plugin.swift:82-144 | Sources/SWBUniversalPlatform/BareMetal.swift:19-31 | Sources/SWBWebAssemblyPlatform/Plugin.swift:34-46 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) Sources/SWBBuildService/BuildDescriptionMessages.swift:160— Sources/SWBBuildService/BuildDescriptionMessages.swift:160-192 | Sources/SWBBuildService/Messages.swift:745-828 | Sources/SWBBuildService/Messages.swift:837-865 | Sources/SWBBuildService/Messages.swift:947-980 | Sources/SWBBuildService/Messages.swift:989-1018 | Sources/SWBBuildService/Messages.swift:1093-1136 | Sources/SWBBuildService/Messages.swift:1315-1364 — These 7 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 7 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 7 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:90— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:90-199 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:74-164 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:44-113 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:138-230 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:89-176 — 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/SwiftBuild/ProjectModel/BuildPhases.swift:261— Sources/SwiftBuild/ProjectModel/BuildPhases.swift:261-266 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:283-288 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:305-310 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:327-332 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:379-396 — 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 (15–16 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:224— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:224-238 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:184-199 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.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. 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–16 lines × 2) Sources/SWBUtil/MsgPack.swift:159— Sources/SWBUtil/MsgPack.swift:159-174 | Sources/SWBUtil/MsgPack.swift:284-298 — 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/SWBUtil/MsgPack.swift:159` 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/SWBUtil/MsgPack.swift:299` calls `UInt8` and `Sources/SWBUtil/MsgPack.swift:175` 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 (14 lines × 4) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:921— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:921-934 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:976-989 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1047-1060 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1096-1109 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:992` calls `addTBDSymlinkTasks` and `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1111` 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 (14 lines × 4) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:412— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:412-428 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:438-451 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:460-473 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:524-540 — 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.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 (6 lines × 3) Sources/SWBTestSupport/LibraryGeneration.swift:162— Sources/SWBTestSupport/LibraryGeneration.swift:162-167 | Sources/SWBTestSupport/LibraryGeneration.swift:278-283 | Sources/SWBTestSupport/LibraryGeneration.swift:332-337 — 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/SWBTestSupport/LibraryGeneration.swift:162` 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 × 3) Sources/SWBCore/SpecImplementations/Tools/AppShortcutStringsMetadataCompiler.swift:139— Sources/SWBCore/SpecImplementations/Tools/AppShortcutStringsMetadataCompiler.swift:139-144 | Sources/SWBCore/SpecImplementations/Tools/DocumentationCompiler.swift:529-534 | Sources/SWBCore/SpecImplementations/Tools/SwiftABICheckerTool.swift:127-132 — 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 (21 lines × 2) Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:89— Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:89-109 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:45-65 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 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 (21 lines × 2) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:96— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:96-116 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:166-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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingUploader.swift:96` 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.
SourcesTaskProducer.generateTasks (cyclomatic 163) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:891— SourcesTaskProducer.generateTasks has cyclomatic complexity 163 (threshold 15). Of this number, 157 points are the body's own statements and 6 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.
SourcesTaskProducer.computeLibraries (cyclomatic 101) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:373— SourcesTaskProducer.computeLibraries has cyclomatic complexity 101 (threshold 15). Of this number, 87 points are the body's own statements and 14 belong to 3 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.
SettingsBuilder.getCommonTargetTaskOverrides (cyclomatic 85) Sources/SWBCore/Settings/Settings.swift:4426— SettingsBuilder.getCommonTargetTaskOverrides has cyclomatic complexity 85 (threshold 15). Of this number, 71 points are the body's own statements and 14 belong to 3 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.
TargetDependencyResolver.computeGraph (cyclomatic 83) Sources/SWBCore/TargetDependencyResolver.swift:286— TargetDependencyResolver.computeGraph has cyclomatic complexity 83 (threshold 15). Of this number, 78 points are the body's own statements and 5 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.
SDKRegistry.registerSDK (cyclomatic 76) Sources/SWBCore/SDKRegistry.swift:636— SDKRegistry.registerSDK has cyclomatic complexity 76 (threshold 15). Of this number, 71 points are the body's own statements and 5 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.
CopyFilesTaskProducer.addTasksForUngroupedFile (cyclomatic 76) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:204— CopyFilesTaskProducer.addTasksForUngroupedFile has cyclomatic complexity 76 (threshold 15). Of this number, 69 points are the body's own statements and 7 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.
BuildDescription.construct (cyclomatic 66) Sources/SWBTaskExecution/BuildDescription.swift:1140— BuildDescription.construct has cyclomatic complexity 66 (threshold 15). Of this number, 58 points are the body's own statements and 8 belong to 4 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.
FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles (cyclomatic 63) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:420— FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles has cyclomatic complexity 63 (threshold 15). Of this number, 52 points are the body's own statements and 11 belong to 4 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.
SettingsBuilder.construct (cyclomatic 61) Sources/SWBCore/Settings/Settings.swift:1487— SettingsBuilder.construct 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.
InfoPlistProcessorTaskAction.performTaskAction (cyclomatic 57) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:54— InfoPlistProcessorTaskAction.performTaskAction has cyclomatic complexity 57 (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.
SettingsBuilder.analyzeSettings (cyclomatic 54) Sources/SWBCore/Settings/Settings.swift:5761— SettingsBuilder.analyzeSettings has cyclomatic complexity 54 (threshold 15). Of this number, 52 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.
BuildOperation._build (cyclomatic 53) Sources/SWBBuildSystem/BuildOperation.swift:538— BuildOperation._build has cyclomatic complexity 53 (threshold 15). Of this number, 51 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.
ActoolCompilerSpec.constructTasks (cyclomatic 52) Sources/SWBApplePlatform/AssetCatalogCompiler.swift:129— ActoolCompilerSpec.constructTasks has cyclomatic complexity 52 (threshold 15). Of this number, 33 points are the body's own statements and 19 belong to 5 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.
ExecutableTask.formattedRuleInfo (cyclomatic 51) Sources/SWBTaskConstruction/DiagnosticSupport.swift:100— ExecutableTask.formattedRuleInfo has cyclomatic complexity 51 (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.
DependencyResolver.lookupConfiguredTarget (cyclomatic 49) Sources/SWBCore/DependencyResolution.swift:793— DependencyResolver.lookupConfiguredTarget has cyclomatic complexity 49 (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.
RunningTask.init (cyclomatic 48) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:229— RunningTask.init has cyclomatic complexity 48 (threshold 15). Of this number, 46 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.
SWBBuildOperation.handleMessage (cyclomatic 48) Sources/SwiftBuild/SWBBuildOperation.swift:102— SWBBuildOperation.handleMessage has cyclomatic complexity 48 (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.
SettingsBuilder.computeBoundProperties (cyclomatic 45) Sources/SWBCore/Settings/Settings.swift:1811— SettingsBuilder.computeBoundProperties has cyclomatic complexity 45 (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.
Toolchain.init (cyclomatic 42) Sources/SWBCore/ToolchainRegistry.swift:113— Toolchain.init 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.
SettingsBuilder.getBuildPhaseTargetTaskOverrides (cyclomatic 42) Sources/SWBCore/Settings/Settings.swift:5127— SettingsBuilder.getBuildPhaseTargetTaskOverrides 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.
XCFramework.parseCommandLine (cyclomatic 41) Sources/SWBCore/XCFramework.swift:843— XCFramework.parseCommandLine has cyclomatic complexity 41 (threshold 15). Of this number, 36 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
LinkageDependencyResolver.dependencies (cyclomatic 40) Sources/SWBCore/LinkageDependencyResolver.swift:215— LinkageDependencyResolver.dependencies has cyclomatic complexity 40 (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.
LegacySwiftCommandOutputParser.handleMessage (cyclomatic 40) Sources/SWBCore/SwiftOutputParsing.swift:397— LegacySwiftCommandOutputParser.handleMessage has cyclomatic complexity 40 (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.
fnmatch.swift.fnmatch (cyclomatic 40) Sources/SWBUtil/fnmatch.swift:47— fnmatch.swift.fnmatch has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 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.
SettingsBuilder.addRunDestinationSettingsPlatformSDK (cyclomatic 38) Sources/SWBCore/Settings/Settings.swift:3846— SettingsBuilder.addRunDestinationSettingsPlatformSDK has cyclomatic complexity 38 (threshold 15). Of this number, 36 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.
PlatformRegistry.registerPlatform (cyclomatic 37) Sources/SWBCore/PlatformRegistry.swift:441— PlatformRegistry.registerPlatform has cyclomatic complexity 37 (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.
ScannerState.getNextToken (cyclomatic 37) Sources/SWBMacro/MacroConditionExpression.swift:607— ScannerState.getNextToken has cyclomatic complexity 37 (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.
SettingsBuilder.computeSigningSettings (cyclomatic 36) Sources/SWBCore/Settings/Settings.swift:4034— SettingsBuilder.computeSigningSettings has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 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.
InfoPlistProcessorTaskAction.parseConfiguration (cyclomatic 36) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:378— InfoPlistProcessorTaskAction.parseConfiguration has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SwiftDriverJobTaskAction.performTaskAction (cyclomatic 35) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:343— SwiftDriverJobTaskAction.performTaskAction has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 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.
SettingsBuilder.addSDKSettings (cyclomatic 34) Sources/SWBCore/Settings/Settings.swift:2750— SettingsBuilder.addSDKSettings 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.
GlobalProductPlan.computeModuleInfo (cyclomatic 34) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1455— GlobalProductPlan.computeModuleInfo has cyclomatic complexity 34 (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.
SWBServiceConsoleBuildCommand.perform (cyclomatic 34) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:51— SWBServiceConsoleBuildCommand.perform 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.
CoreMLCompilerSpec.constructCoreMLCodeGenerationTasks (cyclomatic 32) Sources/SWBApplePlatform/CoreMLCompiler.swift:134— CoreMLCompilerSpec.constructCoreMLCodeGenerationTasks has cyclomatic complexity 32 (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.
DependencyCycleFormatter.formattedSingleTargetCycleOutput (cyclomatic 32) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:461— DependencyCycleFormatter.formattedSingleTargetCycleOutput has cyclomatic complexity 32 (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.
GlobalProductPlan.computeIPIClangInfo (cyclomatic 32) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:752— GlobalProductPlan.computeIPIClangInfo has cyclomatic complexity 32 (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.
GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage (cyclomatic 32) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1134— GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage has cyclomatic complexity 32 (threshold 15). Of this number, 27 points are the body's own statements and 5 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.
IntentsCompilerSpec.constructIntentsCodeGenerationTasks (cyclomatic 30) Sources/SWBApplePlatform/IntentsCompiler.swift:124— IntentsCompilerSpec.constructIntentsCodeGenerationTasks has cyclomatic complexity 30 (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.
MacroEvaluationProgram.executeInContext (cyclomatic 29) Sources/SWBMacro/MacroEvaluationProgram.swift:372— MacroEvaluationProgram.executeInContext 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.
BuildPlan.init (cyclomatic 29) Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:88— BuildPlan.init 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.
TAPISymbolExtractorTaskProducer.computeHeadersInputList (cyclomatic 29) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift:184— TAPISymbolExtractorTaskProducer.computeHeadersInputList has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 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.
InfoPlistProcessorTaskAction.validatePlistContents (cyclomatic 29) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1397— InfoPlistProcessorTaskAction.validatePlistContents 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.
Path.join (cyclomatic 29) Sources/SWBUtil/Path.swift:499— Path.join 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.
DependencyCycleFormatter.formattedMultiTargetCycleOutput (cyclomatic 28) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:331— DependencyCycleFormatter.formattedMultiTargetCycleOutput 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.
ProductTypeSpec.addFileListInstallAPITasks (cyclomatic 28) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:682— ProductTypeSpec.addFileListInstallAPITasks 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.
ShellScriptTaskProducer.generateTasks (cyclomatic 28) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift:144— ShellScriptTaskProducer.generateTasks has cyclomatic complexity 28 (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.
GenericCachingTaskAction.performTaskAction (cyclomatic 28) Sources/SWBTaskExecution/TaskActions/GenericCachingTaskAction.swift:67— GenericCachingTaskAction.performTaskAction 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.
SWBBuildServiceConnection.buildServiceLocation (cyclomatic 28) Sources/SwiftBuild/SWBBuildServiceConnection.swift:469— SWBBuildServiceConnection.buildServiceLocation 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.
AppIntentsMetadataTaskProducer.generateTasks (cyclomatic 27) Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:50— AppIntentsMetadataTaskProducer.generateTasks 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.
MacroExpressionParser.parseQuotedExpressionStringElement (cyclomatic 27) Sources/SWBMacro/MacroExpressionParsing.swift:332— MacroExpressionParser.parseQuotedExpressionStringElement 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.
ModuleMapTaskProducer.generateTasks (cyclomatic 27) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:176— ModuleMapTaskProducer.generateTasks 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.
ClangCompileTaskAction.performTaskAction (cyclomatic 27) Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:175— ClangCompileTaskAction.performTaskAction 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.
RunningTask.main (cyclomatic 27) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:756— RunningTask.main 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.
BuildOperation.build (cyclomatic 26) Sources/SWBBuildSystem/BuildOperation.swift:366— BuildOperation.build has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 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.
XCFramework.createXCFramework (cyclomatic 26) Sources/SWBCore/XCFramework.swift:1115— XCFramework.createXCFramework has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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.
SettingsBuilder.getTargetDerivedSettings (cyclomatic 26) Sources/SWBCore/Settings/Settings.swift:2255— SettingsBuilder.getTargetDerivedSettings 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.
SettingsBuilder.bindDeploymentTarget (cyclomatic 26) Sources/SWBCore/Settings/Settings.swift:5608— SettingsBuilder.bindDeploymentTarget has cyclomatic complexity 26 (threshold 15). Of this number, 23 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.
GlobalProductPlan.generatesModuleMap (cyclomatic 26) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1585— GlobalProductPlan.generatesModuleMap 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.
ProcessXCFrameworkTaskAction.performTaskAction (cyclomatic 26) Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:24— ProcessXCFrameworkTaskAction.performTaskAction 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.
SwiftDriverJobSchedulingTaskAction.taskDependencyReady (cyclomatic 26) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:64— SwiftDriverJobSchedulingTaskAction.taskDependencyReady has cyclomatic complexity 26 (threshold 15). Of this number, 25 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.
OperationSystemAdaptor.determinedRuleNeedsToRun (cyclomatic 25) Sources/SWBBuildSystem/BuildOperation.swift:2550— OperationSystemAdaptor.determinedRuleNeedsToRun 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.
ShellScript.swift.computeScriptEnvironment (cyclomatic 25) Sources/SWBCore/ShellScript.swift:80— ShellScript.swift.computeScriptEnvironment has cyclomatic complexity 25 (threshold 15). 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.
MacroExpressionParser.parseSubstitutionSubexpression (cyclomatic 25) Sources/SWBMacro/MacroExpressionParsing.swift:122— MacroExpressionParser.parseSubstitutionSubexpression 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.
LinkAssetCatalogTaskAction.performLinkAssetCatalogTaskAction (cyclomatic 25) Sources/SWBTaskExecution/TaskActions/LinkAssetCatalogTaskAction.swift:44— LinkAssetCatalogTaskAction.performLinkAssetCatalogTaskAction 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 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.
SwiftDriverTaskAction.performTaskAction (cyclomatic 25) Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift:34— SwiftDriverTaskAction.performTaskAction 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.
BuildRequestContext.selectConfiguredTargetForIndex (cyclomatic 24) Sources/SWBCore/BuildRequestContext.swift:254— BuildRequestContext.selectConfiguredTargetForIndex has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (selectWithoutRunDestination, platformAndSDKVariant, matchesPlatform). 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.
MacroConfigFileLoader.loadSettingsFromConfig::foundPreprocessorInclusion (cyclomatic 24) Sources/SWBCore/MacroConfigFileLoader.swift:133— MacroConfigFileLoader.loadSettingsFromConfig::foundPreprocessorInclusion has cyclomatic complexity 24 (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.
SettingsBuilder.addSwiftSDKToolsetSettings (cyclomatic 24) Sources/SWBCore/Settings/Settings.swift:2982— SettingsBuilder.addSwiftSDKToolsetSettings has cyclomatic complexity 24 (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.
TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles::visit (cyclomatic 24) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1568— TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles::visit has cyclomatic complexity 24 (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.
TaskProducerContext.forEachBuildProductToSourceMapping (cyclomatic 24) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift:86— TaskProducerContext.forEachBuildProductToSourceMapping has cyclomatic complexity 24 (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.
XCFrameworkTaskProducer.prepare (cyclomatic 24) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift:35— XCFrameworkTaskProducer.prepare has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 2 function items inside it that branch (xcframeworksFor, recursiveBuildFilesForPackageProducts). 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.
PrecompileClangModuleTaskAction.performTaskAction (cyclomatic 24) Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:130— PrecompileClangModuleTaskAction.performTaskAction has cyclomatic complexity 24 (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.
OperatingSystem.parseOSRelease (cyclomatic 24) Sources/SWBUtil/ProcessInfo.swift:282— OperatingSystem.parseOSRelease has cyclomatic complexity 24 (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.
SWBBuildServer.reportEventStream (cyclomatic 24) Sources/SwiftBuild/SWBBuildServer.swift:425— SWBBuildServer.reportEventStream has cyclomatic complexity 24 (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.
SettingsBuilder.addPlatformSettings (cyclomatic 23) Sources/SWBCore/Settings/Settings.swift:2567— SettingsBuilder.addPlatformSettings 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.
XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks (cyclomatic 23) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks 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.
BuildDescriptionManager.loadBuildDescription (cyclomatic 23) Sources/SWBTaskExecution/BuildDescriptionManager.swift:546— BuildDescriptionManager.loadBuildDescription 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.
Options.init (cyclomatic 23) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:90— Options.init 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.
InfoPlistProcessorTaskAction.editPlatformSpecificEntries (cyclomatic 23) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1111— InfoPlistProcessorTaskAction.editPlatformSpecificEntries has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.
LLVMStyleCommandCodec.decode (cyclomatic 23) Sources/SWBUtil/ArgumentSplitting.swift:223— LLVMStyleCommandCodec.decode has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MsgPackDumpTool.execute (cyclomatic 22) Sources/SWBBuildService/Tools.swift:142— MsgPackDumpTool.execute 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.
XCFramework.validate (cyclomatic 22) Sources/SWBCore/XCFramework.swift:427— XCFramework.validate 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.
SettingsBuilder.addPreviewsOverrides (cyclomatic 22) Sources/SWBCore/Settings/Settings.swift:3661— SettingsBuilder.addPreviewsOverrides 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.
CompilationCachingConfigFileTaskProducer.generateTasks (cyclomatic 22) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift:27— CompilationCachingConfigFileTaskProducer.generateTasks has cyclomatic complexity 22 (threshold 15). Of this number, 18 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.
ValidateProductTaskAction.validateiPadMultiTaskingSplitViewSupport (cyclomatic 22) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:287— ValidateProductTaskAction.validateiPadMultiTaskingSplitViewSupport 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.
TargetDependencyResolver.addDependencies (cyclomatic 21) Sources/SWBCore/TargetDependencyResolver.swift:691— TargetDependencyResolver.addDependencies 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.
TargetOrderTaskProducer.inputsForDependencies (cyclomatic 21) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift:289— TargetOrderTaskProducer.inputsForDependencies 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.
Task.init (cyclomatic 21) Sources/SWBTaskExecution/Task.swift:373— Task.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.
CopyStringsFileTaskAction.performTaskAction (cyclomatic 21) Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:175— CopyStringsFileTaskAction.performTaskAction 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.
AppIntentsMetadataCompilerSpec.constructTasks::lookup (cyclomatic 20) Sources/SWBApplePlatform/AppIntentsMetadataCompiler.swift:175— AppIntentsMetadataCompilerSpec.constructTasks::lookup 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. This shape REPEATS in the file: one other method here (AppIntentsMetadataCompilerSpec.constructTasks) 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.
MacroEvaluationMsg.handle (cyclomatic 20) Sources/SWBBuildService/Messages.swift:1407— MacroEvaluationMsg.handle 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.
PlanningOperation.getProvisioningTaskInputs (cyclomatic 20) Sources/SWBBuildService/PlanningOperation.swift:150— PlanningOperation.getProvisioningTaskInputs has cyclomatic complexity 20 (threshold 15). Of this number, 18 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.
Core.createExecutableSearchPaths (cyclomatic 20) Sources/SWBCore/Settings/Settings.swift:1006— Core.createExecutableSearchPaths 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.
XCFramework.libraryInfo (cyclomatic 20) Sources/SWBCore/XCFramework.swift:1013— XCFramework.libraryInfo has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. 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: XCFrameworkValidationError.errorDescription (cyclomatic 21) 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.
SettingsBuilder.getProductSpecificTargetTaskOverrides (cyclomatic 20) Sources/SWBCore/Settings/Settings.swift:5362— SettingsBuilder.getProductSpecificTargetTaskOverrides 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.
SettingsBuilder.getSDKSpecificPathOverrides (cyclomatic 20) Sources/SWBCore/Settings/Settings.swift:5457— SettingsBuilder.getSDKSpecificPathOverrides has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (processRemapping, remapIfNecessary). 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.
MacroEvaluationRetrievalOperator.apply (cyclomatic 20) Sources/SWBMacro/MacroEvaluationProgram.swift:223— MacroEvaluationRetrievalOperator.apply 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.
SwiftStandardLibrariesTaskProducer.generateTasks (cyclomatic 20) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftStandardLibrariesTaskProducer.swift:22— SwiftStandardLibrariesTaskProducer.generateTasks 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.
TAPISymbolExtractorTaskProducer.generateTasks (cyclomatic 20) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift:29— TAPISymbolExtractorTaskProducer.generateTasks 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.
BuildDescription.generatePreviewInfo (cyclomatic 20) Sources/SWBBuildService/PreviewInfo.swift:178— BuildDescription.generatePreviewInfo 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.
CopyPlistTaskAction.performTaskAction (cyclomatic 20) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:210— CopyPlistTaskAction.performTaskAction 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.
PbxCp.swift.pbxcp (cyclomatic 20) Sources/SWBUtil/PbxCp.swift:670— PbxCp.swift.pbxcp 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.
SWBServiceConsolePrepareForIndexCommand.perform (cyclomatic 20) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:236— SWBServiceConsolePrepareForIndexCommand.perform 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.
AppIntentsMetadataCompilerSpec.constructTasks (cyclomatic 19) Sources/SWBApplePlatform/AppIntentsMetadataCompiler.swift:76— AppIntentsMetadataCompilerSpec.constructTasks 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. This shape REPEATS in the file: one other method here (AppIntentsMetadataCompilerSpec.constructTasks::lookup) 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.
XCFramework.copy (cyclomatic 19) Sources/SWBCore/XCFramework.swift:1290— XCFramework.copy has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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. This is NOT this file's highest cyclomatic complexity: XCFrameworkValidationError.errorDescription (cyclomatic 21) 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.
BuildRule.init (cyclomatic 19) Sources/SWBCore/ProjectModel/BuildRule.swift:67— BuildRule.init 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.
FrameworkProductTypeSpec.addFrameworkInstallAPITasks (cyclomatic 19) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:880— FrameworkProductTypeSpec.addFrameworkInstallAPITasks 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. This shape REPEATS in the file: one other method here (LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks) 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.
LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks (cyclomatic 19) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1006— LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks 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. This shape REPEATS in the file: one other method here (FrameworkProductTypeSpec.addFrameworkInstallAPITasks) 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.
MacroValueAssignmentTable.init (cyclomatic 19) Sources/SWBMacro/MacroValueAssignmentTable.swift:300— MacroValueAssignmentTable.init has cyclomatic complexity 19 (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.
BuildFilesProcessingContext.addFile (cyclomatic 19) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:113— BuildFilesProcessingContext.addFile 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.
FileCopyTaskAction.performTaskAction (cyclomatic 19) Sources/SWBTaskExecution/TaskActions/FileCopyTaskAction.swift:68— FileCopyTaskAction.performTaskAction 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.
InfoPlistProcessorTaskAction.defaultInfoPlistContent (cyclomatic 19) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:695— InfoPlistProcessorTaskAction.defaultInfoPlistContent has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
SwiftDriverJobSchedulingTaskAction.parseMakefileDependencies (cyclomatic 19) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:359— SwiftDriverJobSchedulingTaskAction.parseMakefileDependencies 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.
ValidateProductTaskAction.validateFrameworks (cyclomatic 19) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:213— ValidateProductTaskAction.validateFrameworks 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.
CommandLineCheckable.checkCommandLineMatches (cyclomatic 19) Sources/SWBTestSupport/TasksCheckingResult.swift:273— CommandLineCheckable.checkCommandLineMatches has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (patternDescription). 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.
Path.matchesFilenamePattern (cyclomatic 19) Sources/SWBUtil/Path.swift:743— Path.matchesFilenamePattern 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.
SWBBuildServiceConnection.effectiveLaunchURL (cyclomatic 19) Sources/SwiftBuild/SWBBuildServiceConnection.swift:174— SWBBuildServiceConnection.effectiveLaunchURL 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.
AppIntentsSSUTrainingCompilerSpec.shouldConstructSsuTrainingTask (cyclomatic 18) Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:21— AppIntentsSSUTrainingCompilerSpec.shouldConstructSsuTrainingTask 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.
OperationSystemAdaptor.descriptionForBuildKey (cyclomatic 18) Sources/SWBBuildSystem/BuildOperation.swift:2421— OperationSystemAdaptor.descriptionForBuildKey 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.
RecursiveSearchPathResolver.computeExpandedPaths (cyclomatic 18) Sources/SWBCore/Settings/RecursiveSearchPathResolver.swift:171— RecursiveSearchPathResolver.computeExpandedPaths has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 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.
SettingsBuilder.analyzeExcludedLocalizationFiles::analyzePatterns (cyclomatic 18) Sources/SWBCore/Settings/Settings.swift:6082— SettingsBuilder.analyzeExcludedLocalizationFiles::analyzePatterns 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.
TaskProducerContext.willProduceBinary (cyclomatic 18) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:767— TaskProducerContext.willProduceBinary has cyclomatic complexity 18 (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.
ClangScanTaskAction.performTaskAction (cyclomatic 18) Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:140— ClangScanTaskAction.performTaskAction 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.
InfoPlistProcessorTaskAction.addAdditionalContent (cyclomatic 18) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:916— InfoPlistProcessorTaskAction.addAdditionalContent 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.
InfoPlistProcessorTaskAction.mergeUIRequiredDeviceCapabilities (cyclomatic 18) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1267— InfoPlistProcessorTaskAction.mergeUIRequiredDeviceCapabilities 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.
SwiftDriverJobSchedulingTaskAction.performTaskAction (cyclomatic 18) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:187— SwiftDriverJobSchedulingTaskAction.performTaskAction 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.
Options.init (cyclomatic 18) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:44— Options.init 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.
CASOptions.create (cyclomatic 17) Sources/SWBCore/Settings/CASOptions.swift:188— CASOptions.create has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
SettingsBuilder.getTargetTaskOverrides (cyclomatic 17) Sources/SWBCore/Settings/Settings.swift:4970— SettingsBuilder.getTargetTaskOverrides 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.
BuildRule.init (cyclomatic 17) Sources/SwiftBuild/ProjectModel/BuildRule.swift:50— BuildRule.init 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.
GlobalProductPlan.computeArtifactBundleInfo (cyclomatic 17) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:588— GlobalProductPlan.computeArtifactBundleInfo 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.
BuildRuleTaskProducer.generateTasks (cyclomatic 17) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift:87— BuildRuleTaskProducer.generateTasks has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
SwiftPackageCopyFilesTaskProducer.buildFilesForPackages::recursiveBuildFilesForPackageProducts (cyclomatic 17) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift:43— SwiftPackageCopyFilesTaskProducer.buildFilesForPackages::recursiveBuildFilesForPackageProducts 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.
SwiftDriverJobTaskAction.replayCachedCommand (cyclomatic 17) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:609— SwiftDriverJobTaskAction.replayCachedCommand 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 (replayCachedCommandImpl). 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.
BuildOperationTester.checkBuild (cyclomatic 17) Sources/SWBTestSupport/BuildOperationTester.swift:1478— BuildOperationTester.checkBuild 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. This is NOT this file's highest cyclomatic complexity: BuildEvent.description (cyclomatic 19) 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.
Scalar.escapedForC (cyclomatic 17) Sources/SWBUtil/String.swift:312— Scalar.escapedForC 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, 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.
fnmatch.swift.rangematch (cyclomatic 17) Sources/SWBUtil/fnmatch.swift:173— fnmatch.swift.rangematch 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.
OperationSystemAdaptor.commandProcessFinished (cyclomatic 16) Sources/SWBBuildSystem/BuildOperation.swift:2358— OperationSystemAdaptor.commandProcessFinished 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.
Core.getInitializedCore (cyclomatic 16) Sources/SWBCore/Core.swift:45— Core.getInitializedCore 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.
LinkageDependencyResolver.implicitDependency (cyclomatic 16) Sources/SWBCore/LinkageDependencyResolver.swift:381— LinkageDependencyResolver.implicitDependency 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.
SDKVariant.evaluateTargetedDeviceFamilyBuildSetting (cyclomatic 16) Sources/SWBCore/Apple/InterfaceBuilderShared.swift:32— SDKVariant.evaluateTargetedDeviceFamilyBuildSetting 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.
SettingsBuilder.getTargetDynamicSettings (cyclomatic 16) Sources/SWBCore/Settings/Settings.swift:2450— SettingsBuilder.getTargetDynamicSettings 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.
EvalInstr.init (cyclomatic 16) Sources/SWBMacro/MacroEvaluationProgram.swift:137— EvalInstr.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.
MacroValueAssignmentTable.bindConditionParameter (cyclomatic 16) Sources/SWBMacro/MacroValueAssignmentTable.swift:157— MacroValueAssignmentTable.bindConditionParameter has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
GlobalProductPlan.computeTargetsRequiredToBuildForIndexing (cyclomatic 16) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:513— GlobalProductPlan.computeTargetsRequiredToBuildForIndexing 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.
TaskProducerContext.compileSourcesExportOnlySwiftSymbols (cyclomatic 16) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1500— TaskProducerContext.compileSourcesExportOnlySwiftSymbols 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.
ModuleVerifierTaskProducer.generateClangModuleVerifierTask (cyclomatic 16) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift:190— ModuleVerifierTaskProducer.generateClangModuleVerifierTask 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.
ProductPostprocessingTaskProducer.generateTasks (cyclomatic 16) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:76— ProductPostprocessingTaskProducer.generateTasks has cyclomatic complexity 16 (threshold 15). 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, 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.
BuildDescriptionBuilder.addSubprocessCommand (cyclomatic 16) Sources/SWBTaskExecution/BuildDescription.swift:1010— BuildDescriptionBuilder.addSubprocessCommand 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.
AsyncOperationQueue.waitIfNeeded (cyclomatic 16) Sources/SWBUtil/AsyncOperationQueue.swift:70— 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.
OperatingSystem.xcodePlatformName (cyclomatic 16) Sources/SWBCore/Settings/Settings.swift:6244— OperatingSystem.xcodePlatformName 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.
PbxCp.swift.copyDirectory (cyclomatic 16) Sources/SWBUtil/PbxCp.swift:421— PbxCp.swift.copyDirectory 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.
PbxCp.swift.copyTree (cyclomatic 16) Sources/SWBUtil/PbxCp.swift:515— PbxCp.swift.copyTree 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.
FixmeComment repeated across 18 files Sources/SWBCore/SpecImplementations/LinkerSpec.swift:161— The identical FixmeComment appears in 18 files (18 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 18 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// FIXME: We should ensure this cannot happen.". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
SourcesTaskProducer.generateTasks (cognitive 443) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:891— SourcesTaskProducer.generateTasks has cognitive complexity 443 (threshold 15). Drivers by points: if/else 102 (310 pts), boolean chains 47, loops 12 (42 pts), ternaries 9 (25 pts), match/switch 2 (12 pts), error handling 2 (7 pts) (nesting depth added 269). Of this number, 427 points are the body's own statements and 16 belong to 2 function items inside it that branch. 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.
SourcesTaskProducer.computeLibraries (cognitive 306) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:373— SourcesTaskProducer.computeLibraries has cognitive complexity 306 (threshold 15). Drivers by points: if/else 62 (191 pts), loops 9 (44 pts), ternaries 7 (24 pts), match/switch 7 (20 pts), error handling 5 (19 pts), boolean chains 8 (nesting depth added 208). Of this number, 273 points are the body's own statements and 33 belong to 3 function items inside it that branch. 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.
TargetDependencyResolver.computeGraph (cognitive 232) Sources/SWBCore/TargetDependencyResolver.swift:286— TargetDependencyResolver.computeGraph has cognitive complexity 232 (threshold 15). Drivers by points: if/else 50 (138 pts), loops 27 (71 pts), match/switch 4 (11 pts), boolean chains 9, ternaries 1 (3 pts) (nesting depth added 141). Of this number, 216 points are the body's own statements and 16 belong to one function item inside it that branches. 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.
CopyFilesTaskProducer.addTasksForUngroupedFile (cognitive 190) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:204— CopyFilesTaskProducer.addTasksForUngroupedFile has cognitive complexity 190 (threshold 15). Drivers by points: if/else 54 (128 pts), boolean chains 20, match/switch 6 (19 pts), loops 3 (17 pts), error handling 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 104). Of this number, 181 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles (cognitive 170) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:420— FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles has cognitive complexity 170 (threshold 15). Drivers by points: if/else 43 (119 pts), loops 9 (22 pts), boolean chains 14, error handling 4 (8 pts), match/switch 2 (7 pts) (nesting depth added 98). Of this number, 152 points are the body's own statements and 18 belong to 4 function items inside it that branch. 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.
SettingsBuilder.getCommonTargetTaskOverrides (cognitive 164) Sources/SWBCore/Settings/Settings.swift:4426— SettingsBuilder.getCommonTargetTaskOverrides has cognitive complexity 164 (threshold 15). Drivers by points: if/else 64 (138 pts), loops 10 (28 pts), boolean chains 14, ternaries 4 (7 pts), error handling 2 (3 pts), match/switch 1 (nesting depth added 96). 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. This shape REPEATS in the file: one other method here (SettingsBuilder.getCommonTargetTaskOverrides::getPreferredArch) 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.
SDKRegistry.registerSDK (cognitive 152) Sources/SWBCore/SDKRegistry.swift:636— SDKRegistry.registerSDK has cognitive complexity 152 (threshold 15). Drivers by points: if/else 53 (105 pts), loops 13 (26 pts), error handling 7 (14 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 74). Of this number, 138 points are the body's own statements and 14 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.
BuildDescription.construct (cognitive 128) Sources/SWBTaskExecution/BuildDescription.swift:1140— BuildDescription.construct has cognitive complexity 128 (threshold 15). Drivers by points: if/else 30 (64 pts), loops 21 (35 pts), ternaries 8 (17 pts), match/switch 2 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 62). Of this number, 113 points are the body's own statements and 15 belong to 4 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.
SettingsBuilder.analyzeSettings (cognitive 116) Sources/SWBCore/Settings/Settings.swift:5761— SettingsBuilder.analyzeSettings has cognitive complexity 116 (threshold 15). Drivers by points: if/else 30 (61 pts), ternaries 10 (28 pts), loops 11 (20 pts), boolean chains 7 (nesting depth added 58). Of this number, 114 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.
SettingsBuilder.construct (cognitive 112) Sources/SWBCore/Settings/Settings.swift:1487— SettingsBuilder.construct has cognitive complexity 112 (threshold 15). Drivers by points: if/else 34 (64 pts), loops 8 (23 pts), boolean chains 11, match/switch 2 (6 pts), error handling 2 (5 pts), ternaries 2 (3 pts) (nesting depth added 53). 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 101) Sources/SWBBuildSystem/BuildOperation.swift:538— BuildOperation._build has cognitive complexity 101 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 7 (21 pts), error handling 6 (16 pts), boolean chains 8, ternaries 2 (6 pts), match/switch 2 (nesting depth added 48). Of this number, 95 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.
DependencyResolver.lookupConfiguredTarget (cognitive 99) Sources/SWBCore/DependencyResolution.swift:793— DependencyResolver.lookupConfiguredTarget has cognitive complexity 99 (threshold 15). Drivers by points: if/else 41 (64 pts), ternaries 4 (13 pts), boolean chains 12, match/switch 2 (8 pts), loops 1 (2 pts) (nesting depth added 39). 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.
InfoPlistProcessorTaskAction.parseConfiguration (cognitive 90) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:378— InfoPlistProcessorTaskAction.parseConfiguration has cognitive complexity 90 (threshold 15). Drivers by points: if/else 38 (86 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 49). 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.
ActoolCompilerSpec.constructTasks (cognitive 89) Sources/SWBApplePlatform/AssetCatalogCompiler.swift:129— ActoolCompilerSpec.constructTasks has cognitive complexity 89 (threshold 15). Drivers by points: if/else 31 (53 pts), ternaries 6 (15 pts), loops 3 (10 pts), boolean chains 8, match/switch 3 (nesting depth added 38). Of this number, 59 points are the body's own statements and 30 belong to 5 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.
LinkageDependencyResolver.dependencies (cognitive 87) Sources/SWBCore/LinkageDependencyResolver.swift:215— LinkageDependencyResolver.dependencies has cognitive complexity 87 (threshold 15). Drivers by points: if/else 25 (65 pts), boolean chains 10, loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 47). 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.
fnmatch.swift.fnmatch (cognitive 86) Sources/SWBUtil/fnmatch.swift:47— fnmatch.swift.fnmatch has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (68 pts), boolean chains 9, match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 49). Of this number, 79 points are the body's own statements and 7 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.
SettingsBuilder.getBuildPhaseTargetTaskOverrides (cognitive 82) Sources/SWBCore/Settings/Settings.swift:5127— SettingsBuilder.getBuildPhaseTargetTaskOverrides has cognitive complexity 82 (threshold 15). Drivers by points: if/else 26 (50 pts), loops 9 (19 pts), boolean chains 8, ternaries 2 (5 pts) (nesting depth added 37). 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.
InfoPlistProcessorTaskAction.performTaskAction (cognitive 82) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:54— InfoPlistProcessorTaskAction.performTaskAction has cognitive complexity 82 (threshold 15). Drivers by points: if/else 35 (52 pts), error handling 9 (13 pts), boolean chains 10, ternaries 2 (5 pts), loops 2 (nesting depth added 24). 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.
SettingsBuilder.computeBoundProperties (cognitive 79) Sources/SWBCore/Settings/Settings.swift:1811— SettingsBuilder.computeBoundProperties has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (60 pts), boolean chains 8, loops 4 (5 pts), error handling 2 (4 pts), match/switch 1 (2 pts) (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.
LegacySwiftCommandOutputParser.handleMessage (cognitive 76) Sources/SWBCore/SwiftOutputParsing.swift:397— LegacySwiftCommandOutputParser.handleMessage has cognitive complexity 76 (threshold 15). Drivers by points: if/else 30 (55 pts), boolean chains 8, loops 2 (5 pts), match/switch 2 (4 pts), ternaries 2 (4 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.
Toolchain.init (cognitive 75) Sources/SWBCore/ToolchainRegistry.swift:113— Toolchain.init has cognitive complexity 75 (threshold 15). Drivers by points: if/else 38 (62 pts), loops 4 (7 pts), boolean chains 3, error handling 2 (3 pts) (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.
DependencyCycleFormatter.formattedMultiTargetCycleOutput (cognitive 70) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:331— DependencyCycleFormatter.formattedMultiTargetCycleOutput has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (43 pts), ternaries 2 (14 pts), boolean chains 6, match/switch 1 (6 pts), loops 1 (nesting depth added 42). 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.
TaskProducerContext.forEachBuildProductToSourceMapping (cognitive 70) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift:86— TaskProducerContext.forEachBuildProductToSourceMapping has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (54 pts), ternaries 2 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 46). 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.
InfoPlistProcessorTaskAction.validatePlistContents (cognitive 67) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1397— InfoPlistProcessorTaskAction.validatePlistContents has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (52 pts), loops 3 (6 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 36). 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.
TargetOrderTaskProducer.inputsForDependencies (cognitive 66) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift:289— TargetOrderTaskProducer.inputsForDependencies has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (51 pts), loops 3 (11 pts), boolean chains 4 (nesting depth added 45). 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.
SettingsBuilder.addSDKSettings (cognitive 65) Sources/SWBCore/Settings/Settings.swift:2750— SettingsBuilder.addSDKSettings has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (55 pts), boolean chains 3, loops 3, error handling 1 (2 pts), ternaries 1 (2 pts) (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.
GlobalProductPlan.computeIPIClangInfo (cognitive 62) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:752— GlobalProductPlan.computeIPIClangInfo has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 6 (11 pts), boolean chains 9, ternaries 2 (4 pts) (nesting depth added 30). 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.
GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage (cognitive 62) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1134— GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 9 (11 pts), boolean chains 5 (nesting depth added 26). Of this number, 50 points are the body's own statements and 12 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.
ModuleMapTaskProducer.generateTasks (cognitive 62) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleMapTaskProducer.swift:176— ModuleMapTaskProducer.generateTasks has cognitive complexity 62 (threshold 15). Drivers by points: if/else 28 (51 pts), error handling 3 (6 pts), boolean chains 5 (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.
ClangCompileTaskAction.performTaskAction (cognitive 62) Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:175— ClangCompileTaskAction.performTaskAction has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (43 pts), error handling 3 (7 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 34). 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.
SwiftDriverTaskAction.performTaskAction (cognitive 60) Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift:34— SwiftDriverTaskAction.performTaskAction has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 5 (16 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 33). 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.
DependencyCycleFormatter.formattedSingleTargetCycleOutput (cognitive 58) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:461— DependencyCycleFormatter.formattedSingleTargetCycleOutput has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (36 pts), ternaries 2 (8 pts), match/switch 3 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 31). 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.
ExecutableTask.formattedRuleInfo (cognitive 57) Sources/SWBTaskConstruction/DiagnosticSupport.swift:100— ExecutableTask.formattedRuleInfo has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (51 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 27). 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.
SettingsBuilder.addSwiftSDKToolsetSettings (cognitive 55) Sources/SWBCore/Settings/Settings.swift:2982— SettingsBuilder.addSwiftSDKToolsetSettings has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (37 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (5 pts), error handling 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericCachingTaskAction.performTaskAction (cognitive 55) Sources/SWBTaskExecution/TaskActions/GenericCachingTaskAction.swift:67— GenericCachingTaskAction.performTaskAction has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 7 (17 pts), error handling 3 (4 pts), match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 29). Of this number, 54 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.
SwiftDriverJobTaskAction.performTaskAction (cognitive 54) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:343— SwiftDriverJobTaskAction.performTaskAction has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 8, error handling 4 (7 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 19). Of this number, 41 points are the body's own statements and 13 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.
MacroEvaluationProgram.executeInContext (cognitive 53) Sources/SWBMacro/MacroEvaluationProgram.swift:372— MacroEvaluationProgram.executeInContext has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 32). 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.
MacroConfigFileLoader.loadSettingsFromConfig::foundPreprocessorInclusion (cognitive 52) Sources/SWBCore/MacroConfigFileLoader.swift:133— MacroConfigFileLoader.loadSettingsFromConfig::foundPreprocessorInclusion has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 27). 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.
InfoPlistProcessorTaskAction.editPlatformSpecificEntries (cognitive 52) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1111— InfoPlistProcessorTaskAction.editPlatformSpecificEntries has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (42 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 30). Of this number, 48 points are the body's own statements and 4 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.
SwiftDriverJobSchedulingTaskAction.parseMakefileDependencies (cognitive 52) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:359— SwiftDriverJobSchedulingTaskAction.parseMakefileDependencies has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 2 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 31). 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.
MacroExpressionParser.parseQuotedExpressionStringElement (cognitive 51) Sources/SWBMacro/MacroExpressionParsing.swift:332— MacroExpressionParser.parseQuotedExpressionStringElement has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 9, ternaries 2 (8 pts), loops 1 (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.
CompilationCachingConfigFileTaskProducer.generateTasks (cognitive 51) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift:27— CompilationCachingConfigFileTaskProducer.generateTasks has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (nesting depth added 29). Of this number, 44 points are the body's own statements and 7 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.
CopyPlistTaskAction.performTaskAction (cognitive 51) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:210— CopyPlistTaskAction.performTaskAction has cognitive complexity 51 (threshold 15). Drivers by points: error handling 5 (15 pts), if/else 7 (15 pts), loops 3 (10 pts), ternaries 1 (5 pts), boolean chains 3, match/switch 1 (3 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.
SettingsBuilder.addRunDestinationSettingsPlatformSDK (cognitive 50) Sources/SWBCore/Settings/Settings.swift:3846— SettingsBuilder.addRunDestinationSettingsPlatformSDK has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 12, error handling 3, match/switch 1 (nesting depth added 9). Of this number, 47 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.
SettingsBuilder.bindDeploymentTarget (cognitive 50) Sources/SWBCore/Settings/Settings.swift:5608— SettingsBuilder.bindDeploymentTarget has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 21). Of this number, 46 points are the body's own statements and 4 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.
XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks (cognitive 50) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 2 (7 pts), error handling 2 (5 pts), loops 3 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 27). 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.
MacroExpressionParser.parseSubstitutionSubexpression (cognitive 48) Sources/SWBMacro/MacroExpressionParsing.swift:122— MacroExpressionParser.parseSubstitutionSubexpression has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 7, loops 2 (4 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.
GlobalProductPlan.computeArtifactBundleInfo (cognitive 48) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:588— GlobalProductPlan.computeArtifactBundleInfo has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (10 pts), error handling 2 (8 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.
Path.join (cognitive 47) Sources/SWBUtil/Path.swift:499— Path.join has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 11, ternaries 4 (10 pts), match/switch 1 (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.
SWBServiceConsoleBuildCommand.perform (cognitive 47) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:51— SWBServiceConsoleBuildCommand.perform has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (34 pts), error handling 6 (8 pts), boolean chains 2, match/switch 1 (2 pts), 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.
GlobalProductPlan.generatesModuleMap (cognitive 46) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1585— GlobalProductPlan.generatesModuleMap has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 3 (7 pts), boolean chains 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.
PlatformRegistry.registerPlatform (cognitive 45) Sources/SWBCore/PlatformRegistry.swift:441— PlatformRegistry.registerPlatform has cognitive complexity 45 (threshold 15). Drivers by points: if/else 29 (37 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). 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.
PrecompileClangModuleTaskAction.performTaskAction (cognitive 45) Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift:130— PrecompileClangModuleTaskAction.performTaskAction has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (33 pts), error handling 3 (6 pts), boolean chains 4, loops 2 (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.
CoreMLCompilerSpec.constructCoreMLCodeGenerationTasks (cognitive 43) Sources/SWBApplePlatform/CoreMLCompiler.swift:134— CoreMLCompilerSpec.constructCoreMLCodeGenerationTasks has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 4 (9 pts), boolean chains 4, loops 2, error handling 1, ternaries 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.
XCFramework.validate (cognitive 43) Sources/SWBCore/XCFramework.swift:427— XCFramework.validate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (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.
SettingsBuilder.computeSigningSettings (cognitive 43) Sources/SWBCore/Settings/Settings.swift:4034— SettingsBuilder.computeSigningSettings has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 9, ternaries 1 (2 pts), match/switch 1 (nesting depth added 9). Of this number, 36 points are the body's own statements and 7 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.
CopyStringsFileTaskAction.performTaskAction (cognitive 43) Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:175— CopyStringsFileTaskAction.performTaskAction has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 4 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (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.
SwiftDriverJobSchedulingTaskAction.taskDependencyReady (cognitive 43) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:64— SwiftDriverJobSchedulingTaskAction.taskDependencyReady has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (36 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 20). Of this number, 40 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.
AppIntentsMetadataCompilerSpec.constructTasks (cognitive 42) Sources/SWBApplePlatform/AppIntentsMetadataCompiler.swift:76— AppIntentsMetadataCompilerSpec.constructTasks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 9, ternaries 3 (5 pts), loops 3 (4 pts), match/switch 1 (nesting depth added 13). Of this number, 27 points are the body's own statements and 15 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobalProductPlan.computeModuleInfo (cognitive 42) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1455— GlobalProductPlan.computeModuleInfo has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 15, ternaries 1 (nesting depth added 6). 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.
TAPISymbolExtractorTaskProducer.computeHeadersInputList (cognitive 42) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift:184— TAPISymbolExtractorTaskProducer.computeHeadersInputList has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 4 (8 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 14). Of this number, 27 points are the body's own statements and 15 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.
RunningTask.init (cognitive 42) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:229— RunningTask.init has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 6, loops 2, match/switch 1 (2 pts), ternaries 1 (nesting depth added 13). Of this number, 38 points are the body's own statements and 4 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.
PlanningOperation.getProvisioningTaskInputs (cognitive 41) Sources/SWBBuildService/PlanningOperation.swift:150— PlanningOperation.getProvisioningTaskInputs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 15). Of this number, 38 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.
SettingsBuilder.addPlatformSettings (cognitive 41) Sources/SWBCore/Settings/Settings.swift:2567— SettingsBuilder.addPlatformSettings has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (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.
SettingsBuilder.getProductSpecificTargetTaskOverrides (cognitive 41) Sources/SWBCore/Settings/Settings.swift:5362— SettingsBuilder.getProductSpecificTargetTaskOverrides has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 3 (5 pts), match/switch 1 (4 pts), ternaries 1 (3 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.
TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles::visit (cognitive 41) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1568— TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles::visit has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 8, match/switch 1 (2 pts), 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.
PbxCp.swift.pbxcp (cognitive 41) Sources/SWBUtil/PbxCp.swift:670— PbxCp.swift.pbxcp has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 2, 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.
SWBBuildServiceConnection.effectiveLaunchURL (cognitive 41) Sources/SwiftBuild/SWBBuildServiceConnection.swift:174— SWBBuildServiceConnection.effectiveLaunchURL has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 22). 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.
BuildRule.init (cognitive 40) Sources/SWBCore/ProjectModel/BuildRule.swift:67— BuildRule.init has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (36 pts), match/switch 1 (3 pts), boolean chains 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.
ScannerState.getNextToken (cognitive 40) Sources/SWBMacro/MacroConditionExpression.swift:607— ScannerState.getNextToken has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 10, loops 2 (4 pts), 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.
XCFrameworkTaskProducer.prepare (cognitive 40) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/XCFrameworkTaskProducer.swift:35— XCFrameworkTaskProducer.prepare has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (3 pts), match/switch 1 (nesting depth added 16). Of this number, 16 points are the body's own statements and 24 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.
InfoPlistProcessorTaskAction.mergeUIDeviceFamilyContent (cognitive 40) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1064— InfoPlistProcessorTaskAction.mergeUIDeviceFamilyContent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (25 pts), ternaries 2 (11 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 26). 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.
InfoPlistProcessorTaskAction.mergeUIRequiredDeviceCapabilities (cognitive 40) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1267— InfoPlistProcessorTaskAction.mergeUIRequiredDeviceCapabilities has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (9 pts), boolean chains 3, match/switch 1 (2 pts) (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.
IbtoolCompilerSupport.stringsFilesAndRegions (cognitive 39) Sources/SWBApplePlatform/InterfaceBuilderShared.swift:58— IbtoolCompilerSupport.stringsFilesAndRegions has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (29 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 26). 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.
XCFramework.parseCommandLine (cognitive 39) Sources/SWBCore/XCFramework.swift:843— XCFramework.parseCommandLine has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 5 (10 pts), boolean chains 3, loops 1 (nesting depth added 16). Of this number, 37 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.
SwiftPackageCopyFilesTaskProducer.buildFilesForPackages::recursiveBuildFilesForPackageProducts (cognitive 39) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift:43— SwiftPackageCopyFilesTaskProducer.buildFilesForPackages::recursiveBuildFilesForPackageProducts has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (30 pts), boolean chains 6, loops 2 (3 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. This shape REPEATS in the file: one other method here (SwiftPackageCopyFilesTaskProducer.buildFilesForPackages) 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.
ProcessXCFrameworkTaskAction.performTaskAction (cognitive 39) Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:24— ProcessXCFrameworkTaskAction.performTaskAction has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (31 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1, 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.
PlanningResults.checkAllTasksForMissingInputs (cognitive 39) Sources/SWBTestSupport/TaskConstructionTester.swift:407— PlanningResults.checkAllTasksForMissingInputs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 4 (10 pts), boolean chains 2 (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.
AppIntentsMetadataTaskProducer.generateTasks (cognitive 38) Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:50— AppIntentsMetadataTaskProducer.generateTasks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 10, loops 3 (6 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.
OperationSystemAdaptor.determinedRuleNeedsToRun (cognitive 38) Sources/SWBBuildSystem/BuildOperation.swift:2550— OperationSystemAdaptor.determinedRuleNeedsToRun has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 8, match/switch 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.
TargetDependencyResolver.addDependencies (cognitive 38) Sources/SWBCore/TargetDependencyResolver.swift:691— TargetDependencyResolver.addDependencies has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5, loops 3 (5 pts), ternaries 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.
ShellScript.swift.computeScriptEnvironment (cognitive 38) Sources/SWBCore/ShellScript.swift:80— ShellScript.swift.computeScriptEnvironment has cognitive complexity 38 (threshold 15). Drivers by points: loops 10 (19 pts), if/else 9 (16 pts), match/switch 2, boolean chains 1 (nesting depth added 16). 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.
BuildSettings.init (cognitive 38) Sources/SwiftBuild/ProjectModel/BuildSettings.swift:347— BuildSettings.init has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 7 (14 pts) (nesting depth added 24). 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 38) Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:88— BuildPlan.init has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 11 (15 pts), ternaries 3 (5 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.
BuildFilesProcessingContext.addFile (cognitive 38) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:113— BuildFilesProcessingContext.addFile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 2 (7 pts), loops 1 (2 pts), boolean chains 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.
BuildDescription.generatePreviewInfo (cognitive 38) Sources/SWBBuildService/PreviewInfo.swift:178— BuildDescription.generatePreviewInfo has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 5 (22 pts), if/else 4 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 23). 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.
BuildDescriptionManager.constructBuildDescription (cognitive 38) Sources/SWBTaskExecution/BuildDescriptionManager.swift:178— BuildDescriptionManager.constructBuildDescription has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 23). 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.
IntentsCompilerSpec.constructIntentsCodeGenerationTasks (cognitive 37) Sources/SWBApplePlatform/IntentsCompiler.swift:124— IntentsCompilerSpec.constructIntentsCodeGenerationTasks has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 4 (9 pts), boolean chains 7, error handling 2, loops 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.
BuildOperation.build (cognitive 37) Sources/SWBBuildSystem/BuildOperation.swift:366— BuildOperation.build has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 5 (9 pts), error handling 3, boolean chains 2, match/switch 1 (2 pts), ternaries 1 (nesting depth added 12). Of this number, 32 points are the body's own statements and 5 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.
SettingsBuilder.addPreviewsOverrides (cognitive 37) Sources/SWBCore/Settings/Settings.swift:3661— SettingsBuilder.addPreviewsOverrides has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (2 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.
MacroValueAssignmentTable.bindConditionParameter (cognitive 37) Sources/SWBMacro/MacroValueAssignmentTable.swift:157— MacroValueAssignmentTable.bindConditionParameter has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (10 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 19). Of this number, 32 points are the body's own statements and 5 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.
GlobalProductPlan.computeTargetsRequiredToBuildForIndexing (cognitive 37) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:513— GlobalProductPlan.computeTargetsRequiredToBuildForIndexing has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 5 (11 pts), boolean chains 2 (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.
BuildDescriptionManager.loadBuildDescription (cognitive 37) Sources/SWBTaskExecution/BuildDescriptionManager.swift:546— BuildDescriptionManager.loadBuildDescription has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6, ternaries 3 (6 pts), error handling 2 (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.
SwiftDriverJobSchedulingTaskAction.performTaskAction (cognitive 37) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:187— SwiftDriverJobSchedulingTaskAction.performTaskAction has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 19). 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.
MsgPackDumpTool.execute (cognitive 36) Sources/SWBBuildService/Tools.swift:142— MsgPackDumpTool.execute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 1 (3 pts), boolean chains 2, 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.
Task.init (cognitive 36) Sources/SWBTaskExecution/Task.swift:373— Task.init has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 3, match/switch 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.
InfoPlistProcessorTaskAction.addAdditionalContent (cognitive 36) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:916— InfoPlistProcessorTaskAction.addAdditionalContent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (6 pts), match/switch 1 (4 pts), error handling 3, boolean chains 2 (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.
LinkAssetCatalogTaskAction.performLinkAssetCatalogTaskAction (cognitive 36) Sources/SWBTaskExecution/TaskActions/LinkAssetCatalogTaskAction.swift:44— LinkAssetCatalogTaskAction.performLinkAssetCatalogTaskAction has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 2 (5 pts), loops 1 (2 pts), error handling 1 (nesting depth added 18). Of this number, 33 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.
ValidateProductTaskAction.validateiPadMultiTaskingSplitViewSupport (cognitive 36) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:287— ValidateProductTaskAction.validateiPadMultiTaskingSplitViewSupport has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, 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.
Path.matchesFilenamePattern (cognitive 36) Sources/SWBUtil/Path.swift:743— Path.matchesFilenamePattern has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (30 pts), error handling 2 (3 pts), loops 2, boolean chains 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.
Core.createExecutableSearchPaths (cognitive 35) Sources/SWBCore/Settings/Settings.swift:1006— Core.createExecutableSearchPaths has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (13 pts), match/switch 2 (4 pts) (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.
XCFramework.createXCFramework (cognitive 35) Sources/SWBCore/XCFramework.swift:1115— XCFramework.createXCFramework has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 6 (19 pts), match/switch 2 (5 pts), ternaries 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 39). 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 (XCFramework.createXCFramework::xcframeworkLibraries) 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.
ProductTypeSpec.addFileListInstallAPITasks (cognitive 35) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:682— ProductTypeSpec.addFileListInstallAPITasks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, loops 2 (4 pts), ternaries 2 (4 pts), error handling 1, 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.
TAPISymbolExtractorTaskProducer.generateTasks (cognitive 35) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift:29— TAPISymbolExtractorTaskProducer.generateTasks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (10 pts), error handling 3 (7 pts), boolean chains 2 (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.
RunningTask.main (cognitive 35) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:756— RunningTask.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 5, loops 2 (4 pts), 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.
fnmatch.swift.rangematch (cognitive 35) Sources/SWBUtil/fnmatch.swift:173— fnmatch.swift.rangematch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (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.
SWBBuildServiceConnection.buildServiceLocation (cognitive 35) Sources/SwiftBuild/SWBBuildServiceConnection.swift:469— SWBBuildServiceConnection.buildServiceLocation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 14 (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.
BuildService.buildServiceModTime (cognitive 34) Sources/SWBBuildService/BuildService.swift:86— BuildService.buildServiceModTime has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 3 (6 pts), loops 2 (4 pts) (nesting depth added 20). 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.
SettingsBuilder.analyzeExcludedLocalizationFiles::analyzePatterns (cognitive 34) Sources/SWBCore/Settings/Settings.swift:6082— SettingsBuilder.analyzeExcludedLocalizationFiles::analyzePatterns has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (8 pts), boolean chains 4 (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.
Options.init (cognitive 34) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:90— Options.init has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 3, match/switch 1 (2 pts), 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.
PbxCp.swift.copyDirectory (cognitive 34) Sources/SWBUtil/PbxCp.swift:421— PbxCp.swift.copyDirectory has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (8 pts), boolean chains 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.
CleanOperation.clean (cognitive 33) Sources/SWBBuildSystem/CleanOperation.swift:292— CleanOperation.clean has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (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.
BuildPhaseTarget.buildPhaseTargetTaskProducers (cognitive 33) Sources/SWBTaskConstruction/ProductPlanning/ProductPlanner.swift:187— BuildPhaseTarget.buildPhaseTargetTaskProducers has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (8 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.
BuildRequestContext.selectConfiguredTargetForIndex (cognitive 32) Sources/SWBCore/BuildRequestContext.swift:254— BuildRequestContext.selectConfiguredTargetForIndex has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (23 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 8). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 3 function items inside it that branch (selectWithoutRunDestination, platformAndSDKVariant, matchesPlatform). 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.
SettingsBuilder.getTargetDerivedSettings (cognitive 32) Sources/SWBCore/Settings/Settings.swift:2255— SettingsBuilder.getTargetDerivedSettings has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 13, loops 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.
SwiftStandardLibrariesTaskProducer.generateTasks (cognitive 32) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftStandardLibrariesTaskProducer.swift:22— SwiftStandardLibrariesTaskProducer.generateTasks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (3 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.
SWBTerminal.swift.main (cognitive 32) Sources/SwiftBuild/SWBTerminal.swift:88— SWBTerminal.swift.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (7 pts), ternaries 2 (6 pts), boolean chains 1, error handling 1 (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.
DependencyResolver.lookupConfiguredTarget (cognitive 31) Sources/SWBCore/DependencyResolution.swift:740— DependencyResolver.lookupConfiguredTarget has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (21 pts), ternaries 1 (5 pts), loops 1 (3 pts), boolean chains 2 (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.
RecursiveSearchPathResolver.computeExpandedPaths (cognitive 31) Sources/SWBCore/Settings/RecursiveSearchPathResolver.swift:171— RecursiveSearchPathResolver.computeExpandedPaths has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 3 (7 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). Of this number, 21 points are the body's own statements and 10 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.
SettingsBuilder.getTargetDynamicSettings (cognitive 31) Sources/SWBCore/Settings/Settings.swift:2450— SettingsBuilder.getTargetDynamicSettings has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 4 (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.
GlobalProductPlan.computeImpartedBuildProperties (cognitive 30) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:685— GlobalProductPlan.computeImpartedBuildProperties has cognitive complexity 30 (threshold 15). Drivers by points: loops 5 (17 pts), if/else 4 (10 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 19). 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.
HeadermapTaskProducer.constructAllNonFrameworkTargetHeadersMap (cognitive 30) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/HeadermapTaskProducer.swift:237— HeadermapTaskProducer.constructAllNonFrameworkTargetHeadersMap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 15). Of this number, 24 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.
GlobalProductPlan.computeHostingRelationships (cognitive 29) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:391— GlobalProductPlan.computeHostingRelationships has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (13 pts), boolean chains 2 (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.
BuildResults.buildTranscript (cognitive 29) Sources/SWBTestSupport/BuildOperationTester.swift:529— BuildResults.buildTranscript has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 pts), match/switch 3 (7 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.
SWBBuildOperation.handleMessage (cognitive 29) Sources/SwiftBuild/SWBBuildOperation.swift:102— SWBBuildOperation.handleMessage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 10, match/switch 2 (3 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.
XCFramework.createXCFramework::xcframeworkLibraries (cognitive 28) Sources/SWBCore/XCFramework.swift:1120— XCFramework.createXCFramework::xcframeworkLibraries has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 1, error handling 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. This shape REPEATS in the file: one other method here (XCFramework.createXCFramework) 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.
SettingsBuilder.getTargetTaskOverrides (cognitive 28) Sources/SWBCore/Settings/Settings.swift:4970— SettingsBuilder.getTargetTaskOverrides has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 2, loops 1 (2 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.
ShellScriptTaskProducer.generateTasks (cognitive 28) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift:144— ShellScriptTaskProducer.generateTasks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, match/switch 2 (3 pts), ternaries 2 (3 pts), loops 1 (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, 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.
WindowsDLLCopyTaskProducer.prepare (cognitive 28) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/WindowsDLLCopyTaskProducer.swift:42— WindowsDLLCopyTaskProducer.prepare has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (10 pts), error handling 2 (6 pts), boolean chains 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.
FileCopyTaskAction.performTaskAction (cognitive 28) Sources/SWBTaskExecution/TaskActions/FileCopyTaskAction.swift:68— FileCopyTaskAction.performTaskAction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 2 (5 pts), error handling 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.
ValidateProductTaskAction.validateFrameworks (cognitive 28) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:213— ValidateProductTaskAction.validateFrameworks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, error handling 1 (2 pts), ternaries 2, loops 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.
SWBServiceConsolePrepareForIndexCommand.perform (cognitive 28) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:236— SWBServiceConsolePrepareForIndexCommand.perform has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 5 (7 pts), match/switch 1 (2 pts), 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.
AppIntentsSSUTrainingCompilerSpec.shouldConstructSsuTrainingTask (cognitive 27) Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:21— AppIntentsSSUTrainingCompilerSpec.shouldConstructSsuTrainingTask has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7 (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.
XCFramework.copy (cognitive 27) Sources/SWBCore/XCFramework.swift:1290— XCFramework.copy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). Of this number, 21 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.
ClangToolInfo.swift.discoveredClangToolInfo (cognitive 27) Sources/SWBCore/ToolInfo/ClangToolInfo.swift:125— ClangToolInfo.swift.discoveredClangToolInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 13). Of this number, 24 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.
SwiftCachingKeyQueryTaskAction.performTaskAction (cognitive 27) Sources/SWBTaskExecution/TaskActions/SwiftCachingKeyQueryTaskAction.swift:43— SwiftCachingKeyQueryTaskAction.performTaskAction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (16 pts), ternaries 1 (5 pts), error handling 2 (3 pts), loops 1 (3 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.
MacroEvaluationMsg.handle (cognitive 26) Sources/SWBBuildService/Messages.swift:1407— MacroEvaluationMsg.handle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (7 pts), loops 1 (2 pts), ternaries 1 (2 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.
InfoPlistProcessorTaskAction.setRequiredDeviceCapabilities (cognitive 26) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1337— InfoPlistProcessorTaskAction.setRequiredDeviceCapabilities has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 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.
RealityAssetsTaskProducer.generateTasks (cognitive 25) Sources/SWBApplePlatform/RealityAssetsTaskProducer.swift:169— RealityAssetsTaskProducer.generateTasks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (7 pts), boolean chains 2, 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.
OperationSystemAdaptor.commandProcessFinished (cognitive 25) Sources/SWBBuildSystem/BuildOperation.swift:2358— OperationSystemAdaptor.commandProcessFinished has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, match/switch 1 (4 pts), error handling 1 (3 pts), loops 1 (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.
Settings.infoForBuildSettingsEditor (cognitive 25) Sources/SWBCore/Settings/Settings.swift:927— Settings.infoForBuildSettingsEditor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (10 pts) (nesting depth added 13). None of this is in the body itself: all 25 points belong to 2 function items inside it that branch (resolvedValues, assignedValues). 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.
SettingsBuilder.addSecondaryTargetDerivedSettings (cognitive 25) Sources/SWBCore/Settings/Settings.swift:2368— SettingsBuilder.addSecondaryTargetDerivedSettings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 1 (2 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.
MacroConditionExpression.parsePrimaryExpression (cognitive 25) Sources/SWBMacro/MacroConditionExpression.swift:258— MacroConditionExpression.parsePrimaryExpression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (3 pts), boolean chains 1, 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.
SwiftPackageCopyFilesTaskProducer.buildFilesForPackages (cognitive 25) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift:22— SwiftPackageCopyFilesTaskProducer.buildFilesForPackages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 27 (55 pts), boolean chains 13, match/switch 3 (6 pts), loops 3 (5 pts), error handling 2 (3 pts), ternaries 1 (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. This shape REPEATS in the file: one other method here (SwiftPackageCopyFilesTaskProducer.buildFilesForPackages::recursiveBuildFilesForPackageProducts) 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.
ProductPostprocessingTaskProducer.addCodeSignTasks (cognitive 25) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:457— ProductPostprocessingTaskProducer.addCodeSignTasks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, ternaries 1 (2 pts), loops 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.
SwiftFrameworkABICheckerTaskProducer.generateTasks (cognitive 25) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:66— SwiftFrameworkABICheckerTaskProducer.generateTasks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 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.
InstalledXcode.compileFramework (cognitive 25) Sources/SWBTestSupport/LibraryGeneration.swift:97— InstalledXcode.compileFramework has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 8). Of this number, 22 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.
PbxCp.swift.copyTree (cognitive 25) Sources/SWBUtil/PbxCp.swift:515— PbxCp.swift.copyTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 6 (11 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.
DependencyResolver.init (cognitive 24) Sources/SWBCore/DependencyResolution.swift:524— DependencyResolver.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 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.
ExecutableTask.extractSandboxViolationMessages_ASYNC_UNSAFE (cognitive 24) Sources/SWBBuildSystem/SandboxViolations.swift:30— ExecutableTask.extractSandboxViolationMessages_ASYNC_UNSAFE has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 13). 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.
SwiftCompilerOutputParser.close (cognitive 24) Sources/SWBCore/SwiftOutputParsing.swift:34— SwiftCompilerOutputParser.close has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (5 pts), ternaries 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.
SwiftModuleDependencyGraph.generatePrecompiledModulesReport (cognitive 24) Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:319— SwiftModuleDependencyGraph.generatePrecompiledModulesReport has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (7 pts), match/switch 1 (2 pts), ternaries 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.
BuildSettings.encode (cognitive 24) Sources/SwiftBuild/ProjectModel/BuildSettings.swift:393— BuildSettings.encode has cognitive complexity 24 (threshold 15). Drivers by points: loops 11 (20 pts), if/else 1 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SwiftSDK.findSDKsWithIdentifiers (cognitive 24) Sources/SWBTestSupport/SwiftSDK.swift:82— SwiftSDK.findSDKsWithIdentifiers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 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.
BuildDescription.buildNodesToPrepareForIndex (cognitive 24) Sources/SWBTaskExecution/BuildDescription.swift:290— BuildDescription.buildNodesToPrepareForIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts), boolean chains 2 (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.
Options.init (cognitive 24) Sources/SWBTaskExecution/TaskActions/ClangModuleVerifierInputGeneratorTaskAction.swift:29— Options.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 1 (2 pts), loops 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.
BuildOperationTester.checkBuild (cognitive 24) Sources/SWBTestSupport/BuildOperationTester.swift:1478— BuildOperationTester.checkBuild has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (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.
LocalFS.createDirectory (cognitive 24) Sources/SWBUtil/FSProxy.swift:420— LocalFS.createDirectory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, error handling 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.
PbxCp.swift.copyRegular (cognitive 24) Sources/SWBUtil/PbxCp.swift:342— PbxCp.swift.copyRegular has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 2 (7 pts) (nesting depth added 13). 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.
FileCopyTaskActionContext.stubCommandLine (cognitive 23) Sources/SWBCore/PlannedTaskAction.swift:218— FileCopyTaskActionContext.stubCommandLine has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8, match/switch 1, ternaries 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.
SDKRegistry.sdksForActiveRunDestination (cognitive 23) Sources/SWBCore/SDKRegistry.swift:1299— SDKRegistry.sdksForActiveRunDestination has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function item inside it that branches (selectSDKList). 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.
TargetDependencyResolver.computeDiscoveredTargetInfo (cognitive 23) Sources/SWBCore/TargetDependencyResolver.swift:798— TargetDependencyResolver.computeDiscoveredTargetInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (8 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.
XCFramework.libraryInfo (cognitive 23) Sources/SWBCore/XCFramework.swift:1013— XCFramework.libraryInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 2, loops 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 4). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
BundleProductTypeSpec.addBundleInfoPlistTasks (cognitive 23) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/InfoPlistTaskProducer.swift:148— BundleProductTypeSpec.addBundleInfoPlistTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (5 pts), boolean chains 3, ternaries 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.
ModuleVerifierTaskProducer.generateClangModuleVerifierTask (cognitive 23) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift:190— ModuleVerifierTaskProducer.generateClangModuleVerifierTask has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, ternaries 2 (3 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, 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.
ProductPostprocessingTaskProducer.generateTasks (cognitive 23) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:76— ProductPostprocessingTaskProducer.generateTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 4 (9 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). Of this number, 22 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.
ClangScanTaskAction.performTaskAction (cognitive 23) Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.swift:140— ClangScanTaskAction.performTaskAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), error handling 4, boolean chains 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.
ODRAssetPackManifestTaskAction.performTaskAction (cognitive 23) Sources/SWBTaskExecution/TaskActions/ODRAssetPackManifestTaskAction.swift:27— ODRAssetPackManifestTaskAction.performTaskAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (3 pts), boolean chains 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.
ProcessProductEntitlementsTaskAction.performTaskAction (cognitive 23) Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:244— ProcessProductEntitlementsTaskAction.performTaskAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 4 (9 pts), ternaries 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.
SwiftHeaderToolTaskAction.performTaskAction (cognitive 23) Sources/SWBTaskExecution/TaskActions/SwiftHeaderToolTaskAction.swift:100— SwiftHeaderToolTaskAction.performTaskAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (2 pts), error handling 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.
Path.ends (cognitive 23) Sources/SWBUtil/Path.swift:703— Path.ends has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 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.
OperationSystemAdaptor.pruneExplicitPrecompiledModules (cognitive 22) Sources/SWBBuildSystem/BuildOperation.swift:1733— OperationSystemAdaptor.pruneExplicitPrecompiledModules has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), boolean chains 3 (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.
DependencyCycleMessagePayload.message (cognitive 22) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:277— DependencyCycleMessagePayload.message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (3 pts), ternaries 1 (3 pts) (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.
SDKVariant.evaluateTargetedDeviceFamilyBuildSetting (cognitive 22) Sources/SWBCore/Apple/InterfaceBuilderShared.swift:32— SDKVariant.evaluateTargetedDeviceFamilyBuildSetting has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, ternaries 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.
ModuleVerifierTargetSet.combinations (cognitive 22) Sources/SWBCore/ClangModuleVerifier/ModuleVerifierTarget.swift:75— ModuleVerifierTargetSet.combinations has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CoreSettings.systemBuildRules (cognitive 22) Sources/SWBCore/Settings/Settings.swift:291— CoreSettings.systemBuildRules has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 5 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.
TaskProducerContext.compileSourcesExportOnlySwiftSymbols (cognitive 22) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1500— TaskProducerContext.compileSourcesExportOnlySwiftSymbols has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (3 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.
BuildDescriptionManager.getNewOrCachedBuildDescription (cognitive 22) Sources/SWBTaskExecution/BuildDescriptionManager.swift:392— BuildDescriptionManager.getNewOrCachedBuildDescription has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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.
InfoPlistProcessorTaskAction.addAdditionalEntriesFromPlatform (cognitive 22) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:873— InfoPlistProcessorTaskAction.addAdditionalEntriesFromPlatform has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 12). 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.
SwiftDriverJobTaskAction.replayCachedCommand::replayCachedCommandImpl (cognitive 22) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:627— SwiftDriverJobTaskAction.replayCachedCommand::replayCachedCommandImpl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (4 pts), error handling 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.
BuildOperationTester.checkBuildDescription (cognitive 22) Sources/SWBTestSupport/BuildOperationTester.swift:1387— BuildOperationTester.checkBuildDescription has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 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.
SWBBuildServer.handle (cognitive 22) Sources/SwiftBuild/SWBBuildServer.swift:129— SWBBuildServer.handle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 pts), loops 1 (2 pts) (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.
Core.getInitializedCore (cognitive 21) Sources/SWBCore/Core.swift:45— Core.getInitializedCore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 4 (5 pts), match/switch 1 (3 pts), loops 2, 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.
DependencyResolver.lookupTopLevelConfiguredTarget (cognitive 21) Sources/SWBCore/DependencyResolution.swift:612— DependencyResolver.lookupTopLevelConfiguredTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 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.
SDKRegistry.lookup (cognitive 21) Sources/SWBCore/SDKRegistry.swift:1042— SDKRegistry.lookup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1, 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.
CASOptions.create (cognitive 21) Sources/SWBCore/Settings/CASOptions.swift:188— CASOptions.create has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
FrameworkProductTypeSpec.addFrameworkInstallAPITasks (cognitive 21) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:880— FrameworkProductTypeSpec.addFrameworkInstallAPITasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, error handling 1, 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. This shape REPEATS in the file: one other method here (LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks) 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.
LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks (cognitive 21) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1006— LibraryProductTypeSpec.addDynamicLibraryInstallAPITasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, error handling 1, 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. This shape REPEATS in the file: one other method here (FrameworkProductTypeSpec.addFrameworkInstallAPITasks) 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.
BuildRule.init (cognitive 21) Sources/SwiftBuild/ProjectModel/BuildRule.swift:50— BuildRule.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6, match/switch 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.
ProductPostprocessingTaskProducer.stubAPIDestination (cognitive 21) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:291— ProductPostprocessingTaskProducer.stubAPIDestination has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (2 pts), ternaries 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.
CopyTiffTaskAction.performTaskAction (cognitive 21) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:124— CopyTiffTaskAction.performTaskAction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (9 pts), boolean chains 1, loops 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.
Options.init (cognitive 21) Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:45— Options.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
LLVMStyleCommandCodec.decode (cognitive 21) Sources/SWBUtil/ArgumentSplitting.swift:223— LLVMStyleCommandCodec.decode has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 5, loops 1 (nesting depth added 9). 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.
OperatingSystem.parseOSRelease (cognitive 21) Sources/SWBUtil/ProcessInfo.swift:282— OperatingSystem.parseOSRelease has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (5 pts), loops 2 (3 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.
ActiveBuild._run (cognitive 20) Sources/SWBBuildService/BuildOperationMessages.swift:256— ActiveBuild._run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2 (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.
OperationSystemAdaptor.descriptionForBuildKey (cognitive 20) Sources/SWBBuildSystem/BuildOperation.swift:2421— OperationSystemAdaptor.descriptionForBuildKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 1 (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.
DependencyCycleFormatter.likelyCauseOfInTargetCycle (cognitive 20) Sources/SWBBuildSystem/DependencyCycleFormatter.swift:95— DependencyCycleFormatter.likelyCauseOfInTargetCycle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6 (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.
LinkageDependencyResolver.linkageDependencies (cognitive 20) Sources/SWBCore/LinkageDependencyResolver.swift:141— LinkageDependencyResolver.linkageDependencies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 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.
ServiceHostConnection.resume (cognitive 20) Sources/SWBServiceCore/ServiceHostConnection.swift:128— ServiceHostConnection.resume has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (2 pts), 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.
TaskProducerContext.willProduceBinary (cognitive 20) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:767— TaskProducerContext.willProduceBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5 (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.
BuildRuleTaskProducer.generateTasks (cognitive 20) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift:87— BuildRuleTaskProducer.generateTasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 3). Of this number, 17 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
CustomTaskProducer.generateTasks (cognitive 20) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/CustomTaskProducer.swift:19— CustomTaskProducer.generateTasks has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (7 pts), ternaries 1 (2 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.
ModuleVerifierTaskProducer.generateBuiltinModuleVerifierTasks (cognitive 20) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift:98— ModuleVerifierTaskProducer.generateBuiltinModuleVerifierTasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), error handling 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.
ModuleVerifierTaskProducer.collectModuleAffectingFiles (cognitive 20) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ModuleVerifierTaskProducer.swift:388— ModuleVerifierTaskProducer.collectModuleAffectingFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 8). 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, 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.
Options.init (cognitive 20) Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:74— Options.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 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.
InfoPlistProcessorTaskAction.defaultInfoPlistContent (cognitive 20) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:695— InfoPlistProcessorTaskAction.defaultInfoPlistContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, loops 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
ProcessXCFrameworkTaskAction.validateExpectedSignature (cognitive 20) Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:151— ProcessXCFrameworkTaskAction.validateExpectedSignature has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, error handling 2, loops 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.
BuildResults.getDiagnosticMessage (cognitive 20) Sources/SWBTestSupport/BuildOperationTester.swift:621— BuildResults.getDiagnosticMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
PlanningResults.checkNoCycles (cognitive 20) Sources/SWBTestSupport/TaskConstructionTester.swift:524— PlanningResults.checkNoCycles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (8 pts) (nesting depth added 9). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (lookForCycle). 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.
ResponseFiles.tokenizeUnixShellQuotedResponseFileLine (cognitive 20) Sources/SWBUtil/ResponseFiles.swift:89— ResponseFiles.tokenizeUnixShellQuotedResponseFileLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, 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.
OpenCLCompilerSpec.constructTasks (cognitive 19) Sources/SWBApplePlatform/OpenCLCompiler.swift:40— OpenCLCompilerSpec.constructTasks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 2 (3 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.
CleanOperation.build (cognitive 19) Sources/SWBBuildSystem/CleanOperation.swift:84— CleanOperation.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, 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.
BuildRequestContext.computeOutputPaths (cognitive 19) Sources/SWBCore/BuildRequestContext.swift:198— BuildRequestContext.computeOutputPaths has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (3 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.
Core.inferiorProductsPath (cognitive 19) Sources/SWBCore/Core.swift:790— Core.inferiorProductsPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 1 (4 pts), loops 1 (2 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.
InfoPlistProcessorTaskActionContext.init (cognitive 19) Sources/SWBCore/PlannedTaskAction.swift:106— InfoPlistProcessorTaskActionContext.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 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.
BuildPhaseTarget.init (cognitive 19) Sources/SWBCore/ProjectModel/Target.swift:391— BuildPhaseTarget.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), loops 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.
SettingsBuilder.getSDKSpecificPathOverrides::processRemapping (cognitive 19) Sources/SWBCore/Settings/Settings.swift:5511— SettingsBuilder.getSDKSpecificPathOverrides::processRemapping has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 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. This shape REPEATS in the file: one other method here (SettingsBuilder.getSDKSpecificPathOverrides) 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.
SettingsBuilder.getSDKSpecificPathOverrides (cognitive 19) Sources/SWBCore/Settings/Settings.swift:5457— SettingsBuilder.getSDKSpecificPathOverrides has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 5 (12 pts), boolean chains 1 (nesting depth added 27). 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 (SettingsBuilder.getSDKSpecificPathOverrides::processRemapping) 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.
MacroConfigFileParser.parseMacroValueAssignment (cognitive 19) Sources/SWBMacro/MacroConfigFileParser.swift:294— MacroConfigFileParser.parseMacroValueAssignment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (nesting depth added 5). Of this number, 17 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.
MacroNamespace.parseTable (cognitive 19) Sources/SWBMacro/MacroNamespace.swift:412— MacroNamespace.parseTable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 8). Of this number, 10 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildSettings.serialize (cognitive 19) Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:390— BuildSettings.serialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 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.
SourcesPhaseBasedTaskGenerationDelegate.createTask (cognitive 19) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:121— SourcesPhaseBasedTaskGenerationDelegate.createTask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2, ternaries 1 (2 pts) (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.
BuildDescriptionManager.generatePreviewInfo (cognitive 19) Sources/SWBBuildService/PreviewInfo.swift:97— BuildDescriptionManager.generatePreviewInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 2 (3 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.
AuxiliaryFileTaskAction.performTaskAction (cognitive 19) Sources/SWBTaskExecution/TaskActions/AuxiliaryFileTaskAction.swift:30— AuxiliaryFileTaskAction.performTaskAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (3 pts), match/switch 1 (2 pts), loops 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.
Options.init (cognitive 19) Sources/SWBTaskExecution/TaskActions/SwiftHeaderToolTaskAction.swift:29— Options.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (argParams, absolutePath, argParam, …). 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.
MutablePluginManager.loadPlugin (cognitive 19) Sources/SWBUtil/PluginManager.swift:71— MutablePluginManager.loadPlugin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), boolean chains 1, error handling 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.
BuildManager.enqueue (cognitive 18) Sources/SWBBuildSystem/BuildManager.swift:46— BuildManager.enqueue has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (8 pts), match/switch 1 (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.
SuperimposedProperties.effectiveProperties (cognitive 18) Sources/SWBCore/DependencyResolution.swift:62— SuperimposedProperties.effectiveProperties has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 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.
SpecializationParameters.init (cognitive 18) Sources/SWBCore/DependencyResolution.swift:270— SpecializationParameters.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (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.
SDKVariant.init (cognitive 18) Sources/SWBCore/SDKRegistry.swift:358— SDKVariant.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (3 pts), boolean chains 2, loops 2 (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.
XCFramework.rewriteCommandLine (cognitive 18) Sources/SWBCore/XCFramework.swift:775— XCFramework.rewriteCommandLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). 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, 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.
CoreSettings.unionedToolDefaults (cognitive 18) Sources/SWBCore/Settings/Settings.swift:73— CoreSettings.unionedToolDefaults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (15 pts), 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.
WorkspaceSettings.builtinSettingsInfo (cognitive 18) Sources/SWBCore/Settings/Settings.swift:409— WorkspaceSettings.builtinSettingsInfo has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (4 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
GlobalProductPlan.resolveDiamondProblemsInPackages (cognitive 18) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1082— GlobalProductPlan.resolveDiamondProblemsInPackages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 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.
GlobalProductPlan.expandedSearchPaths (cognitive 18) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1413— GlobalProductPlan.expandedSearchPaths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 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.
CopyFilesTaskProducer.bundleFormat (cognitive 18) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:132— CopyFilesTaskProducer.bundleFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 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.
BuildDescriptionBuilder.construct (cognitive 18) Sources/SWBTaskExecution/BuildDescription.swift:677— BuildDescriptionBuilder.construct has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (4 pts), error handling 3, boolean chains 2, ternaries 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.
BuildDescriptionBuilder.addSubprocessCommand (cognitive 18) Sources/SWBTaskExecution/BuildDescription.swift:1010— BuildDescriptionBuilder.addSubprocessCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 1 (2 pts), 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.
ClangModuleVerifierInputGeneratorTaskAction.performTaskAction (cognitive 18) Sources/SWBTaskExecution/TaskActions/ClangModuleVerifierInputGeneratorTaskAction.swift:103— ClangModuleVerifierInputGeneratorTaskAction.performTaskAction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 5, boolean chains 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.
Options.init (cognitive 18) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:44— Options.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), boolean chains 1, 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.
RunningTask.findSwiftLib (cognitive 18) Sources/SWBTaskExecution/TaskActions/EmbedSwiftStdLibTaskAction.swift:690— RunningTask.findSwiftLib has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), ternaries 1 (2 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.
LinkerTaskAction.deduplicatingSwiftASTPaths (cognitive 18) Sources/SWBTaskExecution/TaskActions/LinkerTaskAction.swift:121— LinkerTaskAction.deduplicatingSwiftASTPaths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 2 (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.
Slice.buildVersions (cognitive 18) Sources/SWBUtil/MachO.swift:1286— Slice.buildVersions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). 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.
Path.relativeSubpath (cognitive 18) Sources/SWBUtil/Path.swift:230— Path.relativeSubpath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (subpath). 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.
Scalar.escapedForC (cognitive 18) Sources/SWBUtil/String.swift:312— Scalar.escapedForC has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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, 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.
PlanningOperation.plan (cognitive 17) Sources/SWBBuildService/PlanningOperation.swift:63— PlanningOperation.plan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 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.
OperationSystemAdaptor.commandStarted (cognitive 17) Sources/SWBBuildSystem/BuildOperation.swift:2024— OperationSystemAdaptor.commandStarted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (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, 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.
BuildDependencyInfo.inputs (cognitive 17) Sources/SWBBuildService/BuildDependencyInfo.swift:88— BuildDependencyInfo.inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), loops 2 (3 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.
Core.init (cognitive 17) Sources/SWBCore/Core.swift:228— Core.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), match/switch 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.
PlannedTaskInputsOutputs.checkNodes (cognitive 17) Sources/SWBTestSupport/TaskConstructionTester.swift:1220— PlannedTaskInputsOutputs.checkNodes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), match/switch 1 (4 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.
PlatformRegistry.loadExtendedInfo (cognitive 17) Sources/SWBCore/PlatformRegistry.swift:656— PlatformRegistry.loadExtendedInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (5 pts), loops 2 (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.
SwiftModuleDependencyGraph.queryPlanningDependencies (cognitive 17) Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:211— SwiftModuleDependencyGraph.queryPlanningDependencies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 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.
SettingsBuilder.createScope (cognitive 17) Sources/SWBCore/Settings/Settings.swift:2077— SettingsBuilder.createScope has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6 (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.
SettingsBuilder.getCommonTargetTaskOverrides::getPreferredArch (cognitive 17) Sources/SWBCore/Settings/Settings.swift:4599— SettingsBuilder.getCommonTargetTaskOverrides::getPreferredArch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4 (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. This shape REPEATS in the file: one other method here (SettingsBuilder.getCommonTargetTaskOverrides) 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.
MacroConfigFileParser.parsePreprocessorDirective (cognitive 17) Sources/SWBMacro/MacroConfigFileParser.swift:208— MacroConfigFileParser.parsePreprocessorDirective has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.
MessageHandler.handleIndexingInfoRequest::getBuildDescriptionAndTargets (cognitive 17) Sources/SWBBuildService/Messages.swift:763— MessageHandler.handleIndexingInfoRequest::getBuildDescriptionAndTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (2 pts), match/switch 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.
ResourcesTaskProducer.addTasksForUngroupedFile (cognitive 17) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift:167— ResourcesTaskProducer.addTasksForUngroupedFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, match/switch 1 (3 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, 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.
WindowsDLLCopyTaskProducer.artifactBundleBuildFiles (cognitive 17) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/WindowsDLLCopyTaskProducer.swift:117— WindowsDLLCopyTaskProducer.artifactBundleBuildFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (buildFilesExpanding). 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.
ClangCachingKeyQueryTaskAction.performTaskAction (cognitive 17) Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift:45— ClangCachingKeyQueryTaskAction.performTaskAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (3 pts), ternaries 1 (3 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.
StaticArchive.machOs (cognitive 17) Sources/SWBUtil/MachO.swift:1531— StaticArchive.machOs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 10). 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.
Core.initializeSpecRegistry (cognitive 16) Sources/SWBCore/Core.swift:481— Core.initializeSpecRegistry has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 2 (5 pts), error handling 1 (4 pts), boolean chains 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.
SpecializationParameters.init (cognitive 16) Sources/SWBCore/DependencyResolution.swift:426— SpecializationParameters.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 1 (2 pts) (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.
LinkageDependencyResolver.implicitDependency (cognitive 16) Sources/SWBCore/LinkageDependencyResolver.swift:381— LinkageDependencyResolver.implicitDependency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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.
DependencyInfo.modify (cognitive 16) Sources/SWBCore/DependencyInfoEditPayload.swift:52— DependencyInfo.modify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (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.
BuildPhaseTarget.init (cognitive 16) Sources/SWBCore/ProjectModel/Target.swift:350— BuildPhaseTarget.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 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.
MacroValueAssignmentTable.init (cognitive 16) Sources/SWBMacro/MacroValueAssignmentTable.swift:300— MacroValueAssignmentTable.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (6 pts), 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.
GlobalProductPlan.computeSwiftMacroImplementationDescriptors (cognitive 16) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:481— GlobalProductPlan.computeSwiftMacroImplementationDescriptors 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.
GlobalProductPlan.computeTargetsWhichShouldBuildModulesInInstallAPI (cognitive 16) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:564— GlobalProductPlan.computeTargetsWhichShouldBuildModulesInInstallAPI has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (6 pts), boolean chains 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.
GlobalProductPlan.diagnoseInvalidDeploymentTargets (cognitive 16) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1050— GlobalProductPlan.diagnoseInvalidDeploymentTargets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (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.
BuildFilesProcessingContext.subsumeAdditionalFilesIfDesired (cognitive 16) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:246— BuildFilesProcessingContext.subsumeAdditionalFilesIfDesired has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 2 (7 pts), boolean chains 1 (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.
FilesBasedBuildPhaseTaskProducerBase.addTasksForRule (cognitive 16) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:763— FilesBasedBuildPhaseTaskProducerBase.addTasksForRule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 1 (3 pts), ternaries 1 (3 pts), loops 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.
FilesBasedBuildPhaseTaskProducerBase.sourceGenerationInputFiles (cognitive 16) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:819— FilesBasedBuildPhaseTaskProducerBase.sourceGenerationInputFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
ProductPostprocessingTaskProducer.addCopyAsideTasks (cognitive 16) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:185— ProductPostprocessingTaskProducer.addCopyAsideTasks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 1 (2 pts) (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.
SwiftABIBaselineGenerationTaskProducer.generateTasks (cognitive 16) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:144— SwiftABIBaselineGenerationTaskProducer.generateTasks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 1 (3 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.
Options.init (cognitive 16) Sources/SWBTaskExecution/TaskActions/ValidateProductTaskAction.swift:44— Options.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
CommandLineCheckable.checkCommandLineMatches (cognitive 16) Sources/SWBTestSupport/TasksCheckingResult.swift:273— CommandLineCheckable.checkCommandLineMatches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). Of this number, 8 points are the body's own statements and 8 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.
IndexStoreImpl.listTests (cognitive 16) Sources/SWBUtil/IndexStore.swift:86— IndexStoreImpl.listTests has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 2 (3 pts) (nesting depth added 7). 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, 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.
Path.normalize (cognitive 16) Sources/SWBUtil/Path.swift:604— Path.normalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 2, match/switch 1 (2 pts), ternaries 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.
InProcessConnection.start (cognitive 16) Sources/SwiftBuild/SWBBuildServiceConnection.swift:768— InProcessConnection.start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 1 (2 pts) (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.
OutOfProcessConnection.init (cognitive 16) Sources/SwiftBuild/SWBBuildServiceConnection.swift:867— OutOfProcessConnection.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 2 (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.
Near-duplicate member pair (63 shared lines) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:51— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:51-222 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:236-353 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) Sources/SWBApplePlatform/CoreMLCompiler.swift:134— Sources/SWBApplePlatform/CoreMLCompiler.swift:134-307 | Sources/SWBApplePlatform/IntentsCompiler.swift:124-258 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:491— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift:491-508 | Sources/SwiftBuildTestSupport/TestBuildOperationDelegate.swift:26-45 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) Sources/SWBCore/ProjectModel/Target.swift:350— Sources/SWBCore/ProjectModel/Target.swift:350-389 | Sources/SWBCore/ProjectModel/Target.swift:391-449 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:916— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:916-1006 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1008-1062 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) Sources/SWBCore/BuildRuleAction.swift:119— Sources/SWBCore/BuildRuleAction.swift:119-132 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:383-397 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:414-437 | Sources/SWBProtocol/MessageSupport.swift:189-210 | Sources/SWBProtocol/MessageSupport.swift:533-559 | Sources/SWBProtocol/PlanningOperationMessages.swift:97-118 | Sources/SWBProtocol/PlanningOperationMessages.swift:264-288 | Sources/SWBProtocol/ProjectModel/Project.swift:29-42 | Sources/SWBTaskExecution/BuildDescription.swift:619-672 | Sources/SWBTestSupport/TaskConstructionTester.swift:95-111 | Sources/SWBTestSupport/TestWorkspaces.swift:471-487 | Sources/SWBTestSupport/TestWorkspaces.swift:493-509 | Sources/SWBTestSupport/TestWorkspaces.swift:701-717 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:279-308 | Sources/SwiftBuild/SWBPreviewSupport.swift:113-149 | Sources/SwiftBuild/SWBProvisioningTaskInputs.swift:131-151 — These 16 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 16 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 16 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) Sources/SwiftBuild/ProjectModel/BuildPhases.swift:268— Sources/SwiftBuild/ProjectModel/BuildPhases.swift:268-273 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:290-295 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:312-317 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:334-339 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:358-366 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:398-414 | Sources/SwiftBuild/ProjectModel/References.swift:165-173 | Sources/SwiftBuild/ProjectModel/References.swift:257-265 | Sources/SwiftBuild/ProjectModel/Targets.swift:505-515 — These 9 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 9 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 9 times.
Duplicated block (41 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:888— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:888-928 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1014-1054 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:888` 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 (38 lines × 2) Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:165— Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:165-202 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:111-148 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 136 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/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:165` 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 (35–37 lines × 2) Sources/SWBCore/ProjectModel/Target.swift:353— Sources/SWBCore/ProjectModel/Target.swift:353-387 | Sources/SWBCore/ProjectModel/Target.swift:410-446 — 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 (33 lines × 2) Sources/SWBCore/Settings/Settings.swift:1070— Sources/SWBCore/Settings/Settings.swift:1070-1102 | Sources/SWBTestSupport/DummyCommandProducer.swift:80-112 — 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/SWBCore/Settings/Settings.swift:1070` 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 (30–31 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:73— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:73-102 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:150-180 — 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:73` 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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:103` calls `evaluate`, `join`, `getBaselineFileName` and `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SwiftFrameworkABICheckerTaskProducer.swift:182` 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 (30 lines × 3) Sources/SWBBuildService/Tools.swift:262— Sources/SWBBuildService/Tools.swift:262-291 | Sources/SWBBuildService/Tools.swift:379-408 | Sources/SWBBuildService/Tools.swift:509-538 — 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/SWBBuildService/Tools.swift:262` 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 (30 lines × 2) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:918— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:918-947 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:1012-1041 — 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 (29 lines × 4) Sources/SWBBuildService/Tools.swift:69— Sources/SWBBuildService/Tools.swift:69-97 | Sources/SWBBuildService/Tools.swift:246-274 | Sources/SWBBuildService/Tools.swift:363-391 | Sources/SWBBuildService/Tools.swift:493-521 — 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/SWBBuildService/Tools.swift:69` 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 (28 lines × 3) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:165— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:165-192 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:131-158 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:83-110 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:165` 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 (25 lines × 2) Sources/SWBCore/ProjectModel/Workspace.swift:156— Sources/SWBCore/ProjectModel/Workspace.swift:156-180 | Sources/SWBCore/ProjectModel/Workspace.swift:200-224 — 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/SWBCore/ProjectModel/Workspace.swift:156` 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 (19–22 lines × 4) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:175— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:175-194 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:141-160 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:93-111 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:207-228 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:175` 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 × 2) Sources/SWBUtil/MsgPack.swift:549— Sources/SWBUtil/MsgPack.swift:549-570 | Sources/SWBUtil/MsgPack.swift:590-611 — 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 (21 lines × 3) Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:28— Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift:28-48 | Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:24-44 | Sources/SWBApplePlatform/ExtensionPointExtractorTaskProducer.swift:100-120 — 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 (15–20 lines × 3) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:434— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:434-450 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:458-472 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:520-539 — 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:434` 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 (18–20 lines × 2) Sources/SWBCore/PlatformRegistry.swift:450— Sources/SWBCore/PlatformRegistry.swift:450-469 | Sources/SWBCore/PlatformRegistry.swift:485-502 — 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/SWBCore/PlatformRegistry.swift:450` 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. 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 (20 lines × 2) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:964— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:964-983 | Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:1084-1103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift:964` 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 (8–19 lines × 2) Sources/SWBBuildService/DocumentationInfo.swift:49— Sources/SWBBuildService/DocumentationInfo.swift:49-56 | Sources/SWBBuildService/PreviewInfo.swift:115-133 — 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/SWBBuildService/DocumentationInfo.swift:49` 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 (19 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:50— Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:50-68 | Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:53-71 — 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/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:50` 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 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 (15–18 lines × 3) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:46— Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:46-60 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:143-160 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:93-110 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 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/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:46` 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 (18 lines × 2) Sources/SWBCore/Settings/Settings.swift:1123— Sources/SWBCore/Settings/Settings.swift:1123-1140 | Sources/SWBCore/Settings/Settings.swift:1149-1166 — 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/SWBCore/Settings/Settings.swift:1123` 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–18 lines × 2) Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:456— Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:456-467 | Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:483-500 — 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/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift:456` 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–18 lines × 2) Sources/SWBUtil/MsgPack.swift:181— Sources/SWBUtil/MsgPack.swift:181-198 | Sources/SWBUtil/MsgPack.swift:226-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/SWBUtil/MsgPack.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 (16–17 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:105— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:105-121 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:92-107 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:105` 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 (16 lines × 3) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:99— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:99-114 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:49-64 | Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:52-67 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 83 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–16 lines × 2) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:52— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:52-67 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:41-54 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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. 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 (15 lines × 5) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:179— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:179-193 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:145-159 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:97-111 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:211-227 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:158-173 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:154` calls `Path` and `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:207` 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–15 lines × 4) Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:102— Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:102-115 | Sources/SWBTestSupport/TestWorkspaces.swift:175-189 | Sources/SWBTestSupport/TestWorkspaces.swift:243-255 | Sources/SWBTestSupport/TestWorkspaces.swift:283-295 — there are 4 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 4 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/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:102` 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–15 lines × 3) Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:184— Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:184-198 | Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift:191-205 | Sources/SWBTaskExecution/TaskActions/SwiftDriverJobSchedulingTaskAction.swift:187-195 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/SwiftCachingMaterializeKeyTaskAction.swift` as WHOLE FILES: this scan already matched 5 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. 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/SWBTaskExecution/TaskActions/ClangCachingMaterializeKeyTaskAction.swift:184` 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 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 (13–15 lines × 2) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1050— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1050-1064 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1475-1487 — 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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1050` 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 (1–14 lines × 3) Sources/SWBApplePlatform/CoreDataCompiler.swift:77— Sources/SWBApplePlatform/CoreDataCompiler.swift:77-90 | Sources/SWBApplePlatform/CoreMLCompiler.swift:249-249 | Sources/SWBApplePlatform/IntentsCompiler.swift:208-221 — before extracting anything, compare `Sources/SWBApplePlatform/CoreDataCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/SWBApplePlatform/CoreDataCompiler.swift:77` 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. 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 (13 lines × 5) Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:98— Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:98-114 | Sources/SWBTestSupport/TestWorkspaces.swift:176-188 | Sources/SWBTestSupport/TestWorkspaces.swift:210-222 | Sources/SWBTestSupport/TestWorkspaces.swift:242-254 | Sources/SWBTestSupport/TestWorkspaces.swift:282-294 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. 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 × 4) Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:49— Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:49-61 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:146-161 | Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.swift:96-111 | Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:52-64 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 73 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/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:49` 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 × 3) Sources/SWBQNXPlatform/Plugin.swift:56— Sources/SWBQNXPlatform/Plugin.swift:56-68 | Sources/SWBUniversalPlatform/BareMetal.swift:19-31 | Sources/SWBWebAssemblyPlatform/Plugin.swift:34-46 — 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 (12–13 lines × 2) Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:354— Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:354-365 | Sources/SWBTaskExecution/DynamicTaskSpecs/ClangModuleDependencyGraph.swift:648-660 — 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/SWBCore/LibSwiftDriver/LibSwiftDriver.swift:354` 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 × 14) Sources/SWBCore/BuildRuleAction.swift:121— Sources/SWBCore/BuildRuleAction.swift:121-132 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:386-397 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:426-437 | Sources/SWBProtocol/MessageSupport.swift:199-210 | Sources/SWBProtocol/MessageSupport.swift:548-559 | Sources/SWBProtocol/PlanningOperationMessages.swift:107-118 | Sources/SWBProtocol/PlanningOperationMessages.swift:277-288 | Sources/SWBProtocol/ProjectModel/Project.swift:31-42 | Sources/SWBTestSupport/TaskConstructionTester.swift:100-111 | Sources/SWBTestSupport/TestWorkspaces.swift:476-487 | Sources/SWBTestSupport/TestWorkspaces.swift:498-509 | Sources/SWBTestSupport/TestWorkspaces.swift:706-717 | Sources/SwiftBuild/SWBPreviewSupport.swift:138-149 | Sources/SwiftBuild/SWBProvisioningTaskInputs.swift:140-151 — there are 14 copies across 10 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 14 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/SWBCore/BuildRuleAction.swift:121` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `dependencyInfo` to `DependencyInfoFormat?` in one and `SWBProtocol.DependencyInfo? = 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 (12 lines × 5) Sources/SWBProtocol/MessageSupport.swift:546— Sources/SWBProtocol/MessageSupport.swift:546-557 | Sources/SWBProtocol/PlanningOperationMessages.swift:265-276 | Sources/SWBTaskExecution/BuildDescription.swift:646-657 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:294-305 | Sources/SwiftBuild/SWBPreviewSupport.swift:131-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBProtocol/MessageSupport.swift:546` 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/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:306` calls `Set` and `Sources/SWBProtocol/MessageSupport.swift:558` 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 (11–12 lines × 3) Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:124— Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:124-134 | Sources/SWBApplePlatform/EXUtil.swift:58-68 | Sources/SWBApplePlatform/EXUtil.swift:112-123 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift:124` 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/SWBApplePlatform/CoreMLCompiler.swift:157— Sources/SWBApplePlatform/CoreMLCompiler.swift:157-167 | Sources/SWBApplePlatform/IntentsCompiler.swift:149-160 — before extracting anything, compare `Sources/SWBApplePlatform/CoreMLCompiler.swift` and `Sources/SWBApplePlatform/IntentsCompiler.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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/SWBApplePlatform/CoreMLCompiler.swift:157` 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. 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 × 5) Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:98— Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift:98-111 | Sources/SWBTestSupport/TestWorkspaces.swift:198-208 | Sources/SWBTestSupport/TestWorkspaces.swift:210-220 | Sources/SWBTestSupport/TestWorkspaces.swift:242-252 | Sources/SWBTestSupport/TestWorkspaces.swift:282-292 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. 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–11 lines × 4) Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:51— Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:51-59 | Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift:40-48 | Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:112-122 | Sources/SWBTaskExecution/TaskActions/SignatureCollectionTaskAction.swift:28-36 — before extracting anything, compare `Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift` and `Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 141 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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:51` 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–10 lines × 3) Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:124— Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:124-133 | Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:161-170 | Sources/SWBTaskExecution/BuildDescription.swift:1524-1529 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:124` 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 (9–10 lines × 2) Sources/SWBApplePlatform/MiGCompiler.swift:74— Sources/SWBApplePlatform/MiGCompiler.swift:74-82 | Sources/SWBApplePlatform/MiGCompiler.swift:90-99 — 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/SWBApplePlatform/MiGCompiler.swift:74` 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–9 lines × 4) Sources/SWBUtil/MachO.swift:1368— Sources/SWBUtil/MachO.swift:1368-1376 | Sources/SWBUtil/MachO.swift:1397-1404 | Sources/SWBUtil/MachO.swift:1416-1423 | Sources/SWBUtil/MachO.swift:1435-1442 — 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. 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. 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–9 lines × 3) Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:117— Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:117-125 | Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:154-162 | Sources/SWBTaskExecution/BuildDescription.swift:1518-1523 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBTaskConstruction/ProductPlanning/BuildPlan.swift:117` 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 (4–9 lines × 3) Sources/SWBTaskExecution/BuildDescription.swift:967— Sources/SWBTaskExecution/BuildDescription.swift:967-975 | Sources/SWBTaskExecution/BuildDescription.swift:989-997 | Sources/SWBTaskExecution/BuildDescription.swift:1022-1025 — 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/SWBTaskExecution/BuildDescription.swift:967` 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 × 4) Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41— Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41-48 | Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.swift:149-156 | Sources/SWBTaskExecution/TaskActions/DeferredExecutionTaskAction.swift:28-35 | Sources/SWBTaskExecution/TaskActions/LSRegisterURLTaskAction.swift:44-51 — 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 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/SWBTaskExecution/TaskActions/CodeSignTaskAction.swift:41` 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 (7–8 lines × 2) Sources/SWBApplePlatform/AssetCatalogCompiler.swift:332— Sources/SWBApplePlatform/AssetCatalogCompiler.swift:332-339 | Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:188-194 — 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/SWBApplePlatform/AssetCatalogCompiler.swift:332` 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–6 lines × 7) Sources/SWBBuildService/BuildDescriptionMessages.swift:163— Sources/SWBBuildService/BuildDescriptionMessages.swift:163-165 | Sources/SWBBuildService/Messages.swift:749-751 | Sources/SWBBuildService/Messages.swift:841-846 | Sources/SWBBuildService/Messages.swift:950-955 | Sources/SWBBuildService/Messages.swift:990-992 | Sources/SWBBuildService/Messages.swift:1097-1102 | Sources/SWBBuildService/Messages.swift:1317-1321 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `DocumentationInfoRequest` in one and `LocalizationInfoRequest` 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/SWBBuildService/Messages.swift:841` calls `create` and `Sources/SWBBuildService/Messages.swift:990` 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 (4–5 lines × 9) Sources/SwiftBuild/ProjectModel/BuildPhases.swift:269— Sources/SwiftBuild/ProjectModel/BuildPhases.swift:269-273 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:291-295 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:313-317 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:335-339 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:358-361 | Sources/SwiftBuild/ProjectModel/BuildPhases.swift:398-401 | Sources/SwiftBuild/ProjectModel/References.swift:165-168 | Sources/SwiftBuild/ProjectModel/References.swift:257-260 | Sources/SwiftBuild/ProjectModel/Targets.swift:505-508 — there are 9 copies across 3 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/SwiftBuild/ProjectModel/BuildPhases.swift:358` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SwiftBuild/ProjectModel/BuildPhases.swift:269` calls `container` and `Sources/SwiftBuild/ProjectModel/BuildPhases.swift:358` 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 × 6) Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift:45— Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift:45-50 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift:184-189 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleSessionCommands.swift:23-28 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleSessionCommands.swift:72-77 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleSessionCommands.swift:96-101 | Sources/SwiftBuild/SWBBuildServiceConsole.swift:30-35 — there are 6 copies across 3 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.
Duplicated block (5 lines × 7) Sources/SWBProtocol/BuildOperationMessages.swift:363— Sources/SWBProtocol/BuildOperationMessages.swift:363-367 | Sources/SWBProtocol/BuildOperationMessages.swift:384-388 | Sources/SWBProtocol/BuildOperationMessages.swift:405-409 | Sources/SWBProtocol/BuildOperationMessages.swift:565-569 | Sources/SWBProtocol/BuildOperationMessages.swift:607-611 | Sources/SWBProtocol/BuildOperationMessages.swift:764-768 | Sources/SWBProtocol/DocumentationMessages.swift:72-76 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 5) Sources/SWBProtocol/ProjectModel/BuildPhase.swift:51— Sources/SWBProtocol/ProjectModel/BuildPhase.swift:51-56 | Sources/SWBProtocol/ProjectModel/Reference.swift:162-167 | Sources/SWBProtocol/ProjectModel/Reference.swift:236-241 | Sources/SWBProtocol/ProjectModel/Target.swift:87-92 | Sources/SWBProtocol/ProjectModel/Target.swift:239-244 — there are 5 copies across 3 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.
D4 · Code Duplication· Near-duplicate member family (3 members, 58 shared lines) · ×1
Near-duplicate member family (3 members, 58 shared lines) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:77— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:77-144 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:146-213 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:215-282 — These 3 members are variants of one another: a block of 58 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
Duplicated block (22 lines × 3) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:79— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:79-100 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:148-169 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:217-238 — 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:79` 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 (17 lines × 4) Sources/SWBTestSupport/TestWorkspaces.swift:188— Sources/SWBTestSupport/TestWorkspaces.swift:188-204 | Sources/SWBTestSupport/TestWorkspaces.swift:214-230 | Sources/SWBTestSupport/TestWorkspaces.swift:232-248 | Sources/SWBTestSupport/TestWorkspaces.swift:272-288 — 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. 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–14 lines × 3) Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1231— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1231-1242 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1246-1257 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1350-1363 — 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/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1231` 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 (4–11 lines × 3) Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:301— Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:301-311 | Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:396-406 | Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift:48-51 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift:301` calls `sparseSDKSearchPathArguments` and `Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift:48` 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 (10 lines × 3) Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:106— Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:106-115 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:175-184 | Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:244-253 — 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/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift:106` 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 (9 lines × 3) Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:34— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:34-42 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1097-1105 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:1195-1203 — 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.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Sync-over-async blocking Sources/SWBTestSupport/MockClock.swift:42— `sleep` is async and calls sleep — 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.
No direct assertions: testDynamicTaskScaling Tests/SWBBuildSystemPerfTests/ClangExplicitModulesPerfTests.swift:23— No conventional assertion call was detected, and 5 of 6 tests in `SWBBuildSystemPerfTests` 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: testScanningIncrementalPerformance Tests/SWBBuildSystemPerfTests/ClangExplicitModulesPerfTests.swift:120— No conventional assertion call was detected, and 5 of 6 tests in `SWBBuildSystemPerfTests` 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: modulesVerifierPerf Tests/SWBBuildSystemPerfTests/ModulesVerifierPerfTests.swift:22— No conventional assertion call was detected, and 5 of 6 tests in `SWBBuildSystemPerfTests` 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: swiftDriverBuildPerformance Tests/SWBBuildSystemPerfTests/SwiftDriverPerfTests.swift:107— No conventional assertion call was detected, and 5 of 6 tests in `SWBBuildSystemPerfTests` 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: incrementalBuildPerformance Tests/SWBBuildSystemPerfTests/SwiftDriverPerfTests.swift:118— No conventional assertion call was detected, and 5 of 6 tests in `SWBBuildSystemPerfTests` 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: apiDigesterDisableFailOnError Tests/SWBBuildSystemTests/APIDigesterBuildOperationTests.swift:25— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: appIntentsNLTraining Tests/SWBBuildSystemTests/AppIntentsNLTrainingTests.swift:28— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: appShortcutsStringsValidation_InvalidStringsFile Tests/SWBBuildSystemTests/AppShortcutsStringsValidationTests.swift:26— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: appShortcutsStringsValidation Tests/SWBBuildSystemTests/AppShortcutsStringsValidationTests.swift:104— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: automatorActionBuilding Tests/SWBBuildSystemTests/AppleScriptTests.swift:26— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: LLBuildBacktraceRecording Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:23— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: singleUseTaskBacktraceRecording Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:169— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: backtracesForDeletedOutputs Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:266— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: backtraceOfAlwaysExecutingTasks Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:331— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: mutatingTaskBacktraceRecording Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:385— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: backtraceTextRendering Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:476— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: signatureDiffing Tests/SWBBuildSystemTests/BuildBacktraceTests.swift:579— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: singleFileAnalyze Tests/SWBBuildSystemTests/BuildCommandTests.swift:245— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: swiftExclusivity Tests/SWBBuildSystemTests/BuildCommandTests.swift:255— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: skipDependenciesFlag Tests/SWBBuildSystemTests/BuildCommandTests.swift:350— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: copyAndResign Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift:33— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: packageDiamondProblemDiagnosticNoFalsePositives Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift:538— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: packageDiamondProblemDiagnosticDoesNotConsiderCopyResources Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift:547— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: packageDiamondProblemDiagnosticConsidersPackageTargets Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift:556— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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: packageDiamondProblemDiagnosticConsidersConflictingPackageProducts Tests/SWBBuildSystemTests/BuildDescriptionConstructionTests.swift:566— No conventional assertion call was detected, and 276 of 524 tests in `SWBBuildSystemTests` 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.
Orphaned file Sources/SwiftBuild/ProjectModel/BuildPhases.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/SWBTestSupport/TasksCheckingResult.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/SWBCore/ProjectModel/Workspace.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/SWBCore/BuildParameters.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/SWBCore/MacroConfigFileLoader.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/SWBCore/SpecImplementations/SpecParser.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/SWBUtil/MsgPack.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/SWBUtil/ArgumentSplitting.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/SWBUtil/Headermap.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/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductStructureTaskProducer.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/SWBBuildService/PreviewInfo.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/SWBTaskExecution/TaskActions/CopyPlistTaskAction.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/SWBApplePlatform/RealityAssetsTaskProducer.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/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.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/SWBCore/ProjectModel/BuildRule.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/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.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/SWBCore/BuildRuleSet.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/SWBCore/BuildDependencyInfo.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/SWBTestSupport/IndexingInfoResults.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/SwiftBuild/SWBProvisioningTaskInputs.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/SWBProtocol/ProjectModel/Target.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/SWBProtocol/BuildDescriptionMessages.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/SWBCore/ProjectModel/BuildFile.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/SWBUtil/MsgPackSerialization.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/SWBCore/ProjectModel/WorkspaceHeaderIndex.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.
Duplicated predicate Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:293— `!executionDelegate.userPreferences.enableDebugActivityLogs && !executionDelegate.emitFrontendCommandLines` appears character-identically in 2 files — Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift, Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.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.
Duplicated predicate Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1591— `!scope.effectiveInputInfoPlistPath().isEmpty && context.settings.productType?.hasInfoPlist == true` appears character-identically in 2 files — Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift, Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.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.
Duplicated predicate Sources/SWBCore/MacroEvaluationExtensions.swift:122— `SWBFeatureFlag.enableDefaultInfoPlistTemplateKeys.value || scope.evaluate(BuiltinMacros.GENERATE_INFOPLIST_FILE)` appears character-identically in 2 files — Sources/SWBCore/MacroEvaluationExtensions.swift, Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.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.
Duplicated predicate Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:86— `buildComponents.contains("build") || buildComponents.contains("installLoc") || (buildComponents.contains("api") && scope.evaluate(BuiltinMac…` appears character-identically in 2 files — Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift, Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/CopySwiftPackageResourcesTaskProducer.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.
Duplicated predicate Sources/SWBUtil/Process.swift:17— `canImport(Subprocess) && (!canImport(Darwin) || os(macOS))` appears character-identically in 2 files — Sources/SWBUtil/Process.swift, Sources/SWBUtil/ProcessController+Subprocess.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.
Duplicated predicate Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:218— `executionDelegate.userPreferences.enableDebugActivityLogs || executionDelegate.emitFrontendCommandLines` appears character-identically in 3 files — Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift, Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift, Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.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.
Duplicated predicate Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift:47— `fallback(buildValue) && areCASResultsValid(task, operationContext)` appears character-identically in 2 files — Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift, Sources/SWBTaskExecution/TaskActions/ClangScanTaskAction.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.
Duplicated predicate Sources/SWBApplePlatform/CoreMLCompiler.swift:157— `languageSettingValue.isEmpty || languageSettingValue == "Automatic"` appears character-identically in 2 files — Sources/SWBApplePlatform/CoreMLCompiler.swift, Sources/SWBApplePlatform/IntentsCompiler.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.
Duplicated predicate Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift:105— `os(macOS) || targetEnvironment(macCatalyst)` appears character-identically in 2 files — Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift, Sources/SwiftBuild/SWBBuildServiceConnection.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.
Duplicated predicate Sources/SWBTestSupport/FSUtilities.swift:51— `os(macOS) || targetEnvironment(macCatalyst) || !canImport(Darwin)` appears character-identically in 2 files — Sources/SWBTestSupport/FSUtilities.swift, Sources/SwiftBuild/SWBBuildServiceConnection.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.
Duplicated predicate Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift:179— `outputDirectory == nil && !foundOutdirOption` appears character-identically in 3 files — Sources/SWBTaskExecution/TaskActions/CopyPlistTaskAction.swift, Sources/SWBTaskExecution/TaskActions/CopyStringsFileTaskAction.swift, Sources/SWBTaskExecution/TaskActions/CopyTiffTaskAction.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.
Duplicated predicate Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift:211— `outputPath == nil && !foundOutputPathOption` appears character-identically in 2 files — Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift, Sources/SWBTaskExecution/TaskActions/ProcessProductProvisioningProfileTaskAction.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.
Duplicated predicate Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:503— `scope.evaluate(BuiltinMacros.BUILD_COMPONENTS).contains("installLoc") && ftb.fileType.isBundle` appears character-identically in 2 files — Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift, Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.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.
Duplicated predicate Sources/SWBApplePlatform/DevelopmentAssetsTaskProducer.swift:21— `scope.evaluate(BuiltinMacros.VALIDATE_DEVELOPMENT_ASSET_PATHS) != .no && !scope.evaluate(BuiltinMacros.DEVELOPMENT_ASSET_PATHS).isEmpty` appears character-identically in 2 files — Sources/SWBApplePlatform/DevelopmentAssetsTaskProducer.swift, Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/DevelopmentAssetsTaskProducer.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.
Duplicated predicate Sources/SWBCore/LinkageDependencyResolver.swift:145— `visited && configuredTarget.target.type == .aggregate && resolver.makeAggregateTargetsTransparentForSpecialization` appears character-identically in 2 files — Sources/SWBCore/LinkageDependencyResolver.swift, Sources/SWBCore/TargetDependencyResolver.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.
Silent fallback default in catch Sources/SWBAndroidPlatform/Plugin.swift:326— `additionalToolchains` 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/SWBMacro/MacroEvaluationProgram.swift:336— `apply` turns every thrown error into `"NO"` — 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/SWBQNXPlatform/Plugin.swift:87— `additionalSDKs` 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/SWBQNXPlatform/Plugin.swift:151— `additionalToolchains` 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/SWBTestSupport/TestWorkspaces.swift:1068— `computeProductReferenceName` 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/SWBUtil/ResponseFiles.swift:80— `tokenizeResponseFile` 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/SWBWindowsPlatform/Plugin.swift:79— `additionalEnvironmentVariables` 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/SWBWindowsPlatform/Plugin.swift:120— `additionalPlatformExecutableSearchPaths` 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: Sources/SWBApplePlatform/CoreMLCompiler.swift, Sources/SWBAndroidPlatform/AndroidSDK.swift, Sources/SWBUtil/HeavyCache.swift, Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleGeneralCommands.swift, Sources/SWBServiceCore/ServiceHostConnection.swift, Sources/SwiftBuild/SWBBuildServiceConsole.swift, Sources/SWBQNXPlatform/Plugin.swift, Sources/SWBUtil/Environment.swift (+8 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 8 significant file(s) lose their only recent owner: Sources/MockToolchainCASPlugin/PluginAPI.swift, Sources/MockToolchainCASPlugin/MockCAS.swift, Sources/SWBMockCASPluginSupport/MockCASTypes.swift, Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.swift, Sources/SWBMockCASPluginSupport/MockCASPluginLocator.swift, Sources/SWBTaskExecution/TaskActions/SwiftCachingOutputMaterializerTaskAction.swift, Sources/SWBTaskExecution/TaskActions/ClangCachingOutputMaterializerTaskAction.swift, Sources/SWBCAS/Errors.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 7 significant file(s) lose their only recent owner: Sources/SWBUtil/Serialization.swift, Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift, Sources/SWBUtil/IndexStore.swift, Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/HeadermapVFSTaskProducer.swift, Sources/SWBCore/WorkspaceSettingsCache.swift, Sources/SWBCore/Settings/CompilationCachingInfo.swift, Sources/SWBUtil/CollectionDifferenceExtensions.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/SWBCore/XCFramework.swift, Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift, Sources/SWBCore/SpecImplementations/Tools/ProcessXCFrameworkLibrary.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/SwiftBuildTestSupport/CoreQualificationTester.swift, Sources/SWBUtil/Version.swift, Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 10 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 (50 single-owned of 501 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; 501 of the 665 production source files in this repository met that bar). They are anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)) (+4 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/SWBCore/ProjectModel/ProjectModelItem.swift, Sources/SWBTaskConstruction/ProductPlanning/TopLevelLinkingTargetResolver.swift, Sources/SWBCore/ProjectModel/Reference.swift, Sources/SWBTaskConstruction/DiagnosticSupport.swift, Sources/SWBUtil/Array.swift, Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/HeadersTaskProducer.swift, Sources/SWBMacro/MacroConditionExpression.swift, Sources/SWBCore/BuildParameters.swift (+5 more).
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 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (148839 LoC, 2179 module-visible types across 55 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 207 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/SwiftBuild/ProjectModel/BuildPhases.swift, Sources/SWBTestSupport/TasksCheckingResult.swift, Sources/SWBCore/ProjectModel/Workspace.swift, Sources/SWBCore/BuildParameters.swift, Sources/SWBCore/MacroConfigFileLoader.swift, Sources/SWBCore/SpecImplementations/SpecParser.swift, Sources/SWBUtil/MsgPack.swift, Sources/SWBUtil/ArgumentSplitting.swift (and 199 more) (221 orphaned of 501 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; 501 of the 665 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.
Skipped (documented): prefixHeaderDependencies Tests/SWBBuildSystemTests/BuildOperationTests.swift:4724— 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): macOSTestingEntitlements Tests/SWBBuildSystemTests/BuildOperationTests.swift:4998— Skipped with a documented reason — a deferral, not lazy debt: llbuild needs to consult Swift Build for the rule signature on each build
Skipped (documented): optimizationRemarksDiagnostics Tests/SWBBuildSystemTests/BuildOperationTests.swift:7828— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): optimizationRemarksLTODiagnostics Tests/SWBBuildSystemTests/BuildOperationTests.swift:7864— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): explicitModulesEnvironment Tests/SWBBuildSystemTests/ClangExplicitModulesTests.swift:376— Skipped with a documented reason — a deferral, not lazy debt: setting global environment interferes concurrent tests
Skipped (documented): alternateLinkerSelection Tests/SWBBuildSystemTests/LinkerTests.swift:185— 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): statCachesExcludedFromStaleFileRemoval Tests/SWBBuildSystemTests/StaleFileRemovalTests.swift:90— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): prefixMapping Tests/SWBBuildSystemTests/SwiftCompilationCachingTests.swift:571— Skipped with a documented reason — a deferral, not lazy debt: to be enabled in the future after swift compiler fix
Skipped (documented): explicitBuildModuleSharingWithResponseFiles Tests/SWBBuildSystemTests/SwiftDriverTests.swift:1546— Skipped with a documented reason — a deferral, not lazy debt: Skip test in debug builds for performance reasons
Skipped (documented): appHostedTestTargetRebuild Tests/SWBBuildSystemTests/UnitTestBuildOperationTests.swift:661— 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): basics Tests/SWBCoreTests/RecursiveSearchPathResolverTests.swift:21— Skipped with a documented reason — a deferral, not lazy debt: chmod 100 won't prevent directory traversal when running as root
Skipped (documented): standardLibraryLinkingAllPlatforms Tests/SWBCoreTests/SwiftCompilerTests.swift:268— 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): crossCompileCommandLineTool Tests/SWBGenericUnixPlatformTests/SWBGenericUnixPlatformTests.swift:38— 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): relationalConditionExpressions Tests/SWBMacroTests/MacroConditionExpressionTests.swift:220— Skipped with a documented reason — a deferral, not lazy debt: Relational expressions were not implemented in Xcode's legacy build system support for macro condition expressions, and are not yet implemented in SWBMacro, so we don't test them here.
Skipped (documented): typeCoercion Tests/SWBMacroTests/MacroEvaluationTests.swift:842— 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): cXXFilesAreIgnoredWhenCXXSupportIsDisabled Tests/SWBTaskConstructionTests/ObjectiveCSymbolExtractorTests.swift:782— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): respectsTAPIExtractAPIOutputDirOverride Tests/SWBTaskConstructionTests/ObjectiveCSymbolExtractorTests.swift:919— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): packageInterfaceGen Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift:661— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): optOutIncrementalScanning Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift:1699— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): ensureTaskBelongToCorrectBuild Tests/SWBTestSupportTests/TestSupportTests.swift:44— 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): realpathWindows Tests/SWBUtilTests/FSProxyTests.swift:1348— 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): largerFile Tests/SWBUtilTests/PBXCpTests.swift:533— 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): testCanonicalPathRepresentation_deviceFiles Tests/SWBUtilTests/PathWindowsTests.swift:19— 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): uncaughtSignal Tests/SWBUtilTests/ProcessTests.swift:110— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
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 135 file(s) — `Plugins/generate-windows-installer-component-groups/generate-windows-installer-component-groups.swift`, `Plugins/run-xcodebuild/run-xcodebuild.swift`, `Sources/SWBAndroidPlatform/Plugin.swift`, `Sources/SWBApplePlatform/AssetCatalogCompiler.swift`, `Sources/SWBApplePlatform/RealityAssetsCompilerSpec.swift`, … (+130 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 01a186f8-0a44-70f7-adf8-9e82f0463f2c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 25 · Warnings: 2170 · Recommendations: 1185 · Info: 24 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-10-2026 @ 09:22 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.