Public report — swift-build, published 1 Oct 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_51bdb69846294cfb93f25307d5e54e37
Filed 1 October 2026, 09:08 UTC
Public
Large · 147,480 LoC · 53 projects · rebuild ~2.5 person-years · weakest lens: Readiness (53%)
Findings by grade
20 critical2124 serious966 minor42 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
1 October 2026, 09:01 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
3088findings with an exact file:lineof 3110 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
39/120dimensions across the health lenses147480 LoC · 53 projects — wide & deep
The system holds an adequate standing with a health score of 61%, indicating a workable asset that carries real operational risk. While the architecture is robust and security posture is strong, the overall reliability is compromised by gaps in operational readiness. This creates a fragile foundation for a large-scale application, where the cost of maintaining stability outweighs the benefits of its current structural integrity.
This is a substantial asset, comprising nearly 150,000 lines of production code with a rebuild effort estimated at 2.5 person-years and a cost of approximately €370,000. The value tied up here is significant, and the composition suggests a complex, logic-heavy system rather than simple boilerplate. Changing this system is expensive and time-consuming, meaning that any degradation in quality directly impacts the bottom line through increased maintenance overhead and delayed feature delivery.
The most critical risk lies in operational readiness, which scores poorly at 53%. For a system of this size, weak readiness means that changes ripple unpredictably, increasing the likelihood of outages and defects in production. Without proper disaster recovery procedures and robust testing coverage, the business faces exposure to extended downtime and data loss, which could severely damage customer trust and incur significant financial penalties.
A secondary concern is the velocity tax imposed by code quality issues. The average complexity and duplication levels act as a hidden cost, slowing down every change by an estimated 4–9%. This drag compounds over time, making it harder and more expensive to deliver new features. While the architecture is sound, the lack of maturity in documentation and testing means new teams will struggle to pick up the work, further increasing long-term costs.
On the positive side, the architecture is well-designed, and security controls are strong, providing a solid backbone for the application. The high security score indicates that the system is protected against common external threats, which is a significant asset in the current landscape.
The first action must be to implement a manual gate for releases, preventing bad builds from reaching users. This low-effort fix pays for itself within months by avoiding the high cost of production incidents. Focusing here provides the highest leverage, stabilizing the system before addressing deeper code quality issues.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
D22 · Inconsistent error handling naming convention. One method explicitly indicates throwing behavior in its name (`addTargetThrowing`), while the other does not (`addTarget`). This forces the caller to inspect the signature or documentation to know if a `do-catch` block is required, rather than relying on the method name.
D22 · Ambiguous method naming for optional parameters. The methods differ only by the presence of an optional parameter (`impartedBuildSettings`). While this is technically distinct, the lack of a distinguishing name (like `addBuildConfigWithImpartedSettings`) makes the API harder to discover and understand at a glance, relying on parameter count/type rather than semantic intent.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €120,000–€610,000
0.8× (at 61% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~2.5 person-years of build effort (about ~€370,000 to rebuild). Its weakest lens is Readiness at 53% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with ServiceCoreTests.swift.
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.
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 8.7–52.2 engineer-days every year, paid as drag on the ~86,424 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–4 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 4–9% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 21,310 line(s) changed over a 90-day window ⇒ ~86,424/year · D1/D2/D4/D6 code quality: averaging 6.4/10 ⇒ a 4–9% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 4 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~2.5 person-years to rebuild), and its weakest lens is Readiness at 53%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: 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. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ 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.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.4/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 4–9% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.4/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
33 modules, 165 dependencies. 1 dependency cycle across 21 modules, marked above the diagonal.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
10→18 SWBApplePlatform depends on SWBTaskConstructioncycle✕
Type pairs
44 distinct (type in SWBApplePlatform → type in SWBTaskConstruction) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
261 distinct (type in SWBApplePlatform → type in SWBCore) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBUniversalPlatform uses SWBTaskExecution. Changing SWBTaskExecution can break SWBUniversalPlatform, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
12→28 SWBUniversalPlatform depends on SWBCorecycle✕
Type pairs
50 distinct (type in SWBUniversalPlatform → type in SWBCore) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SwiftBuild uses MockToolchainCASPlugin. Changing MockToolchainCASPlugin can break SwiftBuild, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
15→14 SwiftBuildTestSupport depends on SwiftBuild✕
Type pairs
31 distinct (type in SwiftBuildTestSupport → type in SwiftBuild) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBProtocol uses SWBTestSupport. Changing SWBTestSupport can break SWBProtocol, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→19 SWBProtocol depends on SWBProjectModelcycle✕
Type pairs
30 distinct (type in SWBProtocol → type in SWBProjectModel) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBProjectModel. Changing SWBProjectModel can break SWBTaskConstruction, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→20 SWBTaskConstruction depends on SWBMacrocycle✕
Type pairs
34 distinct (type in SWBTaskConstruction → type in SWBMacro) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBMacro. Changing SWBMacro can break SWBTaskConstruction, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→21 SWBTaskConstruction depends on SWBUtilcycle✕
Type pairs
132 distinct (type in SWBTaskConstruction → type in SWBUtil) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBTaskConstruction uses SWBBuildService. Changing SWBBuildService can break SWBTaskConstruction, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→28 SWBTaskConstruction depends on SWBCorecycle✕
Type pairs
383 distinct (type in SWBTaskConstruction → type in SWBCore) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
SWBBuildSystem uses SWBBuildService. Changing SWBBuildService can break SWBBuildSystem, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
24→26 SWBBuildSystem depends on SWBTaskExecutioncycle✕
Type pairs
26 distinct (type in SWBBuildSystem → type in SWBTaskExecution) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
145 distinct (type in SWBBuildService → type in SWBServiceCore) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
135 distinct (type in SWBBuildService → type in SWBProtocol) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
257 distinct (type in SWBTaskExecution → type in SWBUtil) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
328 distinct (type in SWBTaskExecution → type in SWBCore) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
29 distinct (type in SWBAndroidPlatform → type in SWBUtil) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
29 distinct (type in SWBCore → type in SWBTaskConstruction) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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
A03:2021 — Injection
10
High / Critical
A05:2021 — Security Misconfiguration
1
Medium
Roadmap
First, implement draft release gates to prevent bad builds from reaching users, and codify disaster recovery procedures with clear RTO and RPO targets in your infrastructure code. Next, fix the empty test in ServiceCoreTests.swift to ensure meaningful test coverage. Finally, establish a structured directory for architecture decision records to document key design choices and their consequences.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with ServiceCoreTests.swift.
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.
Resolve the 9 Orphaned knowledge finding(s) in Knowledge Freshness — start with MacroExpressionParsing.swift, DiagnosticsEngine.swift, DependencyCycleFormatter.swift.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Raise allocation-aware density on the hot paths — currently 92 use(s) across 147,473 production line(s) (~0.6/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
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 — 20
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 — 2124
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 — 966
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 42
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. 34 of 39 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 39 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, 3088 of 3110 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.
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: no test result was produced. 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 — 10 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. 2 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-llbuild, swift-tools-protocols.
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`, … (+129 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.
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.
C4 Data Retention — 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 retention 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 retention controls.
C5 Data-Subject Rights — 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 data-subject rights 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 data-subject rights controls.
ED5 Idempotency — 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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.
PF3 Async & latency 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. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X14 Bypassable address classification — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X20 Mistyped argument 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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X21 Side-effecting pattern 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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 and Java source only, and no C# was loaded and no JavaScript/TypeScript or Java 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 and Java source only, and no C# was loaded and no JavaScript/TypeScript or Java 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.
X26 Unsynchronised callback handoff — 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, Kotlin and Scala source only, and no C# was loaded, no Java, Kotlin or Scala was found, 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.
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 and Rust source only, and no C# was loaded and no Java 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.
X28 Index access outside its own emptiness 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 Scala source only, and no C# was loaded and no Scala 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.
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 and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java 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.
X3 Exception handling — 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 implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 source only, and no C# was loaded and no Scala 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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, 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.
X6 Hand-rolled structured-format parsing — 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 Python, JavaScript/TypeScript, Go, Java/Kotlin/Scala, Ruby, PHP and Rust source only, and no C# was loaded and none of those languages 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.
X7 Silent fallback defaults — 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#, Python, TypeScript/JavaScript, Rust, Go, Java and Kotlin syntax only, and no C#, Python, TypeScript/JavaScript, Rust, Go, Java or Kotlin was loaded for 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.
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.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
150 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SourcesTaskProducer.generateTasks at 161. A further 10 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 27 — 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 27), Sources/SwiftBuild/SWBBuildServer.swift (SWBBuildServer.reportEventStream at 22), Sources/SWBUtil/PropertyList.swift (PropertyListItem.== at 19), Sources/SWBCore/FileToBuild.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.
+ 141 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 Options.init (cyclomatic 16) finding(s) in Cyclomatic Complexity — start with ClangModuleVerifierInputGeneratorTaskAction.swift, CopyStringsFileTaskAction.swift, SignatureCollectionTaskAction.swift. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 SourcesTaskProducer.generateTasks (cyclomatic 161) finding(s) in Cyclomatic Complexity — start with SourcesTaskProducer.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 SourcesTaskProducer.computeLibraries (cyclomatic 99) finding(s) in Cyclomatic Complexity — start with SourcesTaskProducer.swift. — One of this dimension's main actionable groups (1 warning-level).
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.
+ 264 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 Options.init (cognitive 17) finding(s) in Cognitive Complexity — start with ProcessProductEntitlementsTaskAction.swift, ProcessProductProvisioningProfileTaskAction.swift. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 SourcesTaskProducer.generateTasks (cognitive 439) finding(s) in Cognitive Complexity — start with SourcesTaskProducer.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 SourcesTaskProducer.computeLibraries (cognitive 297) finding(s) in Cognitive Complexity — start with SourcesTaskProducer.swift. — One of this dimension's main actionable groups (1 warning-level).
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 40 MethodTooLong finding(s) in God Classes — start with Settings.swift (5), PIFGenerationModel.swift (2), SourcesTaskProducer.swift (2). — One of this dimension's main actionable groups (40 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.
247 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. 31 of the 267 are in trees this repository does not ship — vendored, example/demo, 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.
+ 90 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 25 of the 53 (the rest declare no modelled class or interface, export only macros, 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.
2945 test methods: 2938 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), 1119 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2945 tests (6 harness-style project(s) excluded from the assertion penalty).
No assertions (empty test): basicsTests/SWBServiceCoreTests/ServiceCoreTests.swift:16
No assertions: androidPlatformFilterIsActive · ×192Tests/SWBAndroidPlatformTests/SWBAndroidPlatformTests.swift:147
Test project verifies nothing: SWBServiceCoreTests · ×2Tests/SWBServiceCoreTests/ServiceCoreTests.swift:16
No direct assertions: testDynamicTaskScaling · ×926Tests/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 192 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 (192 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 3 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 3 — 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. 5 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. ★ 2 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-llbuild`, `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 21 Hotspot finding(s) in Churn × Complexity Hotspots — start with SwiftCompiler.swift, Settings.swift, SourcesTaskProducer.swift. — One of this dimension's main actionable groups (21 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.1 / 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.
43 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 496 of the 658 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 · ×6
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.
1083 deducted task-comment markers across 147480 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/SWBApplePlatform/RegisterExecutionPolicyException.swift:38
What to do
Resolve the 957 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 (957 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), Core.swift, SpecRegistry.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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README (Swift Build) is a clear, well-structured overview of the project and its usage across SwiftPM, Xcode, xcodebuild, and debugging. The document is supplemented by five architecture/Docs markdown files covering build-system architecture, dynamic tasks, indexing support, platform support, and the Swift driver, each fully outlining their sections and present in the summary. The README for the Sources/SWBCLibc/ directory (internal C headers) and the Windows Platform README are directed at that subdirectory rather than the repository root, so they fall under internal focus rather than missing overview/installation.
Documentation: no contributor guidanceREADME.md
✓ On the Gold path — maintain.
Detailed fixes: d19_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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
2 API inconsistencies across a 400-member sample of 740 exposed types.
Inconsistent error handling naming convention. One method explicitly indicates throwing behavior in its name (`addTargetThrowing`), while the other does not (`addTarget`). This forces the caller to inspect the signature or documentation to know if a `do-catch` block is required, rather than relying on the method name.
Ambiguous method naming for optional parameters. The methods differ only by the presence of an optional parameter (`impartedBuildSettings`). While this is technically distinct, the lack of a distinguishing name (like `addBuildConfigWithImpartedSettings`) makes the API harder to discover and understand at a glance, relying on parameter count/type rather than semantic intent.
What to do
Resolve the 1 Inconsistent error handling naming convention. One method explicitly… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous method naming for optional parameters. The methods differ only… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
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 4 file(s) — `Sources/SWBBuildService/BuildOperationMessages.swift` (line 15, line 22, line 62, …), `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` — 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.
209 of 496 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Sources/SWBMacro/MacroExpressionParsing.swift. Counted over 496 of the 658 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 9 Orphaned knowledge finding(s) in Knowledge Freshness — start with MacroExpressionParsing.swift, DiagnosticsEngine.swift, DependencyCycleFormatter.swift. — One of this dimension's main actionable groups (9 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.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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 92 use(s) across 147,473 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.
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 — 1 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 — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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 — 76 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-01T09:02:01Z" level=warning msg="The \"WORKSPACE_DIR\" variable is not set. Defaulting to a blank string." time="2026-10-01T09:02:01Z" 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.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not scored — 10 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.
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. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D32 Data Compliance (PII/GDPR) — 134 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: 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. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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# syntax, and none was loaded for this repository. 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.
PF3 Async & latency hygiene — Sync-over-async was not assessed: this repository's async code is written in Swift, whose blocking calls this check does not model yet. That is a gap in the analyzer's language reach, not a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not 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 — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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 reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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
X26 Unsynchronised callback handoff — 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
X28 Index access outside its own emptiness 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
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
X3 Exception handling — 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 — 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
X7 Silent fallback defaults — 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
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/SWBMacro/MacroExpressionParsing.swift— 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— 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— 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— 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— 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— 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— 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— 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— 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 Sources/SWBAndroidPlatform/Plugin.swift:190— // FIXME: Make this configurable in a better way so we don't need to push build settings at the SDK definition level — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Sources/SWBQNXPlatform/Plugin.swift:128— // FIXME: Make this configurable in a better way so we don't need to push build settings at the SDK definition level — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Sources/SWBAndroidPlatform/Plugin.swift:310— // FIXME: androideabi for armv7! — 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/SWBApplePlatform/StoryboardLinker.swift:33— // FIXME: There's no way to emit any errors here. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Sources/SWBApplePlatform/Plugin.swift:259— // FIXME: rdar://65011964 (Remove PLATFORM_PREFERRED_ARCH) — 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/SWBApplePlatform/Plugin.swift:330— // FIXME: This is a bit hacky, but we don't have a good way here to check "is any Apple platform". — 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/SWBApplePlatform/MiGCompiler.swift:88— // FIXME: We shouldn't need to lookup known file 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/SWBApplePlatform/MiGCompiler.swift:91— // FIXME: We shouldn't need to lookup known file 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/SWBUniversalPlatform/YaccCompiler.swift:62— // FIXME: We shouldn't need to lookup known file 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/SWBApplePlatform/MiGCompiler.swift:118— // FIXME: Populate the outputs. — 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/SWBApplePlatform/InterfaceBuilderShared.swift:47— // FIXME: We could push a setting for 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.
FixmeComment Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:25— // FIXME: We should be using FileTypeSpec.conformsTo() here, but we don't have a good way in this context to look up the file type. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Sources/SWBApplePlatform/InterfaceBuilderCompiler.swift:96— // FIXME: Add the output paths for the .strings files. I think this is a little tricky because ibtool will lay down strings files for .xibs, but not for .storyboards; instead the storyboard linker will put the .strings files in place. I'm not certain about that, though. — 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/SWBApplePlatform/IntentsCompiler.swift:212— // FIXME: Should we emit a generic error in this case? Should the code generator ever return no files to be generated? — 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/SWBApplePlatform/CoreMLCompiler.swift:253— // FIXME: Should we emit a generic error in this case? Should the code generator ever return no files to be generated? — 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/SWBApplePlatform/CoreDataCompiler.swift:81— // FIXME: Should we emit a generic error in this case? Should the code generator ever return no files to be generated? — 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/SWBApplePlatform/ImageScaleFactorsInputFileGroupingStrategy.swift:16— // FIXME: Presently we have no good way during grouping to detect whether we're matching a single file against tiffutil or multiple files against tiffutil. In principle we could handle that in FilesBasedBuildPhaseTaskProducer once all grouping is completed. But at present this is handled in a hackier manner in TiffUtilToolSpec.constructTasks() - see the FIXME comment therein for more about 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.
FixmeComment Sources/SWBApplePlatform/IIGCompiler.swift:54— // FIXME: We should consider making an actual "CpHeader" tool, then sinking the Unifdef conditional into 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.
FixmeComment Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/HeadersTaskProducer.swift:57— // FIXME: We should consider making an actual "CpHeader" tool, then sinking the Unifdef conditional into 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.
FixmeComment Sources/SWBBuildService/Session.swift:246— // FIXME: This should just map on the UUID type, not a string. — 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/Session.swift:273— // FIXME: This should just map on the UUID type, not a string. — 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/PreviewInfo.swift:105— // FIXME: We have temporarily disabled going through the planning operation, since it was causing significant churn: <rdar://problem/31772753> ProvisioningInputs are changing substantially for the same request — 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/Messages.swift:781— // FIXME: We have temporarily disabled going through the planning operation, since it was causing significant churn: <rdar://problem/31772753> ProvisioningInputs are changing substantially for the same request — 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/DocumentationInfo.swift:44— // FIXME: We have temporarily disabled going through the planning operation, since it was causing significant churn: <rdar://problem/31772753> ProvisioningInputs are changing substantially for the same request — 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/PlanningOperation.swift:246— // FIXME: We should report an issue if we couldn't read the file. Though presently I think the provisioning inputs generation machinery will do that, it might be clearer to just deal with it ourselves. However, if `CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION` is being used, the file path might point to a generated file which hasn't yet been created, and we won't be able to read it anyways. — 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:2470— 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 Sources/SWBApplePlatform/RealityAssetsTaskProducer.swift:250— // TODO: check that schemaPath file exists and is not empty — 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/SWBApplePlatform/IIGCompiler.swift:41— // TODO: Make unconditionally true once the following lands: — 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/SWBApplePlatform/CoreMLCompiler.swift:147— //TODO: rdar://59938938 rename intentsCodegenVisibility to a more generic name — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/SWBApplePlatform/ActoolInputFileGroupingStrategy.swift:33— // TODO Should we make this a property of the product type? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Sources/SWBBuildService/Messages.swift:130— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBBuildService/Messages.swift:137— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBBuildService/Messages.swift:144— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBBuildService/Messages.swift:1712— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBProtocol/Message.swift:338— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBProtocol/Message.swift:362— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBProtocol/Message.swift:1315— // TODO: Delete once all clients are no longer calling the public APIs which invoke this message — 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/SWBBuildService/BuildOperationMessages.swift:187— // TODO: Maybe this should go in its own object/delegate that can be shared between OperationDelegate and PreparationProgressDelegate. — 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/SWBBuildService/BuildDependencyInfo.swift:130— // TODO: all of the below are using linkType: .searchPath, we aren't reporting .absolutePath — 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/SWBBuildService/BuildDependencyInfo.swift:133— // TODO: static frameworks? — 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/SWBBuildService/BuildDependencyInfo.swift:152— // TODO: Deduplicate inputs if we can (and if we want to bother). — 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/SWBCAS/CASFSNode.swift:38— // TODO: user, mode, group, etc. — 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/SWBCAS/CASFSNode.swift:44— // TODO: user, mode, group, etc. — 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/SWBCAS/CASFSNode.swift:69— // TODO: user, mode, group, etc. — 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/XCFramework.swift:1269— // TODO: Consider allowing flat layout for swiftmodule/swiftinterface files. (rdar://51674808) — 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/SDKRegistry.swift:1116— // TODO: Turn this validation back on once our path handling is cleaned up a bit more — 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/SDKRegistry.swift:1275— // TODO: Turn this validation back on once our path handling is cleaned up a bit more — 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/SDKRegistry.swift:1171— // TODO are these going to be appropriate for all kinds of SDK's? — 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/SDKRegistry.swift:1209— // TODO handle tripleProperties.toolSearchPaths — 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/SDKRegistry.swift:1259— // TODO: Leave compatible toolchain information in Swift SDKs — 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/PlannedNode.swift:87— // TODO: this should really be some kind of weak map or its lifetime scoped to a build description — 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 50) Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift:19— CapturingTaskGenerationDelegate's methods fall into 50 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 50 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 47) Sources/SWBTestSupport/TaskPlanningTestSupport.swift:238— TestTaskPlanningDelegate's methods fall into 47 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 47 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 44) Sources/SWBTaskExecution/BuildDescriptionManager.swift:734— BuildSystemTaskPlanningDelegate's methods fall into 44 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 44 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:727— 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: CustomTaskTypeDescription (LCOM4 8) Sources/SWBCore/CustomTaskTypeDescription.swift:15— CustomTaskTypeDescription'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: SourcesTaskProducer (LCOM4 8) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:204— 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: 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:373— 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: Session (LCOM4 6) Sources/SWBBuildService/Session.swift:30— Session'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: 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:2106— 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: BuildConfigurationFilter.matches Sources/SWBProjectModel/PIFGenerationModel.swift:22— MethodTooLong — matches runs 767 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 667 over it, 7.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SourcesTaskProducer.generateTasks Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:840— MethodTooLong — generateTasks runs 572 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 472 over it, 5.72× 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: Core.createTestingCore Sources/SWBCore/Core.swift:36— MethodTooLong — createTestingCore runs 344 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 244 over it, 3.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SourcesTaskProducer.computeLibraries Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:339— MethodTooLong — computeLibraries runs 324 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 224 over it, 3.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SettingsBuilder.getCommonTargetTaskOverrides Sources/SWBCore/Settings/Settings.swift:4374— MethodTooLong — getCommonTargetTaskOverrides runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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:1133— MethodTooLong — construct runs 250 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 150 over it, 2.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 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 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 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:535— 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: SourcesBuildPhase.init Sources/SWBProjectModel/PIFGenerationModel.swift:283— MethodTooLong — init runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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:1462— 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: SettingsBuilder.analyzeSettings Sources/SWBCore/Settings/Settings.swift:5705— 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: SwiftDriverJobTaskAction.performTaskAction Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:343— MethodTooLong — performTaskAction 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:1786— 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:792— 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: XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— MethodTooLong — generateXCTRunnerTasks runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 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:5071— 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: 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.
FileTooLong: Settings/Settings.swift Sources/SWBCore/Settings/Settings.swift— FileTooLong — 3225 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: SettingsBuilder (1211-6134). The bar is 500 significant lines; this is 2725 over it, 6.45× 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 — 1540 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1040 over it, 3.08× 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 — 1370 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 870 over it, 2.74× 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 — 1332 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 832 over it, 2.66× 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 — 1007 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 507 over it, 2.01× 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 — 999 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 499 over it, 2.00× 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 — 966 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 466 over it, 1.93× 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 — 956 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 456 over it, 1.91× 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 — 926 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 426 over it, 1.85× 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 — 787 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 287 over it, 1.57× 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 — 766 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 266 over it, 1.53× 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 — 653 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 153 over it, 1.31× 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 — 648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 148 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.
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:84-89 — 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:1042— Sources/SWBCore/Settings/Settings.swift:1042-1046 | 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:1042` 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.
Hotspot: Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:1170— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 256 in SwiftCompilerSpec.constructTasks at line 1170. 2 of those changes were fix/bug commits, and the other 17 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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:4374— Sources/SWBCore/Settings/Settings.swift changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in SettingsBuilder.getCommonTargetTaskOverrides at line 4374. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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:840— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 161 in SourcesTaskProducer.generateTasks at line 840. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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:1091— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in ClangCompilerSpec.constructTasks at line 1091. 1 of those changes was a fix/bug commit, and the other 9 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBTestSupport/TestWorkspaces.swift Sources/SWBTestSupport/TestWorkspaces.swift:171— Sources/SWBTestSupport/TestWorkspaces.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in TestFile.fileType at line 171. 2 of those changes were fix/bug commits, and the other 6 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01:00' --full-history --no-merges -- Sources/SWBTestSupport/TestWorkspaces.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:457— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in LdLinkerSpec.constructLinkerTasks at line 457. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBCore/TargetDependencyResolver.swift Sources/SWBCore/TargetDependencyResolver.swift:286— Sources/SWBCore/TargetDependencyResolver.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in TargetDependencyResolver.computeGraph at line 286. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01:00' --full-history --no-merges -- Sources/SWBCore/TargetDependencyResolver.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 6 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBTaskConstruction/TaskProducers/TaskProducer.swift Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:764— Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in TaskProducerContext.willProduceBinary at line 764. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SwiftBuild/SWBBuildServer.swift Sources/SwiftBuild/SWBBuildServer.swift:419— Sources/SwiftBuild/SWBBuildServer.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in SWBBuildServer.reportEventStream at line 419. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift:24— Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ProcessXCFrameworkTaskAction.performTaskAction at line 24. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01:00' --full-history --no-merges -- Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.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:29— Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TAPISymbolExtractorTaskProducer.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in TAPISymbolExtractorTaskProducer.generateTasks at line 29. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/TaskActions/SwiftDriverTaskAction.swift Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift:34— Sources/SWBTaskExecution/TaskActions/SwiftDriverTaskAction.swift changed 3 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBCore/ShellScript.swift Sources/SWBCore/ShellScript.swift:80— Sources/SWBCore/ShellScript.swift changed 3 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBCore/SpecImplementations/Tools/TAPITools.swift Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift:74— Sources/SWBCore/SpecImplementations/Tools/TAPITools.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in TAPIToolSpec.constructTAPITasks at line 74. 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01:00' --full-history --no-merges -- Sources/SWBCore/SpecImplementations/Tools/TAPITools.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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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/SWBUtil/PbxCp.swift Sources/SWBUtil/PbxCp.swift:515— Sources/SWBUtil/PbxCp.swift changed 2 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 21:56:21 +01:00' --until='2026-09-30 21:56:21 +01: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.
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:1884-1890 — 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:1189— Sources/SWBBuildService/Messages.swift:1189-1195 | Sources/SWBBuildService/Messages.swift:1233-1239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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:1685— Sources/SWBBuildSystem/BuildOperation.swift:1685-1691 | Sources/SWBBuildSystem/BuildOperation.swift:1712-1718 — both copies are in the same file, so extract the 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:1685` 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:1149— Sources/SWBTaskExecution/BuildDescription.swift:1149-1155 | 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:195-208 — 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:390— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:390-396 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:400-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.
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:1001— Sources/SWBTestSupport/BuildOperationTester.swift:1001-1006 | Sources/SWBTestSupport/BuildOperationTester.swift:1017-1022 — both copies are in the same file, so extract the 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:1001` 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:606-611 — 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:3739-3744 — 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.
TooManyMethods: TaskProducerContext Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:55— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× 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: CapturingTaskGenerationDelegate Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift:19— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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.
TooManyMethods: SWBBuildServiceSession Sources/SwiftBuild/SWBBuildServiceSession.swift:39— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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.
TooManyMethods: OperationSystemAdaptor Sources/SWBBuildSystem/BuildOperation.swift:1452— 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:1211— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× 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 — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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:373— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× 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: Path Sources/SWBUtil/Path.swift:38— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× 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: Core Sources/SWBCore/Core.swift:41— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.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.
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. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SWBBuildService Sources/SwiftBuild/SWBBuildService.swift:44— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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:275— Sources/SWBCore/LinkageDependencyResolver.swift:275-283 | Sources/SWBCore/LinkageDependencyResolver.swift:315-323 — both copies are in the same file, so extract the 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:275` 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:3730-3738 — 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:3048— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3048-3056 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3104-3113 — both copies are in the same file, so extract the 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:3048` 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:1673— Sources/SWBBuildSystem/BuildOperation.swift:1673-1680 | Sources/SWBBuildSystem/BuildOperation.swift:1700-1707 — both copies are in the same file, so extract the 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:479— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:479-486 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:488-495 — both copies are in the same file, so extract the 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:479` 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:1452— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1452-1459 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1848-1855 — both copies are in the same file, so extract the 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:1452` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/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/CCompiler.swift:894— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:894-903 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:808-818 — 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/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 (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.
ClassTooLong: SettingsBuilder Sources/SWBCore/Settings/Settings.swift:1211— ClassTooLong — 2547 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 2147 over it, 6.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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:1452— 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 — 570 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 170 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 — 496 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 96 over it, 1.24× 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 — 466 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 66 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:660-672 — 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:325— Sources/SWBTestSupport/BuildOperationTester.swift:325-337 | 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:324` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (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 (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:5112— Sources/SWBCore/Settings/Settings.swift:5112-5123 | 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:346— Sources/SWBTestSupport/BuildOperationTester.swift:346-353 | Sources/SWBTestSupport/BuildOperationTester.swift:660-666 | 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:722— Sources/SWBBuildSystem/BuildOperation.swift:722-736 | Sources/SWBBuildSystem/BuildOperation.swift:761-775 — both copies are in the same file, so extract the 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:2490— Sources/SWBBuildSystem/BuildOperation.swift:2490-2500 | Sources/SWBBuildSystem/BuildOperation.swift:2503-2513 — both copies are in the same file, so extract the 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:469— Sources/SWBCore/LinkageDependencyResolver.swift:469-479 | Sources/SWBCore/LinkageDependencyResolver.swift:498-508 — both copies are in the same file, so extract the 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:469` 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:3708— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3708-3718 | Sources/SWBCore/ToolInfo/ClangToolInfo.swift:188-198 — 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:1438— Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1438-1448 | Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1837-1847 — both copies are in the same file, so extract the 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:1438` 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:1449` calls `Set`, `contains`, `next` and `Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift:1848` 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:3019— Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3019-3029 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:3065-3075 — both copies are in the same file, so extract the 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:3019` 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.
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.
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 Tests/SWBBuildSystemTests/ClangCompilationCachingTests.swift:1031— // 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 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.
Change coupling: BuiltinTaskActionsExtension.swift ↔ TaskPlanningTestSupport.swift Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift— `Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift` and `Sources/SWBTestSupport/TaskPlanningTestSupport.swift` change together 91% of the time (10 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 10 shared commits counted here, the most recent 3 are `70f1baa6` Revert "Rewrite TouchTool to use FSProxy instead of shell utilities"; `e7cbaf49` Rewrite TouchTool to use FSProxy instead of shell utilities; `00136cb9` Ensure embed-in-code accessor is regenerated when resources change — run `git show` on any of them.
Change coupling: BuiltinTaskActionsExtension.swift ↔ CapturingTaskGenerationDelegate.swift Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift— `Sources/SWBTaskExecution/BuiltinTaskActionsExtension.swift` and `Sources/SWBTestSupport/CapturingTaskGenerationDelegate.swift` change together 91% of the time (10 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 10 shared commits counted here, the most recent 3 are `70f1baa6` Revert "Rewrite TouchTool to use FSProxy instead of shell utilities"; `e7cbaf49` Rewrite TouchTool to use FSProxy instead of shell utilities; `00136cb9` Ensure embed-in-code accessor is regenerated when resources change — run `git show` on any of them.
Change coupling: Plugin.swift ↔ Plugin.swift Sources/SWBAndroidPlatform/Plugin.swift— `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— `Sources/SWBCore/Settings/BuiltinMacros.swift` and `Sources/SWBUniversalPlatform/TestEntryPointGenerationTaskAction.swift` change together 69% of the time (9 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 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— `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— `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 (5 lines × 3) Sources/SWBBuildService/Messages.swift:1191— Sources/SWBBuildService/Messages.swift:1191-1195 | Sources/SWBBuildService/Messages.swift:1214-1218 | Sources/SWBBuildService/Messages.swift:1235-1239 — 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:1211` calls `lookup`, `error` and `Sources/SWBBuildService/Messages.swift:1190` 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:1294— Sources/SWBCore/TaskGeneration.swift:1294-1298 | 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/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.
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:1075-1091 — 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:1693-1709 — 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:84— Sources/SWBApplePlatform/PluginDCLT.swift:84-89 | 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: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. 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.17, instability 0.10, distance 0.73 — 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:3630-3636 — 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:349— Sources/SWBTestSupport/BuildOperationTester.swift:349-353 | Sources/SWBTestSupport/BuildOperationTester.swift:662-666 | 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:349` 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:45-106 | 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:748-831 | Sources/SWBBuildService/Messages.swift:840-868 | Sources/SWBBuildService/Messages.swift:950-983 | Sources/SWBBuildService/Messages.swift:992-1021 | Sources/SWBBuildService/Messages.swift:1096-1139 | Sources/SWBBuildService/Messages.swift:1318-1367 — 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 161) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:840— SourcesTaskProducer.generateTasks has cyclomatic complexity 161 (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.
SourcesTaskProducer.computeLibraries (cyclomatic 99) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:339— SourcesTaskProducer.computeLibraries has cyclomatic complexity 99 (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.getCommonTargetTaskOverrides (cyclomatic 84) Sources/SWBCore/Settings/Settings.swift:4374— SettingsBuilder.getCommonTargetTaskOverrides has cyclomatic complexity 84 (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.computeGraph (cyclomatic 83) Sources/SWBCore/TargetDependencyResolver.swift:286— TargetDependencyResolver.computeGraph has cyclomatic complexity 83 (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.
SDKRegistry.registerSDK (cyclomatic 76) Sources/SWBCore/SDKRegistry.swift:636— SDKRegistry.registerSDK has cyclomatic complexity 76 (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.
CopyFilesTaskProducer.addTasksForUngroupedFile (cyclomatic 76) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift:204— CopyFilesTaskProducer.addTasksForUngroupedFile has cyclomatic complexity 76 (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.construct (cyclomatic 66) Sources/SWBTaskExecution/BuildDescription.swift:1133— BuildDescription.construct has cyclomatic complexity 66 (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.
FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles (cyclomatic 63) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/FilesBasedBuildPhaseTaskProducer.swift:420— FilesBasedBuildPhaseTaskProducerBase.groupAndAddTasksForFiles has cyclomatic complexity 63 (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.construct (cyclomatic 61) Sources/SWBCore/Settings/Settings.swift:1462— 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:5705— SettingsBuilder.analyzeSettings has cyclomatic complexity 54 (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 53) Sources/SWBBuildSystem/BuildOperation.swift:535— BuildOperation._build has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActoolCompilerSpec.constructTasks (cyclomatic 52) Sources/SWBApplePlatform/AssetCatalogCompiler.swift:129— ActoolCompilerSpec.constructTasks has cyclomatic complexity 52 (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.
ExecutableTask.formattedRuleInfo (cyclomatic 51) Sources/SWBCore/ExecutableTask.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.
SwiftPackageCopyFilesTaskProducer.buildFilesForPackages (cyclomatic 50) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift:22— SwiftPackageCopyFilesTaskProducer.buildFilesForPackages has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DependencyResolver.lookupConfiguredTarget (cyclomatic 49) Sources/SWBCore/DependencyResolution.swift:792— 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). 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 47) Sources/SwiftBuild/SWBBuildOperation.swift:102— SWBBuildOperation.handleMessage has cyclomatic complexity 47 (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:1786— 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:5071— 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). 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). 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 39) Sources/SWBApplePlatform/AppIntentsMetadataCompiler.swift:76— AppIntentsMetadataCompilerSpec.constructTasks has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsBuilder.addRunDestinationSettingsPlatformSDK (cyclomatic 38) Sources/SWBCore/Settings/Settings.swift:3794— SettingsBuilder.addRunDestinationSettingsPlatformSDK has cyclomatic complexity 38 (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.
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:3982— SettingsBuilder.computeSigningSettings 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.
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). 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:1429— 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.checkForDiamondProblemsInPackageProductLinkage (cyclomatic 32) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1108— GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage 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.
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.
SettingsBuilder.addSDKSettings (cyclomatic 30) Sources/SWBCore/Settings/Settings.swift:2725— SettingsBuilder.addSDKSettings has cyclomatic complexity 30 (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.
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). 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.
MacroConfigFileLoader.loadSettingsFromConfig (cyclomatic 28) Sources/SWBCore/MacroConfigFileLoader.swift:104— MacroConfigFileLoader.loadSettingsFromConfig 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). 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.
GlobalProductPlan.computeIPIClangInfo (cyclomatic 27) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:746— GlobalProductPlan.computeIPIClangInfo 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:363— BuildOperation.build 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.
XCFramework.createXCFramework (cyclomatic 26) Sources/SWBCore/XCFramework.swift:1115— XCFramework.createXCFramework 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.getTargetDerivedSettings (cyclomatic 26) Sources/SWBCore/Settings/Settings.swift:2230— 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:5552— SettingsBuilder.bindDeploymentTarget 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.
GlobalProductPlan.generatesModuleMap (cyclomatic 26) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1559— 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). 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:2543— 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.
SettingsBuilder.analyzeExcludedLocalizationFiles (cyclomatic 25) Sources/SWBCore/Settings/Settings.swift:6001— SettingsBuilder.analyzeExcludedLocalizationFiles 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). 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:253— BuildRequestContext.selectConfiguredTargetForIndex 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/TaskProducer.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.
XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks (cyclomatic 24) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks 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). 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.
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:274— 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.
SettingsBuilder.addPlatformSettings (cyclomatic 23) Sources/SWBCore/Settings/Settings.swift:2542— 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.
TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles (cyclomatic 23) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1555— TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles 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). 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:3609— 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.
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.
Core.createInitializedTestingCore (cyclomatic 21) Sources/SWBCore/Core.swift:51— Core.createInitializedTestingCore 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.
TargetDependencyResolver.addDependencies (cyclomatic 21) Sources/SWBCore/TargetDependencyResolver.swift:690— 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.
SettingsBuilder.addSwiftSDKToolsetSettings (cyclomatic 21) Sources/SWBCore/Settings/Settings.swift:2946— SettingsBuilder.addSwiftSDKToolsetSettings 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.
CompilationCachingConfigFileTaskProducer.generateTasks (cyclomatic 21) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift:27— CompilationCachingConfigFileTaskProducer.generateTasks 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.
MacroEvaluationMsg.handle (cyclomatic 20) Sources/SWBBuildService/Messages.swift:1410— 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). 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.libraryInfo (cyclomatic 20) Sources/SWBCore/XCFramework.swift:1013— XCFramework.libraryInfo has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. 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:5306— 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:5401— SettingsBuilder.getSDKSpecificPathOverrides 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.
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/SWBTaskExecution/BuildDescription.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.
XCFramework.copy (cyclomatic 19) Sources/SWBCore/XCFramework.swift:1290— XCFramework.copy 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 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.
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). 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). 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.
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:2414— 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). 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:764— 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). 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:4914— 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/SWBProjectModel/PIFGenerationModel.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. This is NOT this file's highest cyclomatic complexity: FileReference.fileTypeIdentifier (cyclomatic 23) 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.
GlobalProductPlan.computeArtifactBundleInfo (cyclomatic 17) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:585— 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). 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.
SwiftDriverJobTaskAction.replayCachedCommand (cyclomatic 17) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:606— SwiftDriverJobTaskAction.replayCachedCommand 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.
BuildOperationTester.checkBuild (cyclomatic 17) Sources/SWBTestSupport/BuildOperationTester.swift:1464— 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 18) 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). 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:2351— 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:380— 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/SDKRegistry.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:2425— 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). 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:510— 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:1501— 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). 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.
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.
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/SWBApplePlatform/RegisterExecutionPolicyException.swift:38— 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 439) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:840— SourcesTaskProducer.generateTasks has cognitive complexity 439 (threshold 15). Drivers by points: if/else 100 (306 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 267). 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 297) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:339— SourcesTaskProducer.computeLibraries has cognitive complexity 297 (threshold 15). Drivers by points: if/else 60 (182 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 201). 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). 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 190) Sources/SWBCore/Settings/Settings.swift:4374— SettingsBuilder.getCommonTargetTaskOverrides has cognitive complexity 190 (threshold 15). Drivers by points: if/else 64 (138 pts), loops 10 (28 pts), boolean chains 13, 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.
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). 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). 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.
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). To reduce it, split the body into named stages: move each independent 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:1133— 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). To reduce it, split the body into named stages: move each independent 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:5705— 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). To reduce it, split the body into named stages: move each independent 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:1462— 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:535— 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). To reduce it, split the body into named stages: move each independent 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:792— 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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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 (cognitive 83) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SwiftPackageCopyFilesTaskProducer.swift:22— SwiftPackageCopyFilesTaskProducer.buildFilesForPackages has cognitive complexity 83 (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.
SettingsBuilder.getBuildPhaseTargetTaskOverrides (cognitive 82) Sources/SWBCore/Settings/Settings.swift:5071— 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:1786— 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/TaskProducer.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.
XCFramework.createXCFramework (cognitive 63) Sources/SWBCore/XCFramework.swift:1115— XCFramework.createXCFramework has cognitive complexity 63 (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.
GlobalProductPlan.checkForDiamondProblemsInPackageProductLinkage (cognitive 62) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:1108— 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). To reduce it, split the body into named stages: move each independent 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/SWBCore/ExecutableTask.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.addSDKSettings (cognitive 56) Sources/SWBCore/Settings/Settings.swift:2725— SettingsBuilder.addSDKSettings has cognitive complexity 56 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 3, boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 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.
GlobalProductPlan.computeIPIClangInfo (cognitive 56) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:746— GlobalProductPlan.computeIPIClangInfo has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 6 (11 pts), boolean chains 5, ternaries 2 (4 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.
MacroConfigFileLoader.loadSettingsFromConfig (cognitive 55) Sources/SWBCore/MacroConfigFileLoader.swift:104— MacroConfigFileLoader.loadSettingsFromConfig has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 2 (4 pts), match/switch 2 (3 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.
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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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.
XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks (cognitive 52) Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/XCTestProductTypeTaskProducer.swift:90— XCTestProductPostprocessingTaskProducer.generateXCTRunnerTasks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 4 (7 pts), match/switch 2 (7 pts), error handling 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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). To reduce it, split the body into named stages: move each independent 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.
SettingsBuilder.getSDKSpecificPathOverrides (cognitive 51) Sources/SWBCore/Settings/Settings.swift:5401— SettingsBuilder.getSDKSpecificPathOverrides has cognitive complexity 51 (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.
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.
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:3794— 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). To reduce it, split the body into named stages: move each independent 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:5552— 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). To reduce it, split the body into named stages: move each independent 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 48) Sources/SWBCore/Settings/Settings.swift:2946— SettingsBuilder.addSwiftSDKToolsetSettings has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 5, loops 2 (5 pts), match/switch 1 (5 pts), error handling 1 (2 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.
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:585— 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.
CompilationCachingConfigFileTaskProducer.generateTasks (cognitive 48) Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers/CompilationCachingConfigFileTaskProducer.swift:27— CompilationCachingConfigFileTaskProducer.generateTasks has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 2 (6 pts), boolean chains 3, error handling 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.
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:1559— 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.
SettingsBuilder.analyzeExcludedLocalizationFiles (cognitive 44) Sources/SWBCore/Settings/Settings.swift:6001— SettingsBuilder.analyzeExcludedLocalizationFiles has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 5 (9 pts), boolean chains 4, match/switch 1 (3 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.
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:3982— 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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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:1429— 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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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:2542— 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:5306— 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.
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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:2543— 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:690— 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/SWBProjectModel/PIFGenerationModel.swift:342— 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.
TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles (cognitive 38) Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift:1555— TaskProducerContext.computeFlattenedFrameworksPhaseBuildFiles has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 7, 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.
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/SWBTaskExecution/BuildDescription.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:363— 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). To reduce it, split the body into named stages: move each independent 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:3609— 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). To reduce it, split the body into named stages: move each independent 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:510— 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.
Core.createInitializedTestingCore (cognitive 36) Sources/SWBCore/Core.swift:51— Core.createInitializedTestingCore has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 4 (7 pts), boolean chains 3 (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.
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). To reduce it, split the body into named stages: move each independent 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.
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.
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/SWBCore/ProjectModel/Target.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:253— 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). To reduce it, split the body into named stages: move each independent 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.getTargetDerivedSettings (cognitive 32) Sources/SWBCore/Settings/Settings.swift:2230— 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:739— 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). To reduce it, split the body into named stages: move each independent 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:2425— 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.
SwiftDriverJobTaskAction.replayCachedCommand (cognitive 31) Sources/SWBTaskExecution/TaskActions/SwiftDriverJobTaskAction.swift:606— SwiftDriverJobTaskAction.replayCachedCommand has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (6 pts), ternaries 1 (2 pts), error handling 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.
GlobalProductPlan.computeImpartedBuildProperties (cognitive 30) Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift:681— 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). To reduce it, split the body into named stages: move each independent 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:388— 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:524— 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.
SettingsBuilder.getTargetTaskOverrides (cognitive 28) Sources/SWBCore/Settings/Settings.swift:4914— 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). To reduce it, split the body into named stages: move each independent 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:110— 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). To reduce it, split the body into named stages: move each independent 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:1410— 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.
Task.init (cognitive 26) Sources/SWBTaskExecution/Task.swift:358— Task.init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, 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.
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:2351— 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:919— Settings.infoForBuildSettingsEditor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsBuilder.addSecondaryTargetDerivedSettings (cognitive 25) Sources/SWBCore/Settings/Settings.swift:2343— 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.
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.
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:523— 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/SWBCore/ExecutableTask.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/SWBProjectModel/PIFGenerationModel.swift:388— 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/SWBProtocol/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:1464— 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). To reduce it, split the body into named stages: move each independent 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.computeDiscoveredTargetInfo (cognitive 23) Sources/SWBCore/TargetDependencyResolver.swift:797— 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). 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.
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). To reduce it, split the body into named stages: move each independent 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:1726— 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/SDKRegistry.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:290— 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). To reduce it, split the body into named stages: move each independent 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:1501— 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.
BuildOperationTester.checkBuildDescription (cognitive 22) Sources/SWBTestSupport/BuildOperationTester.swift:1373— 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:611— 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). 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.
BuildRule.init (cognitive 21) Sources/SWBProjectModel/PIFGenerationModel.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:274— 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:2414— 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:764— 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). 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:386— 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). To reduce it, split the body into named stages: move each independent 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). 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:607— 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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). To reduce it, split the body into named stages: move each independent 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). To reduce it, split the body into named stages: move each independent 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/PIFGenerationModel.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.
BuildDescriptionManager.generatePreviewInfo (cognitive 19) Sources/SWBTaskExecution/BuildDescriptionManager.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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:269— 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). To reduce it, split the body into named stages: move each independent 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:408— 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). 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:1056— 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:1387— 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.
SourcesPhaseBasedTaskGenerationDelegate.createTask (cognitive 18) Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:121— SourcesPhaseBasedTaskGenerationDelegate.createTask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 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.
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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scalar.escapedForC (cognitive 18) Sources/SWBUtil/String.swift:312— Scalar.escapedForC has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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:2017— 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/SWBCore/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.
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:2052— 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.
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.
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). To reduce it, split the body into named stages: move each independent 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 17) Sources/SWBTaskExecution/BuildDescription.swift:672— BuildDescriptionBuilder.construct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 3, loops 2 (3 pts), 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.
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:425— 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:380— 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/TaskGeneration.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:478— 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:561— 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:1024— 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). To reduce it, split the body into named stages: move each independent 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). 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:865— 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.
D22 · Internal API Consistency· Inconsistent error handling naming convention. One method explicitly indicates throwing behavior in its name (`addTargetThrowing`), while the other does not (`addTarget`). This forces the caller to inspect the signature or documentation to know if a `do-catch` block is required, rather than relying on the method name. · ×1
Inconsistent error handling naming convention. One method explicitly indicates throwing behavior in its name (`addTargetThrowing`), while the other does not (`addTarget`). This forces the caller to inspect the signature or documentation to know if a `do-catch` block is required, rather than relying on the method name. — Unify naming. Either rename `addTarget` to `addTargetThrowing` for consistency, or rename `addTargetThrowing` to `addTarget` if the non-throwing version is the primary API and the throwing one is legacy/specific. Ideally, Swift APIs should use `throws` in the signature and not encode 'Throwing' in the name unless distinguishing between a throwing and non-throwing variant of the exact same operation is critical (which is rare and usually discouraged in favor of `Result` types or optional returns). (signatures: Project.addTargetThrowing(id:productType:name:productName:approvedByUser:) | Project.addTarget(id:productType:name:productName:))
D22 · Internal API Consistency· Ambiguous method naming for optional parameters. The methods differ only by the presence of an optional parameter (`impartedBuildSettings`). While this is technically distinct, the lack of a distinguishing name (like `addBuildConfigWithImpartedSettings`) makes the API harder to discover and understand at a glance, relying on parameter count/type rather than semantic intent. · ×1
Ambiguous method naming for optional parameters. The methods differ only by the presence of an optional parameter (`impartedBuildSettings`). While this is technically distinct, the lack of a distinguishing name (like `addBuildConfigWithImpartedSettings`) makes the API harder to discover and understand at a glance, relying on parameter count/type rather than semantic intent. — Consider using a builder pattern or a single method with a configuration struct/enum to handle optional parameters, or name the methods to reflect the presence of the imparted settings (e.g., `addBuildConfigWithImpartedSettings`). However, given the prevalence of this pattern in legacy codebases, this is a minor consistency issue compared to the first one. (signatures: Project.addBuildConfig(name:settings:impartedBuildSettings:) | Project.addBuildConfig(name:settings:))
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:616-667 | 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:267-296 | 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:1062— Sources/SWBCore/Settings/Settings.swift:1062-1094 | 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:1062` 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:1115— Sources/SWBCore/Settings/Settings.swift:1115-1132 | Sources/SWBCore/Settings/Settings.swift:1141-1158 — both copies are in the same file, so extract the 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:1115` 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:991— Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:991-1005 | Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift:1416-1428 — both copies are in the same file, so extract the 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:991` 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:643-655 — 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:642-653 | Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommandProtocol.swift:282-293 | 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:294` 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:1514-1519 — 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:1508-1513 — 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:949— Sources/SWBTaskExecution/BuildDescription.swift:949-957 | Sources/SWBTaskExecution/BuildDescription.swift:971-979 | Sources/SWBTaskExecution/BuildDescription.swift:1004-1007 — 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:949` 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:752-754 | Sources/SWBBuildService/Messages.swift:844-849 | Sources/SWBBuildService/Messages.swift:953-958 | Sources/SWBBuildService/Messages.swift:993-995 | Sources/SWBBuildService/Messages.swift:1100-1105 | Sources/SWBBuildService/Messages.swift:1320-1324 — 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:844` calls `create` and `Sources/SWBBuildService/Messages.swift:993` 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:1224— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1224-1235 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1239-1250 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:1343-1356 — 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:1224` 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:1081-1089 | Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift:1160-1168 — 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 (2–5 lines × 3) Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:2015— Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:2015-2016 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:2035-2039 | Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift:2044-2048 — 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:2015` 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.
Coverage not measured — Swift suite — 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. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
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.
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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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 272 of 518 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:243— No conventional assertion call was detected, and 272 of 518 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:253— No conventional assertion call was detected, and 272 of 518 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:348— No conventional assertion call was detected, and 272 of 518 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:32— No conventional assertion call was detected, and 272 of 518 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:537— No conventional assertion call was detected, and 272 of 518 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:546— No conventional assertion call was detected, and 272 of 518 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:555— No conventional assertion call was detected, and 272 of 518 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:565— No conventional assertion call was detected, and 272 of 518 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 11 significant file(s) lose their only recent owner: Sources/SWBAndroidPlatform/AndroidSDK.swift, Sources/SWBUtil/HeavyCache.swift, Sources/SWBServiceCore/ServiceHostConnection.swift, Sources/SWBQNXPlatform/Plugin.swift, Sources/SWBApplePlatform/PluginDCLT.swift, Sources/SWBUtil/Environment.swift, Sources/SWBUtil/Promise.swift, Sources/SWBWindowsPlatform/VSInstallation.swift (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 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/BuildFileResolution.swift, Sources/SWBUtil/CollectionDifferenceExtensions.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: Sources/SwiftBuildTestSupport/CoreQualificationTester.swift, Sources/SWBUtil/Version.swift, Sources/SWBApplePlatform/AppIntentsSSUTrainingCompiler.swift, Sources/SWBTestSupport/Xcode.swift. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: Sources/SWBTaskExecution/TaskActions/ClangCachingKeyQueryTaskAction.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 #5 — If anonymized user #5 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 #6 — If anonymized user #6 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/SWBCore/ProjectModel/Reference.swift, Sources/SWBTaskConstruction/DiagnosticSupport.swift, Sources/SWBUtil/AsyncCache.swift. Pair on, review, or document these before any departure.
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/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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 8 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 (43 single-owned of 496 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 496 of the 658 production source files in this repository met that bar). They are 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)), anonymized user #12 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
Documentation: no contributor guidance README.md— There is no guidance for contributors in the root README. Include a short contributing doc covering pull request process, CI, and how to run tests locally.
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)` (147480 LoC, 1487 public types across 49 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) — 200 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/SWBBuildService/Session.swift, Sources/SWBCore/SpecImplementations/SpecParser.swift, Sources/SWBUtil/MsgPack.swift, Sources/SWBUtil/ArgumentSplitting.swift, Sources/SWBUtil/Headermap.swift, Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductStructureTaskProducer.swift (and 192 more) (209 orphaned of 496 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 496 of the 658 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:4721— 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:4995— 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:7825— 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:7861— 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:476— 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:1542— 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:660— 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:1698— 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 134 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`, … (+129 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 01a0f6b2-daba-7cf6-82d9-68075066a6fc · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 20 · Warnings: 2124 · Recommendations: 942 · Info: 24 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 01-10-2026 @ 09:01 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.