Public report of nicklockwood/SwiftFormat, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 26 October 2026, 09:01 UTC · Survey ID cd_e4c532d72b494706ae122f241c46aeac
nicklockwood/SwiftFormat
Measured 26 October 2026, 08:56 UTC, at code version 0e8082b
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 75,959 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 1.4 person-years · Weakest lens: Maturity, 49
Findings by how serious they are
67 critical807 serious5553 minor
21 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 08:56 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
61of 61 dimensions measured by tools.
6411of 6427 findings point to an exact file and line, so you can open each one in the code. The other 16 concern the repository as a whole, such as missing documentation.
61dimensions across 7 lenses, read from 75,959 lines of product code in 5 projects.
nicklockwood/SwiftFormat falls short of our standard for a preview release, in part because we found no recorded design decisions and no architecture document or diagram. It scores 59 out of 100 and is rated Adequate, and 66 of its 67 critical findings are security problems.
Maturity, at 49, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 8 points. Bringing the documentation in line with the code is another step, worth about 5 points. Raising Maturity to 62 would lift the score to about 64.
Fifty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Six secrets can leak from the build pipeline, and four pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Pinning each tool to an exact version, limiting each secret to its own step and passing outside input through environment variables would close these risks. Correcting the flagged pipeline settings would fix the three weaknesses in the build pipeline's configuration, and setting a waiting period for automatic updates would deal with the automatic dependency update that takes a new release at once. Saving the change and the message together would take care of the place where data is saved and a message sent separately.
The product code is 75,959 lines, about €200,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
CI/CD gates · CI formatting step cannot fail REDACTED
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 24 findings
These 24 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
CI/CD gates · CI formatting step cannot fail REDACTED
Observability · No structured logging
Rebuild cost: about €200,000 · Estimate
Cost to rebuild
€66,000 to €330,000, for 1,107 to 3,512 hours of work, about 1.4 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 59. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 75,959 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 8 points · Low effort · ADR Quality
2
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Reconcile the README with reality: Snapshots/Euclid/README.md links to `Euclid.png?raw=true`, but `Snapshots/Euclid/Euclid.png` does not exist; Snapshots/Euclid/README.md links to `CONTRIBUTING.md`, but `Snapshots/Euclid/CONTRIBUTING.md` does not exist; Snapshots/Layout/README.md links to `Layout.gif?raw=true`, but `Snapshots/Layout/Layout.gif` does not exist.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Files that change often carry extra risk · Combined risk
12 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (12 files) · Code Coverage (188 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: FormattingHelpers.swift, CommandLine.swift and ParsingHelpers.swift
What to do: Add tests to these files and have a second person review every change to them, starting with FormattingHelpers.swift, CommandLine.swift and ParsingHelpers.swift.
Where the investment is most exposed · Value at risk
This code would cost about €200,000 to build again, about 1.4 person-years of work. Its weakest lens is Maturity, at 49 (Weak). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.2 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 23,134 lines over the last 90 days, which is about 93,821 lines a year. At that pace, the extra work comes to an estimated 16.3 to 97.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
10 modules, with 19 dependencies between them. One loop runs through 7 of the modules, marked above the diagonal.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
Snapshots~Euclid uses Snapshots~Expression, so a change to Snapshots~Expression can break Snapshots~Euclid, while a change to Snapshots~Euclid can't break Snapshots~Expression.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Snapshots~Consumer uses Snapshots~Euclid, so a change to Snapshots~Euclid can break Snapshots~Consumer, while a change to Snapshots~Consumer can't break Snapshots~Euclid.
Position
Below the diagonal: Snapshots~Consumer uses a module listed above it, which is the healthy direction.
5→6 Snapshots~Consumer uses repositorypart of a loop✕
Connections
4 pairs of types, where a type in Snapshots~Consumer uses a type in repository.
Snapshots~Consumer uses repository, so a change to repository can break Snapshots~Consumer, while a change to Snapshots~Consumer can't break repository.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
5→8 Snapshots~Consumer uses Snapshots~Expressionpart of a loop✕
Connections
2 pairs of types, where a type in Snapshots~Consumer uses a type in Snapshots~Expression.
Snapshots~Consumer uses Snapshots~Expression, so a change to Snapshots~Expression can break Snapshots~Consumer, while a change to Snapshots~Consumer can't break Snapshots~Expression.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in repository uses a type in Snapshots~Consumer.
The types involved
repository.Consumer → Snapshots~Consumer.Match
Direction
repository uses Snapshots~Consumer, so a change to Snapshots~Consumer can break repository, while a change to repository can't break Snapshots~Consumer.
Position
Below the diagonal: repository uses a module listed above it, which is the healthy direction.
6→8 repository uses Snapshots~Expressionpart of a loop✕
Connections
89 pairs of types, where a type in repository uses a type in Snapshots~Expression. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository uses Snapshots~Expression, so a change to Snapshots~Expression can break repository, while a change to repository can't break Snapshots~Expression.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→9 repository uses EditorExtension~Applicationpart of a loop✕
Connections
1 pair of types, where a type in repository uses a type in EditorExtension~Application.
repository uses EditorExtension~Application, so a change to EditorExtension~Application can break repository, while a change to repository can't break EditorExtension~Application.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Snapshots~Parsing uses Snapshots~Expression, so a change to Snapshots~Expression can break Snapshots~Parsing, while a change to Snapshots~Parsing can't break Snapshots~Expression.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Snapshots~Expression uses repository, so a change to repository can break Snapshots~Expression, while a change to Snapshots~Expression can't break repository.
Position
Below the diagonal: Snapshots~Expression uses a module listed above it, which is the healthy direction.
Snapshots~Expression uses Snapshots~Parsing, so a change to Snapshots~Parsing can break Snapshots~Expression, while a change to Snapshots~Expression can't break Snapshots~Parsing.
Position
Below the diagonal: Snapshots~Expression uses a module listed above it, which is the healthy direction.
EditorExtension~Application uses repository, so a change to repository can break EditorExtension~Application, while a change to EditorExtension~Application can't break repository.
Position
Below the diagonal: EditorExtension~Application uses a module listed above it, which is the healthy direction.
EditorExtension~Application uses Snapshots~Expression, so a change to Snapshots~Expression can break EditorExtension~Application, while a change to EditorExtension~Application can't break Snapshots~Expression.
Position
Below the diagonal: EditorExtension~Application uses a module listed above it, which is the healthy direction.
Snapshots~Sprinter uses repository, so a change to repository can break Snapshots~Sprinter, while a change to Snapshots~Sprinter can't break repository.
Position
Below the diagonal: Snapshots~Sprinter uses a module listed above it, which is the healthy direction.
Snapshots~Sprinter uses Snapshots~Expression, so a change to Snapshots~Expression can break Snapshots~Sprinter, while a change to Snapshots~Sprinter can't break Snapshots~Expression.
Position
Below the diagonal: Snapshots~Sprinter uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 57% · Adequate · gated by D1, D2, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
69
High / Critical
A03:2025 — Software Supply Chain Failures
11
Medium
A02:2025 — Security Misconfiguration
2
High / Critical
Roadmap
Begin by establishing architectural governance by creating an ADR folder to document significant design decisions and their consequences. Simultaneously, correct documentation drift by fixing broken links in the README files and reconciling them with the actual repository structure. Next, enforce type safety by initializing a Ruby type checker, migrating files from loose to strict typing, and eliminating unsafe nil assertions. Finally, address the twelve high-churn complexity hotspots, prioritizing FormattingHelpers.swift, CommandLine.swift, and ParsingHelpers.swift to reduce technical debt.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Reconcile the README with reality: Snapshots/Euclid/README.md links to `Euclid.png?raw=true`, but `Snapshots/Euclid/Euclid.png` does not exist; Snapshots/Euclid/README.md links to `CONTRIBUTING.md`, but `Snapshots/Euclid/CONTRIBUTING.md` does not exist; Snapshots/Layout/README.md links to `Layout.gif?raw=true`, but `Snapshots/Layout/Layout.gif` does not exist.
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Bring the 69 bodies over 30 down to 30 or less in Cognitive Complexity — start with Formatter.addOrRemoveSelf::processBody (cognitive 394), Tokenizer.swift.tokenize::processToken (cognitive 202), CommandLine.swift.processArguments (cognitive 199).
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 — 67
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 — 807
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 — 5553
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 21
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. 61 of 61 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 61 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, 6411 of 6427 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 (5 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.
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. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `EditorExtension/Application/Source/RulesViewController.swift`, `Snapshots/Consumer/Examples/REPL/repl.swift`, `Snapshots/Consumer/Sources/Consumer.swift`, `Snapshots/Expression/Sources/AnyExpression.swift`, `Snapshots/Expression/Sources/Expression.swift`, … (+39 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.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is swift-dependencies, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> # syntax=docker/dockerfile:1 2 | 3 | # Base image and static SDK have to be updated together. -------------------- ERROR: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": Forbidden; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
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. 'CoreData' is imported (Snapshots/SwiftUI/Bookworm/DetailView.swift:9), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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. 'CoreData' is imported (Snapshots/SwiftUI/Bookworm/DetailView.swift:9), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P8 Schema migrations — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads EF Core usage in C# and the schema tooling its file scan recognises only, and no .NET project was loaded, and this repository's language is not one the scan models, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
127 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Formatter.addOrRemoveSelf::processBody at 210. A further 3 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 Token.`is` at 26 — they are counted neither in the figure above nor in this dimension's score.
+ 109 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Formatter.addOrRemoveSelf::processBody (cyclomatic 210), Tokenizer.swift.tokenize::processToken (cyclomatic 112), CommandLine.swift.processArguments (cyclomatic 90). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cyclomatic Complexity from 2.0 to about 3.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 141 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 69 bodies over 30 down to 30 or less in Cognitive Complexity — start with Formatter.addOrRemoveSelf::processBody (cognitive 394), Tokenizer.swift.tokenize::processToken (cognitive 202), CommandLine.swift.processArguments (cognitive 199). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 69 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.7 / 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 18 FileTooLong finding(s) in God Classes — start with ParsingHelpers.swift, FormattingHelpers.swift, Tokenizer.swift. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 12 MethodTooLong finding(s) in God Classes — start with ParsingHelpers.swift (3), FormattingHelpers.swift (3), ConsumerCompiler.swift. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 4 TooManyMethods finding(s) in God Classes — start with Formatter.swift, 697.swift, Tokenizer.swift. — One of this dimension's main actionable groups (4 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.
67 duplicated block group(s) detected. A further 3 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 70 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 31 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CommandLine.swift (2), Expression.swift, FormattingHelpers.swift. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with IfExpressions.swift (2), Consumer.swift, SwiftFormat.swift. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 6 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with Expression.swift (2), UIColor+Expression.swift, FormattingHelpers.swift. — One of this dimension's main actionable groups (6 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 · Coupling8.4 / 10Strong✓ 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.
5 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.
Off the main sequence: SwiftFormat
What to do
Resolve the 1 Off the main sequence 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 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with main.swift, Formatter.swift, Declaration.swift. — One of this dimension's main actionable groups (6 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage5.0 / 10Adequate✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 0.0% — 188 file(s) below 50%. Measured from the Swift suite (.: `swift test --enable-code-coverage` over 189 production file(s); Snapshots/Consumer: no coverage export; Snapshots/Euclid: no coverage export; Snapshots/Expression: no coverage export; Snapshots/Sprinter: no coverage export).
Resolve the 188 Low coverage finding(s) in Code Coverage — start with Arguments.swift, CommandLine.swift, Declaration.swift. — One of this dimension's main actionable groups (188 warning-level).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
8426 test methods: 8426 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 21 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 5538 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 8426 tests (3 harness-style project(s) excluded from the assertion penalty).
No assertions: testIndentation · ×21Tests/OptionDescriptorTests.swift:174
No direct assertions: testFormatting · ×5517PerformanceTests/PerformanceTests.swift:63
What to do
Resolve the 5517 No direct assertions finding(s) in Test Quality — start with IndentTests.swift (449), RedundantSelfTests.swift (278), WrapArgumentsTests.swift (198). — One of this dimension's main actionable groups (5517 recommendation-level).
Resolve the 21 No assertions finding(s) in Test Quality — start with PerformanceTests.swift (14), OptionDescriptorTests.swift (4), ParsingHelpersTests.swift. — One of this dimension's main actionable groups (21 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 dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
0 outdated direct gem(s), 0 pinning defect(s). 2 declaration(s) graded against rubygems.org, 2 of them against a version resolved in a committed REDACTED. Whether any of these gems is DEPRECATED or YANKED is not graded — rubygems.org publishes no deprecation marker, and a yank removes a version rather than flagging it. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Whether any is UNUSED is a source question, not a registry one. Known CVEs in this dependency graph are D30's question, read from the manifest there.
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 35 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 35 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed REDACTED. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 12 Hotspot finding(s) in Churn × Complexity Hotspots — start with FormattingHelpers.swift, CommandLine.swift, ParsingHelpers.swift. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.4 / 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.
10 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Sources/Rules/PreferLazyMap.swift. Counted over 160 of the 294 production source files in this repository: 126 are under the ~2,400-byte size floor this dimension measures over, and the remaining 8 have no attributable history left to measure.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
144 deducted task-comment markers across 75959 LoC (0.2/KLoC) → score 9.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.
Resolve the 140 TodoComment finding(s) in Explicit Debt — start with AnyExpression.swift (12), Paths.swift (12), OrganizeDeclarationsTests.swift (8). — One of this dimension's main actionable groups (140 warning-level).
Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with TodosTests.swift (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with FormattingHelpers.swift, AnyExpression.swift. — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
1 of 5 build units (Bundler, 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).
69 finding(s): 0 critical, 65 high, 4 medium, 0 low. 51 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 2 file(s) — `Snapshots/Consumer/Sources/Consumer.h` (line 35, line 38), `Sources/SwiftFormat.h` (line 35, line 38) — 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. Separately, one or more rules could not re-parse an embedded snippet in 3 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
No action in Static Analysis (SAST) — all 51 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 (51 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 any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no REDACTED is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
9 of 168 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is EditorExtension/Shared/RulesStore.swift. Counted over 168 of the 294 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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 1 Change coupling finding(s) in Change Coupling — start with FormatFileCommand.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
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.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
`RulesViewController.buildRules` performs two independent DURABLE writes — `optionStore` (a persistence store) via `save` and `ruleStore` (a persistence store) via `save` — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — EditorExtension/Application/Source/RulesViewController.swift:130
What to do
Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
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 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.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Snapshots/Euclid/README.md links to `Euclid.png?raw=true`, but `Snapshots/Euclid/Euclid.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Snapshots/Euclid/README.md:8
Snapshots/Euclid/README.md links to `CONTRIBUTING.md`, but `Snapshots/Euclid/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Snapshots/Euclid/README.md:59
Snapshots/Layout/README.md links to `Layout.gif?raw=true`, but `Snapshots/Layout/Layout.gif` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Snapshots/Layout/README.md:14
What to do
Reconcile the README with reality: Snapshots/Euclid/README.md links to `Euclid.png?raw=true`, but `Snapshots/Euclid/Euclid.png` does not exist; Snapshots/Euclid/README.md links to `CONTRIBUTING.md`, but `Snapshots/Euclid/CONTRIBUTING.md` does not exist; Snapshots/Layout/README.md links to `Layout.gif?raw=true`, but `Snapshots/Layout/Layout.gif` does not exist.
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.
`xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Framework)" -sdk macosx clean build test -enableCodeCoverage YES -derivedDataPath Build/ 'OTHER_SWIFT_FLAGS=$(inherited) -Xllvm -instrprof-atomic-counter-update-all'` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:39
`xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug/SwiftFormat.framework/SwiftFormat > info.lcov` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:45
`git config --global --add safe.directory /__w/SwiftFormat/SwiftFormat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:86
`xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Command Line Tool)" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:130
`xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat for Xcode" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:148
`xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Editor Extension)" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:166
`xcodebuild -project SwiftFormat.xcodeproj -scheme "Regression Tests" test` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:186
`xcodebuild -project SwiftFormat.xcodeproj -scheme "Performance Tests" build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:206
`echo "Using version number $GITHUB_REF_NAME" && sed -i '' "s/let swiftFormatVersion = \"[^\"]*\"/let swiftFormatVersion = \"$GITHUB_REF_NAME\"/" Sources/SwiftFormat.swift` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:13
`lipo -create -output .build/apple/Products/Release/swiftformat .build/arm64-apple-macosx/release/swiftformat .build/x86_64-apple-macosx/release/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:21
`strip -rSTx .build/apple/Products/Release/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:23
`echo "Using version number $GITHUB_REF_NAME" && sed -i "s/let swiftFormatVersion = \"[^\"]*\"/let swiftFormatVersion = \"$GITHUB_REF_NAME\"/" Sources/SwiftFormat.swift` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:38
`strip artifacts/linux_amd64/workspace/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:52
`mv artifacts/linux_amd64/workspace/swiftformat "${HOME}/swiftformat_linux"` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:53
`aarch64-linux-gnu-strip artifacts/linux_arm64/workspace/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:54
`mv artifacts/linux_arm64/workspace/swiftformat "${HOME}/swiftformat_linux_aarch64"` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:55
`./Scripts/spm-artifact-bundle.sh ${{ github.event.release.name }} downloaded_artifacts/swiftformat_macos/swiftformat downloaded_artifacts/swiftformat_linux/swiftformat_linux downloaded_artifacts/swiftformat_linux_aarch64/swiftformat_linux_aarch64` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:83
`chmod +x downloaded_artifacts/swiftformat_macos/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:87
`zip -j swiftformat.zip downloaded_artifacts/swiftformat_macos/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:92
`gh release upload "${{ github.event.release.tag_name }}" swiftformat.artifactbundle.zip swiftformat.zip swiftformat_linux.zip swiftformat_linux_aarch64.zip --clobber` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:98
`& msbuild -nologo -restore Platforms\Windows\SwiftFormat.wixproj `` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:67
`mv artifacts\SwiftFormat.msi artifacts\SwiftFormat.${{ matrix.product-arch }}.msi` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:76
What to do
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--lint` to the swiftformat step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
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.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 29986 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Dependabot is configured but does not watch `bundler` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — Sources/GitFileInfo.swift:83, Snapshots/Layout/Layout/LayoutNode.swift:1549
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 11 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: this repository stores data through 'CoreData' (Snapshots/SwiftUI/Bookworm/DetailView.swift:9) but declares no persisted model this check reads (SwiftData @Model, Core Data, Realm, GRDB and Fluent types, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'CoreData' (Snapshots/SwiftUI/Bookworm/DetailView.swift:9) but declares no persisted model this check reads (SwiftData @Model, Core Data NSManagedObject, Realm Object, GRDB record and Fluent Model properties, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. 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 — no class or module declares an abstract method
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 — docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> # syntax=docker/dockerfile:1 2 | 3 | # Base image and static SDK have to be updated together. -------------------- ERROR: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — Naming consistency is measured on C# only; Ruby, Swift, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .rb, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 44 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Ruby, 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 — coverage data present for 189 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
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.
PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift code has 79,671 production line(s), 1 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
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.
X15 Unvalidated length from an untrusted reader — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
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
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 — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Dual write (no outbox): RulesViewController.buildRules EditorExtension/Application/Source/RulesViewController.swift:130— `RulesViewController.buildRules` performs two independent DURABLE writes — `optionStore` (a persistence store) via `save` and `ruleStore` (a persistence store) via `save` — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
TodoComment Tests/ArgumentsTests.swift:382— // TODO: should this go in OptionDescriptorTests instead? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/TokenizerTests.swift:2202— // TODO: should be postfix — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/ConditionalAssignmentTests.swift:417— // TODO: update branches parser to handle this case properly — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/ConditionalAssignmentTests.swift:438— // TODO: update branches parser to handle this scenario properly — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsBeforeModifiersTests.swift:119— // TODO: This function also has a TODO comment. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsBeforeModifiersTests.swift:148— // TODO: This function also has a TODO comment. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsBeforeModifiersTests.swift:126— // TODO: This function also has a trailing TODO comment. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsBeforeModifiersTests.swift:155— // TODO: This function also has a trailing TODO comment. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsTests.swift:473— // TODO: Clean up this mess — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsTests.swift:482— // TODO: Clean up this mess — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/DocCommentsTests.swift:492— // TODO: Clean up this mess — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/HoistPatternLetTests.swift:188— // TODO: this should actually hoist the let, but that's tricky to implement without — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/HoistPatternLetTests.swift:201— // TODO: this could actually hoist the let by one level, but that's tricky to implement — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/IndentTests.swift:4147— // TODO: maybe need special case handling 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.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4677— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4690— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4718— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4731— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4863— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4874— // TODO: check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4868— // TODO: nested — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/OrganizeDeclarationsTests.swift:4875— // TODO: nested — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/RedundantInitTests.swift:214— // TODO: maybe we can auto-simplify in this case? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/RedundantParensTests.swift:318— // TODO: future enhancement — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Tests/Rules/RedundantSelfTests.swift:108— // TODO: make this work — 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.
CI formatting step cannot fail REDACTED:39— `xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Framework)" -sdk macosx clean build test -enableCodeCoverage YES -derivedDataPath Build/ 'OTHER_SWIFT_FLAGS=$(inherited) -Xllvm -instrprof-atomic-counter-update-all'` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:45— `xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug/SwiftFormat.framework/SwiftFormat > info.lcov` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:86— `git config --global --add safe.directory /__w/SwiftFormat/SwiftFormat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:130— `xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Command Line Tool)" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:148— `xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat for Xcode" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:166— `xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Editor Extension)" -sdk macosx clean build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:186— `xcodebuild -project SwiftFormat.xcodeproj -scheme "Regression Tests" test` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:206— `xcodebuild -project SwiftFormat.xcodeproj -scheme "Performance Tests" build` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:13— `echo "Using version number $GITHUB_REF_NAME" && sed -i '' "s/let swiftFormatVersion = \"[^\"]*\"/let swiftFormatVersion = \"$GITHUB_REF_NAME\"/" Sources/SwiftFormat.swift` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:21— `lipo -create -output .build/apple/Products/Release/swiftformat .build/arm64-apple-macosx/release/swiftformat .build/x86_64-apple-macosx/release/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:23— `strip -rSTx .build/apple/Products/Release/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:38— `echo "Using version number $GITHUB_REF_NAME" && sed -i "s/let swiftFormatVersion = \"[^\"]*\"/let swiftFormatVersion = \"$GITHUB_REF_NAME\"/" Sources/SwiftFormat.swift` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:52— `strip artifacts/linux_amd64/workspace/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:53— `mv artifacts/linux_amd64/workspace/swiftformat "${HOME}/swiftformat_linux"` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:54— `aarch64-linux-gnu-strip artifacts/linux_arm64/workspace/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:55— `mv artifacts/linux_arm64/workspace/swiftformat "${HOME}/swiftformat_linux_aarch64"` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:83— `./Scripts/spm-artifact-bundle.sh ${{ github.event.release.name }} downloaded_artifacts/swiftformat_macos/swiftformat downloaded_artifacts/swiftformat_linux/swiftformat_linux downloaded_artifacts/swiftformat_linux_aarch64/swiftformat_linux_aarch64` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:87— `chmod +x downloaded_artifacts/swiftformat_macos/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:92— `zip -j swiftformat.zip downloaded_artifacts/swiftformat_macos/swiftformat` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:98— `gh release upload "${{ github.event.release.tag_name }}" swiftformat.artifactbundle.zip swiftformat.zip swiftformat_linux.zip swiftformat_linux_aarch64.zip --clobber` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:67— `& msbuild -nologo -restore Platforms\Windows\SwiftFormat.wixproj `` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:76— `mv artifacts\SwiftFormat.msi artifacts\SwiftFormat.${{ matrix.product-arch }}.msi` invokes swiftformat in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--lint` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
No assertions: testIndentation Tests/OptionDescriptorTests.swift:174— 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: testFileHeader Tests/OptionDescriptorTests.swift:210— 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: testUnknownOptions Tests/OptionDescriptorTests.swift:243— 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: testLocale Tests/OptionDescriptorTests.swift:255— 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: testClassOverrideDoesntCrashParseDeclarations Tests/ParsingHelpersTests.swift:1882— 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: testEmojiCharacterDescription Snapshots/Consumer/Tests/PerformanceTests.swift:40— 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: testHexCharacterDescription Snapshots/Consumer/Tests/PerformanceTests.swift:47— 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: testWhitespaceCharacterSetDescription Snapshots/Consumer/Tests/PerformanceTests.swift:57— 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: testDecimalDigitsCharacterSetDescription Snapshots/Consumer/Tests/PerformanceTests.swift:64— 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: testInverseCharacterSetDescription Snapshots/Consumer/Tests/PerformanceTests.swift:71— 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: testJSONConsumer Snapshots/Consumer/Tests/PerformanceTests.swift:80— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: testHandWrittenJSONConsumer Snapshots/Consumer/Tests/PerformanceTests.swift:86— 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: testCompiledJSONConsumer Snapshots/Consumer/Tests/PerformanceTests.swift:92— 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: testCurveWithConsecutiveMixedTypePointsWithSamePosition Snapshots/Euclid/Tests/ShapeTests.swift:24— 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: testScrollViewZoomScaleAnimated Snapshots/Layout/LayoutTests/LayoutNodeTests.swift:139— 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: testCreateSimpleFormatString Snapshots/Sprinter/Tests/PerformanceTests.swift:19— 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: testPrintSimpleFormatString Snapshots/Sprinter/Tests/PerformanceTests.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: testSwiftPrintSimpleFormatString Snapshots/Sprinter/Tests/PerformanceTests.swift:36— 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: testCreateComplexFormatString Snapshots/Sprinter/Tests/PerformanceTests.swift:44— 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: testPrintComplexFormatString Snapshots/Sprinter/Tests/PerformanceTests.swift:52— 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: testSwiftPrintComplexFormatString Snapshots/Sprinter/Tests/PerformanceTests.swift:65— 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.
FileTooLong: Sources/ParsingHelpers.swift Sources/ParsingHelpers.swift— FileTooLong — 3004 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2504 over it, 6.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: Sources/FormattingHelpers.swift Sources/FormattingHelpers.swift— FileTooLong — 2408 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1908 over it, 4.82× 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: Sources/Tokenizer.swift Sources/Tokenizer.swift— FileTooLong — 1561 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1061 over it, 3.12× 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: Sources/OptionDescriptor.swift Sources/OptionDescriptor.swift— FileTooLong — 1470 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: _Descriptors (575-1901). The bar is 500 significant lines; this is 970 over it, 2.94× 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: Sources/CommandLine.swift Sources/CommandLine.swift— FileTooLong — 1219 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 719 over it, 2.44× 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: Sources/Inference.swift Sources/Inference.swift— FileTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: Inference (56-1357). The bar is 500 significant lines; this is 653 over it, 2.31× 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: Sources/Options.swift Sources/Options.swift— FileTooLong — 1099 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 599 over it, 2.20× 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: Sources/Expression.swift Snapshots/Expression/Sources/Expression.swift— FileTooLong — 1035 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 535 over it, 2.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Sources/ConsumerCompiler.swift Snapshots/Consumer/Sources/ConsumerCompiler.swift— FileTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 437 over it, 1.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Rules/Indent.swift Sources/Rules/Indent.swift— FileTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 298 over it, 1.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Sources/AnyExpression.swift Snapshots/Expression/Sources/AnyExpression.swift— FileTooLong — 781 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 281 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Sources/Arguments.swift Sources/Arguments.swift— FileTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 244 over it, 1.49× 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: Sources/Formatter.swift Sources/Formatter.swift— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Issues/697.swift Snapshots/Issues/697.swift— FileTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 162 over it, 1.32× 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: Rules/OrganizeDeclarations.swift Sources/Rules/OrganizeDeclarations.swift— FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 108 over it, 1.22× 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: Sources/Consumer.swift Snapshots/Consumer/Sources/Consumer.swift— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 95 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: Sources/Sprinter.swift Snapshots/Sprinter/Sources/Sprinter.swift— FileTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: FormatString (38-745). The bar is 500 significant lines; this is 94 over it, 1.19× 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: Sources/SwiftFormat.swift Sources/SwiftFormat.swift— FileTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 75 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: Sources/FormattingHelpers.swift Sources/FormattingHelpers.swift:2508— Sources/FormattingHelpers.swift changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 261 in Formatter.addOrRemoveSelf at line 2508. 6 of those changes were fix/bug commits, and the other 15 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/FormattingHelpers.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/CommandLine.swift Sources/CommandLine.swift:427— Sources/CommandLine.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in CommandLine.swift.processArguments at line 427. 1 of those changes was a fix/bug commit, and the other 15 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/CommandLine.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/ParsingHelpers.swift Sources/ParsingHelpers.swift:2069— Sources/ParsingHelpers.swift changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Formatter.parseExpressionRange at line 2069. 7 of those changes were fix/bug commits, and the other 20 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/ParsingHelpers.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/Tokenizer.swift Sources/Tokenizer.swift:1314— Sources/Tokenizer.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 274 in Tokenizer.swift.tokenize at line 1314. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Tokenizer.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/Formatter.swift Sources/Formatter.swift:263— Sources/Formatter.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Formatter.updateEnablement at line 263. 2 of those changes were fix/bug commits, and the other 10 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Formatter.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/SwiftFormat.swift Sources/SwiftFormat.swift:634— Sources/SwiftFormat.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in SwiftFormat.swift.applyRules at line 634. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/SwiftFormat.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/Arguments.swift Sources/Arguments.swift:409— Sources/Arguments.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Arguments.swift.preprocessArguments at line 409. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Arguments.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/Rules/Indent.swift Sources/Rules/Indent.swift:980— Sources/Rules/Indent.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Formatter.indentForScopeInMultilineCondition at line 980. 5 of those changes were fix/bug commits, and the other 10 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Rules/Indent.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/Rules/NestedIf.swift Sources/Rules/NestedIf.swift:36— Sources/Rules/NestedIf.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in Formatter.mergeNestedIf at line 36. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Rules/NestedIf.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/Rules/SwiftTestingTestCaseNames.swift Sources/Rules/SwiftTestingTestCaseNames.swift:189— Sources/Rules/SwiftTestingTestCaseNames.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in String.camelCaseToWords at line 189. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Rules/SwiftTestingTestCaseNames.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/Rules/RedundantType.swift Sources/Rules/RedundantType.swift:348— Sources/Rules/RedundantType.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Formatter.simplifiableLiteralRange at line 348. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Rules/RedundantType.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/Rules/DocComments.swift Sources/Rules/DocComments.swift:133— Sources/Rules/DocComments.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in Formatter.shouldBeDocComment at line 133. 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 08:34:40 +00:00' --until='2026-10-26 08:34:40 +00:00' --full-history --no-merges -- Sources/Rules/DocComments.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.
MethodTooLong: Consumer._compile Snapshots/Consumer/Sources/ConsumerCompiler.swift:61— MethodTooLong — _compile runs 909 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 809 over it, 9.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Formatter.isIfExpression Sources/ParsingHelpers.swift:944— MethodTooLong — isIfExpression runs 719 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 619 over it, 7.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Formatter.addOrRemoveSelf Sources/FormattingHelpers.swift:2508— MethodTooLong — addOrRemoveSelf runs 685 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 585 over it, 6.85× 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: Formatter.wrapCollectionsAndArguments Sources/FormattingHelpers.swift:492— MethodTooLong — wrapCollectionsAndArguments runs 433 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 333 over it, 4.33× 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: AnyExpression.init Snapshots/Expression/Sources/AnyExpression.swift:140— MethodTooLong — init runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× 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: Consumer._match Snapshots/Consumer/Sources/Consumer.swift:317— MethodTooLong — _match runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UnicodeScalarView.parseSubexpression Snapshots/Expression/Sources/Expression.swift:1357— MethodTooLong — parseSubexpression runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Formatter.processDeclaredVariables Sources/FormattingHelpers.swift:254— MethodTooLong — processDeclaredVariables runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CGPath.paths Snapshots/Euclid/Sources/CoreGraphics.swift:59— MethodTooLong — paths 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: Mesh.lathe Snapshots/Euclid/Sources/Shapes.swift:338— MethodTooLong — lathe 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: Formatter.parseClosureArguments Sources/ParsingHelpers.swift:3463— MethodTooLong — parseClosureArguments runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Formatter.removeUsed Sources/ParsingHelpers.swift:4958— MethodTooLong — removeUsed runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (7 lines × 2) Snapshots/Expression/Sources/Expression.swift:874— Snapshots/Expression/Sources/Expression.swift:874-880 | Snapshots/Expression/Sources/Expression.swift:887-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Expression/Sources/Expression.swift:874` 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/CommandLine.swift:693— Sources/CommandLine.swift:693-699 | Sources/Options.swift:467-473 — 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/CommandLine.swift:693` 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/CommandLine.swift:897— Sources/CommandLine.swift:897-903 | Sources/CommandLine.swift:988-994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CommandLine.swift:897` 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/FormattingHelpers.swift:2877— Sources/FormattingHelpers.swift:2877-2883 | Sources/FormattingHelpers.swift:2914-2920 — both copies are in the same file, so extract the 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/ParsingHelpers.swift:3532— Sources/ParsingHelpers.swift:3532-3538 | Sources/ParsingHelpers.swift:3610-3616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ParsingHelpers.swift:3532` 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) Snapshots/Euclid/Sources/Plane.swift:38— Snapshots/Euclid/Sources/Plane.swift:38-44 | Snapshots/Euclid/Sources/Transforms.swift:106-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.
Duplicated block (7 lines × 2) Snapshots/Euclid/Sources/Shapes.swift:427— Snapshots/Euclid/Sources/Shapes.swift:427-433 | Snapshots/Euclid/Sources/Shapes.swift:444-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Euclid/Sources/Shapes.swift:427` 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.
Tokenizer.swift.tokenize::processToken (cyclomatic 112) Sources/Tokenizer.swift:1830— Tokenizer.swift.tokenize::processToken has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::setOperatorType (cyclomatic 40) Sources/Tokenizer.swift:1688— Tokenizer.swift.tokenize::setOperatorType 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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::processMultilineStringBody (cyclomatic 31) Sources/Tokenizer.swift:1391— Tokenizer.swift.tokenize::processMultilineStringBody has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::stitchOperators (cyclomatic 28) Sources/Tokenizer.swift:1626— Tokenizer.swift.tokenize::stitchOperators has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::processMultilineCommentBody (cyclomatic 24) Sources/Tokenizer.swift:1512— Tokenizer.swift.tokenize::processMultilineCommentBody 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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
Tokenizer.swift.tokenize::processStringBody (cyclomatic 17) Sources/Tokenizer.swift:1331— Tokenizer.swift.tokenize::processStringBody 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 shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
Tokenizer.swift.tokenize::processToken (cognitive 202) Sources/Tokenizer.swift:1830— Tokenizer.swift.tokenize::processToken has cognitive complexity 202 (threshold 15). Drivers by points: if/else 55 (131 pts), boolean chains 36, match/switch 11 (32 pts), loops 1 (3 pts) (nesting depth added 99). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::setOperatorType (cognitive 69) Sources/Tokenizer.swift:1688— Tokenizer.swift.tokenize::setOperatorType has cognitive complexity 69 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 11, loops 2 (7 pts), match/switch 3 (6 pts), ternaries 1 (3 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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::processMultilineStringBody (cognitive 65) Sources/Tokenizer.swift:1391— Tokenizer.swift.tokenize::processMultilineStringBody has cognitive complexity 65 (threshold 15). Drivers by points: if/else 17 (49 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (2 pts), ternaries 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::processMultilineCommentBody (cognitive 62) Sources/Tokenizer.swift:1512— Tokenizer.swift.tokenize::processMultilineCommentBody has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (40 pts), match/switch 3 (11 pts), loops 3 (7 pts), boolean chains 4 (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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::stitchOperators (cognitive 37) Sources/Tokenizer.swift:1626— Tokenizer.swift.tokenize::stitchOperators has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 11, ternaries 4 (8 pts), loops 3 (4 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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processStringBody, Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Tokenizer.swift.tokenize::processStringBody (cognitive 26) Sources/Tokenizer.swift:1331— Tokenizer.swift.tokenize::processStringBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, match/switch 1 (2 pts), loops 1, 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. This shape REPEATS in the file: 5 other methods here (Tokenizer.swift.tokenize::processMultilineStringBody, Tokenizer.swift.tokenize::processMultilineCommentBody, Tokenizer.swift.tokenize::stitchOperators, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Duplicated block (8 lines × 2) Snapshots/Consumer/Sources/Consumer.swift:889— Snapshots/Consumer/Sources/Consumer.swift:889-896 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:1247-1254 — 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 `Snapshots/Consumer/Sources/Consumer.swift:889` 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 (8 lines × 2) Sources/SwiftFormat.swift:160— Snapshots/Layout/LayoutTool/Common.swift:89-96 | Sources/SwiftFormat.swift:160-167 — 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/Rules/IfExpressions.swift:318— Sources/Rules/IfExpressions.swift:318-325 | Sources/Rules/IfExpressions.swift:361-368 — both copies are in the same file, so extract the 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/Rules/IfExpressions.swift:330— Sources/Rules/IfExpressions.swift:330-337 | Sources/Rules/IfExpressions.swift:346-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/IfExpressions.swift:330` 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/Rules/PreferSwiftTesting.swift:422— Sources/Rules/PreferSwiftTesting.swift:422-429 | Sources/Rules/PreferSwiftTesting.swift:442-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. 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/Rules/PreferSwiftTesting.swift:421` calls `parseFunctionCallArguments` and `Sources/Rules/PreferSwiftTesting.swift:440` 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) Snapshots/Expression/Sources/Expression.swift:1035— Snapshots/Expression/Sources/Expression.swift:1035-1042 | Sources/Tokenizer.swift:791-798 — 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) Snapshots/Expression/Examples/Colors/UIColor+Expression.swift:85— Snapshots/Expression/Examples/Colors/UIColor+Expression.swift:85-90 | Snapshots/Layout/SampleApp/UIColor+Hex.swift:19-24 — 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 (6 lines × 2) Sources/FormattingHelpers.swift:3230— Sources/FormattingHelpers.swift:3230-3235 | Sources/FormattingHelpers.swift:3314-3319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/FormattingHelpers.swift:3230` 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 × 2) Snapshots/Expression/Sources/Expression.swift:1021— Snapshots/Expression/Sources/Expression.swift:1021-1026 | Sources/Tokenizer.swift:770-775 — 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) Snapshots/Expression/Sources/Expression.swift:1028— Snapshots/Expression/Sources/Expression.swift:1028-1033 | Sources/Tokenizer.swift:777-782 — 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) EditorExtension/Shared/OptionsStore.swift:183— EditorExtension/Shared/OptionsStore.swift:183-190 | EditorExtension/Shared/RulesStore.swift:183-188 — 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/Arguments.swift:645— Sources/Arguments.swift:645-650 | Sources/Arguments.swift:664-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Snapshots/Consumer/Examples/JSON/handwritten.swift:144— Snapshots/Consumer/Examples/JSON/handwritten.swift:144-148 | Sources/Tokenizer.swift:295-303 — 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 `Snapshots/Consumer/Examples/JSON/handwritten.swift:144` 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/Arguments.swift:621— Sources/Arguments.swift:621-625 | Sources/Arguments.swift:628-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/JSONReporter.swift:51— Sources/JSONReporter.swift:51-55 | Sources/SARIFReporter.swift:50-54 — 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/JSONReporter.swift:51` 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/Rules/IfExpressions.swift:337— Sources/Rules/IfExpressions.swift:337-341 | Sources/Rules/IfExpressions.swift:382-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/Rules/RedundantExtendedLifetime.swift:76— Sources/Rules/RedundantExtendedLifetime.swift:76-82 | Sources/Rules/RedundantExtendedLifetime.swift:112-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Snapshots/Expression/Sources/AnyExpression.swift:343— Snapshots/Expression/Sources/AnyExpression.swift:343-347 | Snapshots/Expression/Sources/AnyExpression.swift:379-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Expression/Sources/AnyExpression.swift:343` 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.
Low cohesion: String (LCOM4 18) CommandLineTool/main.swift:48— String's methods fall into 18 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 18 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Formatter (LCOM4 7) Sources/Formatter.swift:40— Formatter's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Collection (LCOM4 6) Sources/Declaration.swift:415— 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: AppDelegate (LCOM4 4) EditorExtension/Application/Source/AppDelegate.swift:34— AppDelegate's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Consumer (LCOM4 4) Snapshots/Issues/678.swift:11— Consumer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Array (LCOM4 4) Sources/Arguments.swift:232— Array's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
TooManyMethods: Formatter Sources/Formatter.swift:40— TooManyMethods — 474 methods, declared across 62 files: Sources/ParsingHelpers.swift (134), Sources/Formatter.swift (72), Sources/FormattingHelpers.swift (50), Rules/OrganizeDeclarations.swift (18), +58 more file(s). The bar is 30 methods; this is 444 over it, 15.80× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: _FirestoreDecoder Snapshots/Issues/697.swift:63— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: UnicodeScalarView Sources/Tokenizer.swift:728— TooManyMethods — 37 methods, declared across 2 files: Sources/Tokenizer.swift (27), Sources/Expression.swift (10). The bar is 30 methods; this is 7 over it, 1.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Mesh Snapshots/Euclid/Sources/Mesh.swift:33— TooManyMethods — 31 methods, declared across 6 files: Sources/CSG.swift (10), Sources/Shapes.swift (9), Sources/Transforms.swift (6), Sources/Mesh.swift (3), +2 more file(s). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _Descriptors Sources/OptionDescriptor.swift:575— ClassTooLong — 1095 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 695 over it, 2.74× 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: Inference Sources/Inference.swift:56— ClassTooLong — 1000 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 600 over it, 2.50× 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: FormatString Snapshots/Sprinter/Sources/Sprinter.swift:38— ClassTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 161 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FormatOptions Sources/Options.swift:912— ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 102 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (12 lines × 2) Snapshots/Consumer/Examples/JSON/compiled.swift:89— Snapshots/Consumer/Examples/JSON/compiled.swift:89-100 | Snapshots/Consumer/Sources/Consumer.swift:325-336 — 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) Snapshots/Expression/Examples/Colors/UIColor+Expression.swift:73— Snapshots/Expression/Examples/Colors/UIColor+Expression.swift:73-84 | Snapshots/Layout/SampleApp/UIColor+Hex.swift:7-18 — 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 `Snapshots/Expression/Examples/Colors/UIColor+Expression.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.
Duplicated block (12 lines × 2) Sources/ParsingHelpers.swift:3474— Sources/ParsingHelpers.swift:3474-3485 | Sources/ParsingHelpers.swift:4103-4114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ParsingHelpers.swift:3474` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Sources/Rules/RedundantExtendedLifetime.swift:93— Sources/Rules/RedundantExtendedLifetime.swift:93-104 | Sources/Rules/RedundantExtendedLifetime.swift:121-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/RedundantExtendedLifetime.swift:93` 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) Snapshots/Euclid/Sources/SceneKit.swift:92— Snapshots/Euclid/Sources/SceneKit.swift:92-101 | Snapshots/Euclid/Sources/SceneKit.swift:171-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 `Snapshots/Euclid/Sources/SceneKit.swift:92` 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) Snapshots/Euclid/Sources/SceneKit.swift:103— Snapshots/Euclid/Sources/SceneKit.swift:103-112 | Snapshots/Euclid/Sources/SceneKit.swift:182-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Euclid/Sources/SceneKit.swift:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) Sources/Options.swift:794— Sources/Options.swift:794-803 | Sources/Options.swift:834-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/Rules/PreferSwiftTesting.swift:405— Sources/Rules/PreferSwiftTesting.swift:405-414 | Sources/Rules/PreferSwiftTesting.swift:416-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/PreferSwiftTesting.swift:405` 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.
Formatter.addOrRemoveSelf::processBody (cyclomatic 210) Sources/FormattingHelpers.swift:2514— Formatter.addOrRemoveSelf::processBody has cyclomatic complexity 210 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processAccessors, Formatter.addOrRemoveSelf::processFunction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.addOrRemoveSelf::processAccessors (cyclomatic 20) Sources/FormattingHelpers.swift:3227— Formatter.addOrRemoveSelf::processAccessors has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processBody, Formatter.addOrRemoveSelf::processFunction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.addOrRemoveSelf::processFunction (cyclomatic 20) Sources/FormattingHelpers.swift:3312— Formatter.addOrRemoveSelf::processFunction 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. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processBody, Formatter.addOrRemoveSelf::processAccessors) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_match (cyclomatic 37) Snapshots/Consumer/Sources/Consumer.swift:493— Consumer._match::_match 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. This shape REPEATS in the file: 2 other methods here (Consumer._match::_skip, Consumer._match::_flatten) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_flatten (cyclomatic 33) Snapshots/Consumer/Sources/Consumer.swift:414— Consumer._match::_flatten has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (Consumer._match::_skip, Consumer._match::_match) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_skip (cyclomatic 24) Snapshots/Consumer/Sources/Consumer.swift:346— Consumer._match::_skip has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: 2 other methods here (Consumer._match::_flatten, Consumer._match::_match) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compileFlatten (cyclomatic 32) Snapshots/Consumer/Sources/ConsumerCompiler.swift:531— Consumer._compile::_compileFlatten 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. This shape REPEATS in the file: 2 other methods here (Consumer._compile::_compileSkip, Consumer._compile::_compile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compile (cyclomatic 32) Snapshots/Consumer/Sources/ConsumerCompiler.swift:767— Consumer._compile::_compile 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. This shape REPEATS in the file: 2 other methods here (Consumer._compile::_compileSkip, Consumer._compile::_compileFlatten) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compileSkip (cyclomatic 31) Snapshots/Consumer/Sources/ConsumerCompiler.swift:319— Consumer._compile::_compileSkip has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: 2 other methods here (Consumer._compile::_compileFlatten, Consumer._compile::_compile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.addOrRemoveSelf::processBody (cognitive 394) Sources/FormattingHelpers.swift:2514— Formatter.addOrRemoveSelf::processBody has cognitive complexity 394 (threshold 15). Drivers by points: if/else 82 (230 pts), boolean chains 71, loops 13 (41 pts), ternaries 9 (28 pts), match/switch 7 (24 pts) (nesting depth added 212). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processAccessors, Formatter.addOrRemoveSelf::processFunction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.addOrRemoveSelf::processAccessors (cognitive 28) Sources/FormattingHelpers.swift:3227— Formatter.addOrRemoveSelf::processAccessors has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processBody, Formatter.addOrRemoveSelf::processFunction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.addOrRemoveSelf::processFunction (cognitive 27) Sources/FormattingHelpers.swift:3312— Formatter.addOrRemoveSelf::processFunction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, match/switch 2 (4 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. This shape REPEATS in the file: 2 other methods here (Formatter.addOrRemoveSelf::processBody, Formatter.addOrRemoveSelf::processAccessors) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_match (cognitive 63) Snapshots/Consumer/Sources/Consumer.swift:493— Consumer._match::_match has cognitive complexity 63 (threshold 15). Drivers by points: if/else 11 (32 pts), ternaries 7 (15 pts), match/switch 4 (10 pts), loops 3 (6 pts) (nesting depth added 38). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (Consumer._match::_skip, Consumer._match::_flatten) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_flatten (cognitive 50) Snapshots/Consumer/Sources/Consumer.swift:414— Consumer._match::_flatten has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 7 (15 pts), loops 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (Consumer._match::_skip, Consumer._match::_match) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._match::_skip (cognitive 31) Snapshots/Consumer/Sources/Consumer.swift:346— Consumer._match::_skip has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (10 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (Consumer._match::_flatten, Consumer._match::_match) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compileFlatten (cognitive 55) Snapshots/Consumer/Sources/ConsumerCompiler.swift:531— Consumer._compile::_compileFlatten has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (49 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 3 other methods here (Consumer._compile, Consumer._compile::_compileSkip, Consumer._compile::_compile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compile (cognitive 51) Snapshots/Consumer/Sources/ConsumerCompiler.swift:767— Consumer._compile::_compile has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (45 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 3 other methods here (Consumer._compile, Consumer._compile::_compileSkip, Consumer._compile::_compileFlatten) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer._compile::_compileSkip (cognitive 45) Snapshots/Consumer/Sources/ConsumerCompiler.swift:319— Consumer._compile::_compileSkip has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (12 pts), match/switch 4 (7 pts) (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 3 other methods here (Consumer._compile, Consumer._compile::_compileFlatten, Consumer._compile::_compile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst (cognitive 43) Sources/FormattingHelpers.swift:606— Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 14, match/switch 2 (4 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. This shape REPEATS in the file: 3 other methods here (Formatter.wrapCollectionsAndArguments, Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary, Formatter.wrapCollectionsAndArguments::wrapArgumentsAfterFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary (cognitive 20) Sources/FormattingHelpers.swift:548— Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 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. This shape REPEATS in the file: 3 other methods here (Formatter.wrapCollectionsAndArguments, Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst, Formatter.wrapCollectionsAndArguments::wrapArgumentsAfterFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments::wrapArgumentsAfterFirst (cognitive 20) Sources/FormattingHelpers.swift:708— Formatter.wrapCollectionsAndArguments::wrapArgumentsAfterFirst has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, 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. This shape REPEATS in the file: 3 other methods here (Formatter.wrapCollectionsAndArguments, Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary, Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Duplicated block (9 lines × 2) Sources/CommandLine.swift:350— Sources/CommandLine.swift:350-358 | Sources/CommandLine.swift:359-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/ParsingHelpers.swift:3022— Sources/ParsingHelpers.swift:3022-3030 | Sources/Rules/SinglePropertyPerLine.swift:272-280 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) Sources/Rules/IfExpressions.swift:374— Sources/Rules/IfExpressions.swift:374-382 | Sources/Rules/IfExpressions.swift:392-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. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/IfExpressions.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.
AnyExpression.init::defaultEvaluator (cyclomatic 52) Snapshots/Expression/Sources/AnyExpression.swift:279— AnyExpression.init::defaultEvaluator 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. This shape REPEATS in the file: 2 other methods here (AnyExpression.init, AnyExpression.init::arrayEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AnyExpression.init::arrayEvaluator (cyclomatic 16) Snapshots/Expression/Sources/AnyExpression.swift:200— AnyExpression.init::arrayEvaluator has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: 2 other methods here (AnyExpression.init, AnyExpression.init::defaultEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst (cyclomatic 36) Sources/FormattingHelpers.swift:606— Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst 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. This shape REPEATS in the file: 2 other methods here (Formatter.wrapCollectionsAndArguments, Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary (cyclomatic 16) Sources/FormattingHelpers.swift:548— Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (Formatter.wrapCollectionsAndArguments, Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FixmeComment Tests/Rules/TodosTests.swift:35— // FIXME foo — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment Tests/Rules/TodosTests.swift:38— // FIXME: foo — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
HackComment Sources/FormattingHelpers.swift:1233— // hack to get correct length — 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 Snapshots/Expression/Sources/AnyExpression.swift:813— // Hack to avoid losing type info for UIFont.Weight, etc — 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.
AnyExpression.init::defaultEvaluator (cognitive 79) Snapshots/Expression/Sources/AnyExpression.swift:279— AnyExpression.init::defaultEvaluator has cognitive complexity 79 (threshold 15). Drivers by points: if/else 17 (43 pts), match/switch 9 (24 pts), ternaries 4 (12 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. This shape REPEATS in the file: 2 other methods here (AnyExpression.init, AnyExpression.init::arrayEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AnyExpression.init::arrayEvaluator (cognitive 16) Snapshots/Expression/Sources/AnyExpression.swift:200— AnyExpression.init::arrayEvaluator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (5 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. This shape REPEATS in the file: 2 other methods here (AnyExpression.init, AnyExpression.init::defaultEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FunctionTooLong: SwiftFormat.swift.enumerateFiles Sources/SwiftFormat.swift:145— FunctionTooLong — enumerateFiles runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× 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.
FunctionTooLong: SwiftFormat.swift.applyRules Sources/SwiftFormat.swift:634— FunctionTooLong — applyRules runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) Snapshots/Euclid/Sources/SceneKit.swift:249— Snapshots/Euclid/Sources/SceneKit.swift:249-296 | Snapshots/Euclid/Sources/SceneKit.swift:299-348 | Snapshots/Euclid/Sources/SceneKit.swift:351-390 | Snapshots/Euclid/Sources/SceneKit.swift:393-430 — 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) Snapshots/Expression/Sources/Expression.swift:679— Snapshots/Expression/Sources/Expression.swift:679-711 | Snapshots/Expression/Sources/Expression.swift:713-774 | Sources/Tokenizer.swift:957-1049 | Sources/Tokenizer.swift:1051-1202 — 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 (20 lines × 2) Snapshots/Expression/Sources/Expression.swift:755— Snapshots/Expression/Sources/Expression.swift:755-774 | Sources/Tokenizer.swift:1088-1107 — 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 `Snapshots/Expression/Sources/Expression.swift:755` 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 (20 lines × 2) Sources/ParsingHelpers.swift:4363— Sources/ParsingHelpers.swift:4363-4382 | Sources/ParsingHelpers.swift:4390-4409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ParsingHelpers.swift:4363` 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) Snapshots/Consumer/Sources/ConsumerCompiler.swift:231— Snapshots/Consumer/Sources/ConsumerCompiler.swift:231-246 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:249-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Consumer/Sources/ConsumerCompiler.swift:231` 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/Inference.swift:1364— Sources/Inference.swift:1364-1380 | Sources/Inference.swift:1389-1404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Inference.swift:1364` 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 (17 lines × 2) Snapshots/Consumer/Sources/ConsumerCompiler.swift:650— Snapshots/Consumer/Sources/ConsumerCompiler.swift:650-666 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:886-902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Consumer/Sources/ConsumerCompiler.swift:650` 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 × 2) Sources/OptionDescriptor.swift:396— Sources/OptionDescriptor.swift:396-412 | Sources/OptionDescriptor.swift:452-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/OptionDescriptor.swift:396` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Snapshots/Consumer/Sources/ConsumerCompiler.swift:604— Snapshots/Consumer/Sources/ConsumerCompiler.swift:604-617 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:840-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Consumer/Sources/ConsumerCompiler.swift:604` 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 (14 lines × 2) Snapshots/Expression/Sources/Expression.swift:1065— Snapshots/Expression/Sources/Expression.swift:1065-1078 | Sources/Tokenizer.swift:840-853 — 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.
Swallowed exception (caught, then discarded) Sources/GitFileInfo.swift:83— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Snapshots/Layout/Layout/LayoutNode.swift:1549— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
CommandLine.swift.processArguments (cyclomatic 90) Sources/CommandLine.swift:427— CommandLine.swift.processArguments has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (CommandLine.swift.processArguments::processFromStdin) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments (cyclomatic 89) Sources/FormattingHelpers.swift:492— Formatter.wrapCollectionsAndArguments has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary, Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.processDeclaredVariables (cyclomatic 66) Sources/FormattingHelpers.swift:254— Formatter.processDeclaredVariables 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.
CommandLine.swift.processInput::fileHandler (cyclomatic 54) Sources/CommandLine.swift:1268— CommandLine.swift.processInput::fileHandler 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. This shape REPEATS in the file: one other method here (CommandLine.swift.processInput) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.parseClosureArguments (cyclomatic 52) Sources/ParsingHelpers.swift:3463— Formatter.parseClosureArguments 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.
Formatter.parseExpressionRange (cyclomatic 47) Sources/ParsingHelpers.swift:1911— Formatter.parseExpressionRange has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.defaultArgumentMatch (cyclomatic 47) Sources/Rules/RedundantOverload.swift:174— Formatter.defaultArgumentMatch has cyclomatic complexity 47 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.indexWhereLineShouldWrap (cyclomatic 46) Sources/FormattingHelpers.swift:1181— Formatter.indexWhereLineShouldWrap has cyclomatic complexity 46 (threshold 15). Of this number, 40 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Declaration.declarationType (cyclomatic 44) Sources/DeclarationType.swift:127— Declaration.declarationType has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.parseExpressionRange (cyclomatic 44) Sources/ParsingHelpers.swift:2069— Formatter.parseExpressionRange has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.simplifyGenericConstraints (cyclomatic 43) Sources/Rules/SimplifyGenericConstraints.swift:73— Formatter.simplifyGenericConstraints has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.isStartOfClosure (cyclomatic 42) Sources/ParsingHelpers.swift:744— Formatter.isStartOfClosure 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.
Formatter.isStartOfStatement (cyclomatic 42) Sources/ParsingHelpers.swift:1316— Formatter.isStartOfStatement has cyclomatic complexity 42 (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.
Formatter.removeUsed (cyclomatic 40) Sources/ParsingHelpers.swift:4958— Formatter.removeUsed has cyclomatic complexity 40 (threshold 15). Of this number, 35 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.scopeType (cyclomatic 37) Sources/ParsingHelpers.swift:307— Formatter.scopeType 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.
Formatter.mergeNestedIf (cyclomatic 37) Sources/Rules/NestedIf.swift:36— Formatter.mergeNestedIf has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CommandLine.swift.processInput (cyclomatic 37) Sources/CommandLine.swift:1146— CommandLine.swift.processInput 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. This shape REPEATS in the file: one other method here (CommandLine.swift.processInput::fileHandler) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Placeholder.getSwiftType (cyclomatic 36) Snapshots/Sprinter/Sources/Sprinter.swift:193— Placeholder.getSwiftType has cyclomatic complexity 36 (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.
Formatter.hoistEffectKeyword (cyclomatic 35) Sources/FormattingHelpers.swift:1464— Formatter.hoistEffectKeyword has cyclomatic complexity 35 (threshold 15). Of this number, 30 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.modifiersForDeclaration (cyclomatic 34) Sources/ParsingHelpers.swift:438— Formatter.modifiersForDeclaration 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.
Formatter.headerCommentTokenRange (cyclomatic 34) Sources/ParsingHelpers.swift:3859— Formatter.headerCommentTokenRange 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.
Formatter.synthesizedEquatableAndHashableTypes (cyclomatic 34) Sources/Rules/UnusedPrivateDeclarations.swift:92— Formatter.synthesizedEquatableAndHashableTypes has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.updateEnablement (cyclomatic 33) Sources/Formatter.swift:263— Formatter.updateEnablement has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.parseNonOptionalType (cyclomatic 33) Sources/ParsingHelpers.swift:1773— Formatter.parseNonOptionalType has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.swiftTestingExpectationForXCTestHelper (cyclomatic 33) Sources/Rules/PreferSwiftTesting.swift:309— Formatter.swiftTestingExpectationForXCTestHelper has cyclomatic complexity 33 (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.
SwiftFormat.swift.applyRules (cyclomatic 32) Sources/SwiftFormat.swift:634— SwiftFormat.swift.applyRules has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Mesh.lathe (cyclomatic 31) Snapshots/Euclid/Sources/Shapes.swift:338— Mesh.lathe has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Mesh.loft (cyclomatic 31) Snapshots/Euclid/Sources/Shapes.swift:521— Mesh.loft has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CGPath.paths (cyclomatic 31) Snapshots/Euclid/Sources/CoreGraphics.swift:59— CGPath.paths has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 2 function items inside it that branch (updateLastPoint, endPath). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Formatter._parseImports (cyclomatic 31) Sources/ParsingHelpers.swift:3084— Formatter._parseImports has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.addCategorySeparators (cyclomatic 29) Sources/Rules/OrganizeDeclarations.swift:436— Formatter.addCategorySeparators 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.
Formatter.manuallyImplementedEquatableTypes (cyclomatic 29) Sources/Rules/RedundantEquatable.swift:145— Formatter.manuallyImplementedEquatableTypes has cyclomatic complexity 29 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Formatter.wrapEnumCaseDeclaration (cyclomatic 29) Sources/Rules/WrapEnumCases.swift:50— Formatter.wrapEnumCaseDeclaration 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.
SwiftFormat.swift.enumerateFiles (cyclomatic 29) Sources/SwiftFormat.swift:145— SwiftFormat.swift.enumerateFiles has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 2 function items inside it that branch (resolveInputURL, enumerate). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
BSPNode.clip (cyclomatic 28) Snapshots/Euclid/Sources/CSG.swift:282— BSPNode.clip has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnicodeScalarView.parseSubexpression (cyclomatic 28) Snapshots/Expression/Sources/Expression.swift:1357— UnicodeScalarView.parseSubexpression has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (UnicodeScalarView.parseSubexpression::collapseStack) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.shouldInsertSpaceAfterToken (cyclomatic 27) Sources/FormattingHelpers.swift:93— Formatter.shouldInsertSpaceAfterToken has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Formatter._endOfDeclarationInTypeBody (cyclomatic 27) Sources/ParsingHelpers.swift:2578— Formatter._endOfDeclarationInTypeBody 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.
Formatter.parseFunctionCallArguments (cyclomatic 27) Sources/ParsingHelpers.swift:4326— Formatter.parseFunctionCallArguments 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.
AnyExpression.init (cyclomatic 26) Snapshots/Expression/Sources/AnyExpression.swift:140— AnyExpression.init has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (AnyExpression.init::arrayEvaluator, AnyExpression.init::defaultEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Expression.init (cyclomatic 26) Snapshots/Expression/Sources/Expression.swift:310— Expression.init has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (pureEvaluator, symbolEvaluator). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Formatter.switchStatementBranchesWithSpacingInfo (cyclomatic 26) Sources/FormattingHelpers.swift:1968— Formatter.switchStatementBranchesWithSpacingInfo has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.convertIfToForWhere (cyclomatic 26) Sources/Rules/ForWhere.swift:57— Formatter.convertIfToForWhere has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Subexpression.description (cyclomatic 25) Snapshots/Expression/Sources/Expression.swift:851— Subexpression.description has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
Formatter.removeSelf (cyclomatic 25) Sources/FormattingHelpers.swift:156— Formatter.removeSelf has cyclomatic complexity 25 (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.
Arguments.swift.preprocessArguments (cyclomatic 25) Sources/Arguments.swift:409— Arguments.swift.preprocessArguments 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.
Arguments.swift.warningsForArguments (cyclomatic 25) Sources/Arguments.swift:1082— Arguments.swift.warningsForArguments 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.
Formatter.backticksRequired (cyclomatic 24) Sources/ParsingHelpers.swift:1540— Formatter.backticksRequired 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.
Formatter.removeRedundantEnumerated (cyclomatic 24) Sources/Rules/RedundantEnumerated.swift:33— Formatter.removeRedundantEnumerated has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.wrapSingleLineString (cyclomatic 24) Sources/Rules/WrapSingleLineStrings.swift:46— Formatter.wrapSingleLineString 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.
Token.unescaped (cyclomatic 24) Sources/Tokenizer.swift:281— Token.unescaped 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. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
CommandLine.swift.processArguments::processFromStdin (cyclomatic 24) Sources/CommandLine.swift:840— CommandLine.swift.processArguments::processFromStdin 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. This shape REPEATS in the file: one other method here (CommandLine.swift.processArguments) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Path.curve (cyclomatic 23) Snapshots/Euclid/Sources/Shapes.swift:69— Path.curve has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.parseComparedProperties (cyclomatic 23) Sources/Rules/RedundantEquatable.swift:248— Formatter.parseComparedProperties has cyclomatic complexity 23 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
UnicodeScalarView.parseIdentifier (cyclomatic 23) Sources/Tokenizer.swift:1051— UnicodeScalarView.parseIdentifier has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
UnicodeScalarView.parseSubexpression::collapseStack (cyclomatic 23) Snapshots/Expression/Sources/Expression.swift:1360— UnicodeScalarView.parseSubexpression::collapseStack 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. This shape REPEATS in the file: one other method here (UnicodeScalarView.parseSubexpression) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Consumer.description (cyclomatic 23) Snapshots/Consumer/Sources/Consumer.swift:221— Consumer.description 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.
Formatter.parseGenericTypes (cyclomatic 22) Sources/FormattingHelpers.swift:2390— Formatter.parseGenericTypes 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.
Formatter.grouping (cyclomatic 22) Sources/Inference.swift:1409— Formatter.grouping 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.
Formatter.indentForScopeInMultilineCondition (cyclomatic 22) Sources/Rules/Indent.swift:980— Formatter.indentForScopeInMultilineCondition has cyclomatic complexity 22 (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.
Formatter.simplifiableLiteralRange (cyclomatic 22) Sources/Rules/RedundantType.swift:348— Formatter.simplifiableLiteralRange 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.
Arguments.swift.argumentsFor (cyclomatic 22) Sources/Arguments.swift:815— Arguments.swift.argumentsFor 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.
Placeholder.buildFormatter (cyclomatic 21) Snapshots/Sprinter/Sources/Sprinter.swift:310— Placeholder.buildFormatter has cyclomatic complexity 21 (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.
Formatter.parseDeclarations (cyclomatic 21) Sources/ParsingHelpers.swift:2456— Formatter.parseDeclarations has cyclomatic complexity 21 (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.
Formatter.parseExtendedLifetimeClosure (cyclomatic 21) Sources/Rules/RedundantExtendedLifetime.swift:139— Formatter.parseExtendedLifetimeClosure 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.
Formatter.addOrRemoveTrailingComma (cyclomatic 21) Sources/Rules/TrailingCommas.swift:234— Formatter.addOrRemoveTrailingComma has cyclomatic complexity 21 (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.
UnicodeScalarView.parseNumber (cyclomatic 21) Sources/Tokenizer.swift:1204— UnicodeScalarView.parseNumber has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
Arguments.swift.mergeArguments (cyclomatic 21) Sources/Arguments.swift:607— Arguments.swift.mergeArguments 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.
Path.clippedToYAxis (cyclomatic 20) Snapshots/Euclid/Sources/Paths.swift:328— Path.clippedToYAxis 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.
Formatter.parsePropertyDeclaration (cyclomatic 20) Sources/ParsingHelpers.swift:2997— Formatter.parsePropertyDeclaration has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseConditionalStatement (cyclomatic 20) Sources/ParsingHelpers.swift:4674— Formatter.parseConditionalStatement 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.
Formatter.shouldBeDocComment (cyclomatic 20) Sources/Rules/DocComments.swift:133— Formatter.shouldBeDocComment 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.
Formatter.forwardingCall (cyclomatic 20) Sources/Rules/RedundantOverload.swift:370— Formatter.forwardingCall 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.
UnicodeScalarView.parseEscapedIdentifier (cyclomatic 20) Snapshots/Expression/Sources/Expression.swift:1299— UnicodeScalarView.parseEscapedIdentifier 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.
Path.edgeVertices (cyclomatic 19) Snapshots/Euclid/Sources/Paths.swift:174— Path.edgeVertices 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.
TypeDeclaration.convertToSwiftTestingSuite (cyclomatic 19) Sources/Rules/PreferSwiftTesting.swift:170— TypeDeclaration.convertToSwiftTestingSuite 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.
Formatter.processDirectives (cyclomatic 19) Sources/Formatter.swift:174— Formatter.processDirectives 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.
Formatter.wrapConditionSeparators (cyclomatic 19) Sources/FormattingHelpers.swift:449— Formatter.wrapConditionSeparators has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseFunctionDeclaration (cyclomatic 19) Sources/ParsingHelpers.swift:4079— Formatter.parseFunctionDeclaration 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.
Formatter.isEndOfStatement (cyclomatic 18) Sources/ParsingHelpers.swift:1256— Formatter.isEndOfStatement has cyclomatic complexity 18 (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.
Formatter.convertForWhereToIf (cyclomatic 18) Sources/Rules/ForWhere.swift:128— Formatter.convertForWhereToIf has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseExtendedLifetimeCall (cyclomatic 18) Sources/Rules/RedundantExtendedLifetime.swift:75— Formatter.parseExtendedLifetimeCall has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseTuplePropertyDeclaration (cyclomatic 18) Sources/Rules/SinglePropertyPerLine.swift:340— Formatter.parseTuplePropertyDeclaration 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.
Polygon.split (cyclomatic 17) Snapshots/Euclid/Sources/CSG.swift:482— Polygon.split 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.
Formatter.removeParen (cyclomatic 17) Sources/FormattingHelpers.swift:1412— Formatter.removeParen has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Formatter.isSimpleTestSuite (cyclomatic 17) Sources/ParsingHelpers.swift:3272— Formatter.isSimpleTestSuite 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.
Formatter.parseEnumCaseDeclaration (cyclomatic 17) Sources/Rules/RedundantOverload.swift:319— Formatter.parseEnumCaseDeclaration has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.validDefaultArgumentExpression (cyclomatic 17) Sources/Rules/RedundantOverload.swift:413— Formatter.validDefaultArgumentExpression 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.
Formatter.compare (cyclomatic 17) Sources/Rules/RedundantType.swift:188— Formatter.compare 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.
Formatter.parseMultiplePropertyDeclaration (cyclomatic 17) Sources/Rules/SinglePropertyPerLine.swift:245— Formatter.parseMultiplePropertyDeclaration 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.
Formatter.parseSwitchCaseRanges (cyclomatic 17) Sources/Rules/SortSwitchCases.swift:90— Formatter.parseSwitchCaseRanges 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.
Token.isEndOfScope (cyclomatic 17) Sources/Tokenizer.swift:577— Token.isEndOfScope 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: Token.`is` (cyclomatic 26) 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.
UnicodeScalarView.parseOperator (cyclomatic 17) Sources/Tokenizer.swift:957— UnicodeScalarView.parseOperator has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token.`is` (cyclomatic 26) 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.
UnicodeScalarView.parseNumericLiteral (cyclomatic 17) Snapshots/Expression/Sources/Expression.swift:1138— UnicodeScalarView.parseNumericLiteral has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (scanNumber, scanExponent, scanInteger, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Polygon.triangulate (cyclomatic 16) Snapshots/Euclid/Sources/Polygon.swift:132— Polygon.triangulate has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Polygon.join (cyclomatic 16) Snapshots/Euclid/Sources/Polygon.swift:253— Polygon.join has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
Formatter.index (cyclomatic 16) Sources/Formatter.swift:762— Formatter.index 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.
Formatter.switchStatementBranches (cyclomatic 16) Sources/FormattingHelpers.swift:1723— Formatter.switchStatementBranches 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.
Formatter.updateDeclarationName (cyclomatic 16) Sources/FormattingHelpers.swift:2216— Formatter.updateDeclarationName has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.indexOfLastSignificantKeyword (cyclomatic 16) Sources/ParsingHelpers.swift:1128— Formatter.indexOfLastSignificantKeyword has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, 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.
Formatter.declarationIndexAndScope (cyclomatic 16) Sources/ParsingHelpers.swift:3719— Formatter.declarationIndexAndScope 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.
Formatter.parseFunctionDeclarationArguments (cyclomatic 16) Sources/ParsingHelpers.swift:4187— Formatter.parseFunctionDeclarationArguments 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.
Formatter.convertXCTestOverride (cyclomatic 16) Sources/Rules/PreferSwiftTesting.swift:524— Formatter.convertXCTestOverride has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.redundantEmptyViewElseRange (cyclomatic 16) Sources/Rules/RedundantEmptyView.swift:40— Formatter.redundantEmptyViewElseRange has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.redundantOverloadCandidates (cyclomatic 16) Sources/Rules/RedundantOverload.swift:102— Formatter.redundantOverloadCandidates 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.
Formatter.parseGroupCall (cyclomatic 16) Sources/Rules/RedundantSwiftUIGroup.swift:175— Formatter.parseGroupCall has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_FirestoreDecoder.unbox (cyclomatic 16) Snapshots/Issues/697.swift:1111— _FirestoreDecoder.unbox has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
1212.swift.getType (cyclomatic 16) Snapshots/Issues/1212.swift:3— 1212.swift.getType 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.
CommandLine.swift.processArguments (cognitive 199) Sources/CommandLine.swift:427— CommandLine.swift.processArguments has cognitive complexity 199 (threshold 15). Drivers by points: if/else 90 (204 pts), loops 10 (28 pts), ternaries 6 (27 pts), boolean chains 19, error handling 4 (10 pts), match/switch 2 (8 pts) (nesting depth added 165). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (CommandLine.swift.processArguments::processFromStdin) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.processDeclaredVariables (cognitive 133) Sources/FormattingHelpers.swift:254— Formatter.processDeclaredVariables has cognitive complexity 133 (threshold 15). Drivers by points: if/else 24 (75 pts), boolean chains 24, match/switch 4 (16 pts), loops 3 (10 pts), ternaries 2 (8 pts) (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandLine.swift.processInput::fileHandler (cognitive 113) Sources/CommandLine.swift:1268— CommandLine.swift.processInput::fileHandler has cognitive complexity 113 (threshold 15). Drivers by points: if/else 35 (77 pts), match/switch 4 (11 pts), boolean chains 8, error handling 3 (8 pts), ternaries 3 (6 pts), loops 1 (3 pts) (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (CommandLine.swift.processInput) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.wrapCollectionsAndArguments (cognitive 108) Sources/FormattingHelpers.swift:492— Formatter.wrapCollectionsAndArguments has cognitive complexity 108 (threshold 15). Drivers by points: if/else 78 (131 pts), boolean chains 67, match/switch 12 (20 pts), loops 8 (11 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (Formatter.wrapCollectionsAndArguments::wrapReturnAndEffectsIfNecessary, Formatter.wrapCollectionsAndArguments::wrapArgumentsBeforeFirst, Formatter.wrapCollectionsAndArguments::wrapArgumentsAfterFirst) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.parseClosureArguments (cognitive 92) Sources/ParsingHelpers.swift:3463— Formatter.parseClosureArguments has cognitive complexity 92 (threshold 15). Drivers by points: if/else 33 (61 pts), boolean chains 21, loops 4 (10 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.simplifyGenericConstraints (cognitive 84) Sources/Rules/SimplifyGenericConstraints.swift:73— Formatter.simplifyGenericConstraints has cognitive complexity 84 (threshold 15). Drivers by points: if/else 22 (48 pts), loops 8 (16 pts), boolean chains 14, ternaries 2 (6 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.scopeType (cognitive 82) Sources/ParsingHelpers.swift:307— Formatter.scopeType has cognitive complexity 82 (threshold 15). Drivers by points: if/else 22 (54 pts), ternaries 5 (17 pts), match/switch 3 (9 pts), boolean chains 2 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.removeUsed (cognitive 73) Sources/ParsingHelpers.swift:4958— Formatter.removeUsed has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (50 pts), boolean chains 10, match/switch 2 (7 pts), loops 3 (6 pts) (nesting depth added 38). Of this number, 65 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseExpressionRange (cognitive 72) Sources/ParsingHelpers.swift:1911— Formatter.parseExpressionRange has cognitive complexity 72 (threshold 15). Drivers by points: if/else 23 (56 pts), boolean chains 12, match/switch 2 (3 pts), loops 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.
Formatter.headerCommentTokenRange (cognitive 69) Sources/ParsingHelpers.swift:3859— Formatter.headerCommentTokenRange has cognitive complexity 69 (threshold 15). Drivers by points: if/else 17 (47 pts), boolean chains 10, loops 2 (6 pts), match/switch 2 (6 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Declaration.declarationType (cognitive 68) Sources/DeclarationType.swift:127— Declaration.declarationType has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (46 pts), boolean chains 17, match/switch 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 31). 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.
BSPNode.clip (cognitive 64) Snapshots/Euclid/Sources/CSG.swift:282— BSPNode.clip has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 4 (14 pts), loops 5 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 35). Of this number, 55 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseExpressionRange (cognitive 64) Sources/ParsingHelpers.swift:2069— Formatter.parseExpressionRange has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 22 (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.
Formatter.parseFunctionCallArguments (cognitive 64) Sources/ParsingHelpers.swift:4326— Formatter.parseFunctionCallArguments has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 5 (22 pts), boolean chains 9 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.isStartOfClosure (cognitive 63) Sources/ParsingHelpers.swift:744— Formatter.isStartOfClosure has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (39 pts), match/switch 5 (12 pts), boolean chains 9, loops 1 (3 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.
CommandLine.swift.processArguments::processFromStdin (cognitive 62) Sources/CommandLine.swift:840— CommandLine.swift.processArguments::processFromStdin has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 4 (18 pts), boolean chains 4, error handling 1, loops 1 (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. This shape REPEATS in the file: one other method here (CommandLine.swift.processArguments) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Arguments.swift.preprocessArguments (cognitive 61) Sources/Arguments.swift:409— Arguments.swift.preprocessArguments has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (51 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 35). 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.
CommandLine.swift.processInput (cognitive 60) Sources/CommandLine.swift:1146— CommandLine.swift.processInput has cognitive complexity 60 (threshold 15). Drivers by points: if/else 57 (116 pts), boolean chains 18, match/switch 6 (14 pts), error handling 6 (13 pts), ternaries 5 (10 pts), loops 5 (9 pts) (nesting depth added 83). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (CommandLine.swift.processInput::fileHandler) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
UnicodeScalarView.parseSubexpression::collapseStack (cognitive 58) Snapshots/Expression/Sources/Expression.swift:1360— UnicodeScalarView.parseSubexpression::collapseStack has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (48 pts), match/switch 2 (9 pts), boolean chains 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. This shape REPEATS in the file: one other method here (UnicodeScalarView.parseSubexpression) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SwiftFormat.swift.applyRules (cognitive 57) Sources/SwiftFormat.swift:634— SwiftFormat.swift.applyRules has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 5 (8 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 25). Of this number, 47 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.defaultArgumentMatch (cognitive 54) Sources/Rules/RedundantOverload.swift:174— Formatter.defaultArgumentMatch has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 31, if/else 10 (17 pts), ternaries 2 (4 pts), loops 1, match/switch 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UnicodeScalarView.parseNumber (cognitive 53) Sources/Tokenizer.swift:1204— UnicodeScalarView.parseNumber has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (50 pts), boolean chains 3 (nesting depth added 31). Of this number, 52 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Mesh.loft (cognitive 50) Snapshots/Euclid/Sources/Shapes.swift:521— Mesh.loft has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 8, loops 4 (8 pts), ternaries 1 (4 pts), match/switch 1 (nesting depth added 20). Of this number, 48 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnicodeScalarView.parseSubexpression (cognitive 50) Snapshots/Expression/Sources/Expression.swift:1357— UnicodeScalarView.parseSubexpression has cognitive complexity 50 (threshold 15). Drivers by points: if/else 36 (80 pts), match/switch 8 (27 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (UnicodeScalarView.parseSubexpression::collapseStack) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AnyExpression.init (cognitive 49) Snapshots/Expression/Sources/AnyExpression.swift:140— AnyExpression.init has cognitive complexity 49 (threshold 15). Drivers by points: if/else 43 (89 pts), match/switch 16 (35 pts), ternaries 5 (13 pts), error handling 3 (9 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (AnyExpression.init::arrayEvaluator, AnyExpression.init::defaultEvaluator) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.hoistEffectKeyword (cognitive 49) Sources/FormattingHelpers.swift:1464— Formatter.hoistEffectKeyword has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 5, match/switch 2 (5 pts), loops 3 (nesting depth added 21). Of this number, 43 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.addCategorySeparators (cognitive 49) Sources/Rules/OrganizeDeclarations.swift:436— Formatter.addCategorySeparators has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 13, ternaries 2 (6 pts), loops 2 (5 pts), 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.
Formatter.updateEnablement (cognitive 48) Sources/Formatter.swift:263— Formatter.updateEnablement has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 11, match/switch 2 (3 pts), 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.
Formatter.modifiersForDeclaration (cognitive 48) Sources/ParsingHelpers.swift:438— Formatter.modifiersForDeclaration has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 19, 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.
UnicodeScalarView.parseIdentifier (cognitive 48) Sources/Tokenizer.swift:1051— UnicodeScalarView.parseIdentifier has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 1 (3 pts), match/switch 3, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 22). Of this number, 42 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter._parseImports (cognitive 47) Sources/ParsingHelpers.swift:3084— Formatter._parseImports has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 10, loops 5 (8 pts), match/switch 1 (3 pts), ternaries 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.
Mesh.lathe (cognitive 45) Snapshots/Euclid/Sources/Shapes.swift:338— Mesh.lathe has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 9, loops 3 (5 pts), match/switch 1 (nesting depth added 17). Of this number, 42 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.isStartOfStatement (cognitive 45) Sources/ParsingHelpers.swift:1316— Formatter.isStartOfStatement has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 17, match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.mergeNestedIf (cognitive 43) Sources/Rules/NestedIf.swift:36— Formatter.mergeNestedIf has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 25, if/else 11 (12 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.manuallyImplementedEquatableTypes (cognitive 42) Sources/Rules/RedundantEquatable.swift:145— Formatter.manuallyImplementedEquatableTypes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 16 (nesting depth added 14). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Formatter.indexWhereLineShouldWrap (cognitive 41) Sources/FormattingHelpers.swift:1181— Formatter.indexWhereLineShouldWrap has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 11, match/switch 1 (2 pts), loops 1 (nesting depth added 14). Of this number, 35 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.wrapEnumCaseDeclaration (cognitive 41) Sources/Rules/WrapEnumCases.swift:50— Formatter.wrapEnumCaseDeclaration has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 15, ternaries 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.
Arguments.swift.argumentsFor (cognitive 41) Sources/Arguments.swift:815— Arguments.swift.argumentsFor has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 6, ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseNonOptionalType (cognitive 40) Sources/ParsingHelpers.swift:1773— Formatter.parseNonOptionalType has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 20, if/else 12 (20 pts) (nesting depth added 8). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.synthesizedEquatableAndHashableTypes (cognitive 40) Sources/Rules/UnusedPrivateDeclarations.swift:92— Formatter.synthesizedEquatableAndHashableTypes has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 21, if/else 12 (18 pts), loops 1 (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Arguments.swift.mergeArguments (cognitive 40) Sources/Arguments.swift:607— Arguments.swift.mergeArguments has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 4, loops 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.
Formatter.parseGenericTypes (cognitive 37) Sources/FormattingHelpers.swift:2390— Formatter.parseGenericTypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 8, 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.
UnicodeScalarView.parseEscapedIdentifier (cognitive 37) Snapshots/Expression/Sources/Expression.swift:1299— UnicodeScalarView.parseEscapedIdentifier has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (7 pts), boolean chains 4, ternaries 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.
Arguments.swift.warningsForArguments (cognitive 37) Sources/Arguments.swift:1082— Arguments.swift.warningsForArguments has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 8, loops 5 (8 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.
UnicodeScalarView.parseOperator (cognitive 36) Sources/Tokenizer.swift:957— UnicodeScalarView.parseOperator has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). Of this number, 30 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.processDirectives (cognitive 34) Sources/Formatter.swift:174— Formatter.processDirectives has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (8 pts), error handling 1 (4 pts), boolean chains 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.
Formatter._endOfDeclarationInTypeBody (cognitive 34) Sources/ParsingHelpers.swift:2578— Formatter._endOfDeclarationInTypeBody has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6, loops 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.
Token.unescaped (cognitive 34) Sources/Tokenizer.swift:281— Token.unescaped has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 17). 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.
Formatter.backticksRequired (cognitive 33) Sources/ParsingHelpers.swift:1540— Formatter.backticksRequired has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (28 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.
Formatter.wrapSingleLineString (cognitive 33) Sources/Rules/WrapSingleLineStrings.swift:46— Formatter.wrapSingleLineString has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, ternaries 4 (7 pts), loops 4 (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.
CGPath.paths (cognitive 32) Snapshots/Euclid/Sources/CoreGraphics.swift:59— CGPath.paths has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, loops 2 (4 pts), match/switch 3, ternaries 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 2 function items inside it that branch (updateLastPoint, endPath). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SwiftFormat.swift.enumerateFiles::resolveInputURL (cognitive 32) Sources/SwiftFormat.swift:171— SwiftFormat.swift.enumerateFiles::resolveInputURL has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (28 pts), error handling 2 (4 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (SwiftFormat.swift.enumerateFiles) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Path.clippedToYAxis (cognitive 31) Snapshots/Euclid/Sources/Paths.swift:328— Path.clippedToYAxis has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 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.
Formatter.shouldInsertSpaceAfterToken (cognitive 31) Sources/FormattingHelpers.swift:93— Formatter.shouldInsertSpaceAfterToken has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 9, match/switch 3 (5 pts) (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.
Consumer.description (cognitive 31) Snapshots/Consumer/Sources/Consumer.swift:221— Consumer.description has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), match/switch 3 (5 pts), ternaries 2 (5 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Formatter.removeSelf (cognitive 29) Sources/FormattingHelpers.swift:156— Formatter.removeSelf has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (9 pts), ternaries 2 (4 pts), match/switch 1 (2 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.
Formatter.parseConditionalStatement (cognitive 29) Sources/ParsingHelpers.swift:4674— Formatter.parseConditionalStatement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 7, 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.
Path.curve (cognitive 28) Snapshots/Euclid/Sources/Shapes.swift:69— Path.curve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, match/switch 2 (3 pts), ternaries 3, loops 1 (nesting depth added 7). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeDeclaration.convertToSwiftTestingSuite (cognitive 28) Sources/Rules/PreferSwiftTesting.swift:170— TypeDeclaration.convertToSwiftTestingSuite has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 8, 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.
Formatter.switchStatementBranchesWithSpacingInfo (cognitive 28) Sources/FormattingHelpers.swift:1968— Formatter.switchStatementBranchesWithSpacingInfo has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (10 pts), loops 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.validDefaultArgumentExpression (cognitive 28) Sources/Rules/RedundantOverload.swift:413— Formatter.validDefaultArgumentExpression has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, 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.
Formatter.simplifiableLiteralRange (cognitive 28) Sources/Rules/RedundantType.swift:348— Formatter.simplifiableLiteralRange has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 3 (4 pts), boolean chains 3 (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.
Token.isEndOfScope (cognitive 28) Sources/Tokenizer.swift:577— Token.isEndOfScope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (10 pts), ternaries 2 (8 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FormatString.init (cognitive 27) Snapshots/Sprinter/Sources/Sprinter.swift:603— FormatString.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (5 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.
Formatter.grouping (cognitive 27) Sources/Inference.swift:1409— Formatter.grouping has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseDeclarations (cognitive 27) Sources/ParsingHelpers.swift:2456— Formatter.parseDeclarations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 12, loops 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.
Formatter.indentForScopeInMultilineCondition (cognitive 27) Sources/Rules/Indent.swift:980— Formatter.indentForScopeInMultilineCondition has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (11 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CommandLine.swift.parseCodeBlocks (cognitive 27) Sources/CommandLine.swift:1747— CommandLine.swift.parseCodeBlocks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, ternaries 1 (3 pts), 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.
Path.edgeVertices (cognitive 26) Snapshots/Euclid/Sources/Paths.swift:174— Path.edgeVertices has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (8 pts), loops 3 (5 pts), match/switch 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.
Polygon.split (cognitive 26) Snapshots/Euclid/Sources/CSG.swift:482— Polygon.split has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts), ternaries 3, 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.
Polygon.triangulate (cognitive 26) Snapshots/Euclid/Sources/Polygon.swift:132— Polygon.triangulate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). Of this number, 24 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.isInResultBuilder (cognitive 26) Sources/ParsingHelpers.swift:1482— Formatter.isInResultBuilder has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, match/switch 1 (3 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.
Formatter.convertIfToForWhere (cognitive 26) Sources/Rules/ForWhere.swift:57— Formatter.convertIfToForWhere has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 19, if/else 5 (6 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseExtendedLifetimeClosure (cognitive 26) Sources/Rules/RedundantExtendedLifetime.swift:139— Formatter.parseExtendedLifetimeClosure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 8, 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.
Formatter.compare (cognitive 26) Sources/Rules/RedundantType.swift:188— Formatter.compare has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, match/switch 1 (3 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.
Mesh.init (cognitive 25) Snapshots/Euclid/Sources/SceneKit.swift:510— Mesh.init has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 4 (5 pts), match/switch 2 (4 pts), ternaries 1 (2 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.
Formatter.removeParen (cognitive 25) Sources/FormattingHelpers.swift:1412— Formatter.removeParen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, match/switch 2 (nesting depth added 6). Of this number, 19 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.isSingleExpression (cognitive 25) Sources/ParsingHelpers.swift:2326— Formatter.isSingleExpression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6 (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.
Formatter.removeRedundantEnumerated (cognitive 25) Sources/Rules/RedundantEnumerated.swift:33— Formatter.removeRedundantEnumerated has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 17, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseComparedProperties (cognitive 25) Sources/Rules/RedundantEquatable.swift:248— Formatter.parseComparedProperties has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 17, if/else 5 (7 pts), loops 1 (nesting depth added 2). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Formatter.parseTuplePropertyDeclaration (cognitive 25) Sources/Rules/SinglePropertyPerLine.swift:340— Formatter.parseTuplePropertyDeclaration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7 (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.
UnicodeScalarView.parseNumericLiteral (cognitive 25) Snapshots/Expression/Sources/Expression.swift:1138— UnicodeScalarView.parseNumericLiteral has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (scanNumber, scanExponent, scanHex, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Placeholder.getSwiftType (cognitive 24) Snapshots/Sprinter/Sources/Sprinter.swift:193— Placeholder.getSwiftType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 6 (11 pts) (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.
Formatter.parsePropertyDeclaration (cognitive 24) Sources/ParsingHelpers.swift:2997— Formatter.parsePropertyDeclaration has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (11 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.areMembers (cognitive 24) Sources/Rules/RedundantFileprivate.swift:169— Formatter.areMembers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 4, loops 2 (4 pts), match/switch 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.
Formatter.redundantOverloadCandidates (cognitive 24) Sources/Rules/RedundantOverload.swift:102— Formatter.redundantOverloadCandidates has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, loops 3 (5 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.
Consumer._compile (cognitive 24) Snapshots/Consumer/Sources/ConsumerCompiler.swift:61— Consumer._compile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 90 (163 pts), loops 16 (31 pts), match/switch 7 (10 pts), boolean chains 6 (nesting depth added 91). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (Consumer._compile::_compileSkip, Consumer._compile::_compileFlatten, Consumer._compile::_compile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Subexpression.description (cognitive 23) Snapshots/Expression/Sources/Expression.swift:851— Subexpression.description has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 4 (5 pts), boolean chains 3 (nesting depth added 10). Of this number, 19 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
Formatter.switchStatementBranches (cognitive 23) Sources/FormattingHelpers.swift:1723— Formatter.switchStatementBranches has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, 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.
Formatter.isEndOfStatement (cognitive 23) Sources/ParsingHelpers.swift:1256— Formatter.isEndOfStatement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 4 (8 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.
Formatter.declarationIndexAndScope (cognitive 23) Sources/ParsingHelpers.swift:3719— Formatter.declarationIndexAndScope has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 1 (2 pts), 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.
Formatter.shouldBeDocComment (cognitive 23) Sources/Rules/DocComments.swift:133— Formatter.shouldBeDocComment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, 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.
Formatter.swiftTestingExpectationForXCTestHelper (cognitive 23) Sources/Rules/PreferSwiftTesting.swift:309— Formatter.swiftTestingExpectationForXCTestHelper has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 5 (9 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseSwitchCaseRanges (cognitive 23) Sources/Rules/SortSwitchCases.swift:90— Formatter.parseSwitchCaseRanges has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 9, 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.
Formatter.addOrRemoveTrailingComma (cognitive 23) Sources/Rules/TrailingCommas.swift:234— Formatter.addOrRemoveTrailingComma has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 5 (8 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.
Formatter.chainStartIndex (cognitive 23) Sources/Rules/WrapMultilineFunctionChains.swift:88— Formatter.chainStartIndex has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (4 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (Formatter.chainEndIndex) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Formatter.chainEndIndex (cognitive 23) Sources/Rules/WrapMultilineFunctionChains.swift:160— Formatter.chainEndIndex has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (4 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (Formatter.chainStartIndex) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Placeholder.buildFormatter (cognitive 22) Snapshots/Sprinter/Sources/Sprinter.swift:310— Placeholder.buildFormatter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 3 (5 pts) (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.
Formatter.wrapConditionSeparators (cognitive 22) Sources/FormattingHelpers.swift:449— Formatter.wrapConditionSeparators has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (9 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.isSimpleTestSuite (cognitive 22) Sources/ParsingHelpers.swift:3272— Formatter.isSimpleTestSuite has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1, match/switch 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.
Formatter.parseFunctionDeclarationArguments (cognitive 22) Sources/ParsingHelpers.swift:4187— Formatter.parseFunctionDeclarationArguments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, ternaries 1 (2 pts), 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.
Formatter.isTypeInitialized (cognitive 22) Sources/Rules/RedundantFileprivate.swift:134— Formatter.isTypeInitialized has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (5 pts), 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.
Formatter.forwardingCall (cognitive 22) Sources/Rules/RedundantOverload.swift:370— Formatter.forwardingCall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
1212.swift.getType (cognitive 22) Snapshots/Issues/1212.swift:3— 1212.swift.getType has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 8, if/else 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.index (cognitive 21) Sources/Formatter.swift:762— Formatter.index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.parseFunctionDeclaration (cognitive 21) Sources/ParsingHelpers.swift:4079— Formatter.parseFunctionDeclaration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9 (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.
Formatter.convertForWhereToIf (cognitive 21) Sources/Rules/ForWhere.swift:128— Formatter.convertForWhereToIf has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (7 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.hasUnsupportedXCTestHelper (cognitive 21) Sources/Rules/PreferSwiftTesting.swift:249— Formatter.hasUnsupportedXCTestHelper has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (3 pts), 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.
Formatter.parseEnumCaseDeclaration (cognitive 21) Sources/Rules/RedundantOverload.swift:319— Formatter.parseEnumCaseDeclaration has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (7 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_FirestoreDecoder.unbox (cognitive 21) Snapshots/Issues/697.swift:1111— _FirestoreDecoder.unbox has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Formatter.returnKeywordRangesToRemove (cognitive 20) Sources/Rules/RedundantReturn.swift:273— Formatter.returnKeywordRangesToRemove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (6 pts), boolean chains 3 (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.
Formatter.parseMultiplePropertyDeclaration (cognitive 20) Sources/Rules/SinglePropertyPerLine.swift:245— Formatter.parseMultiplePropertyDeclaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, 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.
Globs.swift.matchGlobs (cognitive 20) Sources/Globs.swift:122— Globs.swift.matchGlobs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftFormat.swift.parseConfigArguments (cognitive 20) Sources/SwiftFormat.swift:403— SwiftFormat.swift.parseConfigArguments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
SwiftFormat.swift.stripMarkdown (cognitive 20) Sources/SwiftFormat.swift:887— SwiftFormat.swift.stripMarkdown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, 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.
Formatter.scanIfdef (cognitive 19) Sources/FormattingHelpers.swift:1816— Formatter.scanIfdef has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 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.
Formatter.linewrapIndent (cognitive 19) Sources/ParsingHelpers.swift:3784— Formatter.linewrapIndent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8 (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.
Formatter.preserveConsecutivePropertyGroupSpacing (cognitive 19) Sources/Rules/OrganizeDeclarations.swift:654— Formatter.preserveConsecutivePropertyGroupSpacing has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 pts), boolean chains 3, 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.
Polygon.join (cognitive 18) Snapshots/Euclid/Sources/Polygon.swift:253— Polygon.join has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Expression.init::pureEvaluator (cognitive 18) Snapshots/Expression/Sources/Expression.swift:334— Expression.init::pureEvaluator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 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.
Formatter.startOfMemberCallReceiver (cognitive 18) Sources/ParsingHelpers.swift:621— Formatter.startOfMemberCallReceiver has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 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.
Formatter.isLikelyToBeSubclassed (cognitive 18) Sources/ParsingHelpers.swift:3347— Formatter.isLikelyToBeSubclassed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 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.
Formatter.tryConvertDifferentNameBinding (cognitive 18) Sources/Rules/RedundantOptionalBinding.swift:89— Formatter.tryConvertDifferentNameBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, 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.
Arguments.swift.applyFormatOptions (cognitive 18) Sources/Arguments.swift:1020— Arguments.swift.applyFormatOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, error handling 1 (2 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.
Charset.ranges (cognitive 17) Snapshots/Consumer/Sources/Consumer.swift:696— Charset.ranges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
BSPNode.insert (cognitive 17) Snapshots/Euclid/Sources/CSG.swift:378— BSPNode.insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 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.
Formatter.startOfConditionalStatement (cognitive 17) Sources/ParsingHelpers.swift:1059— Formatter.startOfConditionalStatement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Formatter.adjustBodyDeclarationRanges (cognitive 17) Sources/Rules/OrganizeDeclarations.swift:395— Formatter.adjustBodyDeclarationRanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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.
Formatter.parseExtendedLifetimeCall (cognitive 17) Sources/Rules/RedundantExtendedLifetime.swift:75— Formatter.parseExtendedLifetimeCall has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.parseGroupCall (cognitive 17) Sources/Rules/RedundantSwiftUIGroup.swift:175— Formatter.parseGroupCall has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (7 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Paths.swift.sanitizePoints (cognitive 16) Snapshots/Euclid/Sources/Paths.swift:456— Paths.swift.sanitizePoints has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), 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.
Formatter.removeTestPrefix (cognitive 16) Sources/FormattingHelpers.swift:2168— Formatter.removeTestPrefix has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), loops 2 (4 pts) (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.
Formatter.updateDeclarationName (cognitive 16) Sources/FormattingHelpers.swift:2216— Formatter.updateDeclarationName has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.endOfExpression (cognitive 16) Sources/ParsingHelpers.swift:193— Formatter.endOfExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 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.
Formatter.isTypePosition (cognitive 16) Sources/ParsingHelpers.swift:268— Formatter.isTypePosition 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.
Formatter.convertXCTestOverride (cognitive 16) Sources/Rules/PreferSwiftTesting.swift:524— Formatter.convertXCTestOverride has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Formatter.inferredArrayLiteralElementType (cognitive 16) Sources/Rules/RedundantType.swift:265— Formatter.inferredArrayLiteralElementType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), 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.
Formatter.enumCaseRanges (cognitive 16) Sources/Rules/WrapEnumCases.swift:145— Formatter.enumCaseRanges has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SwiftFormat.swift.enumerateFiles (cognitive 16) Sources/SwiftFormat.swift:145— SwiftFormat.swift.enumerateFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 20 (43 pts), error handling 6 (13 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (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. This shape REPEATS in the file: one other method here (SwiftFormat.swift.enumerateFiles::resolveInputURL) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SwiftFormat.swift.replaceLines (cognitive 16) Sources/SwiftFormat.swift:581— SwiftFormat.swift.replaceLines has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 4, loops 3 (4 pts), match/switch 1 (3 pts) (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.
Change coupling: FormatFileCommand.swift ↔ FormatSelectionCommand.swift EditorExtension/Extension/FormatFileCommand.swift:1— `EditorExtension/Extension/FormatFileCommand.swift` and `EditorExtension/Extension/FormatSelectionCommand.swift` change together 64% of the time (18 of the 28 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `00e219d6` Fix missing lint output for organizeDeclarations rule (#1826); `482d9129` Ignore fileInfo requirements in Xcode Extension; `508710dc` Xcode Ext - Fixes restoring of selections position in Xcode 12 — run `git show` on any of them.
Near-duplicate member pair (53 shared lines) Snapshots/Euclid/Sources/SceneKit.swift:90— Snapshots/Euclid/Sources/SceneKit.swift:90-165 | Snapshots/Euclid/Sources/SceneKit.swift:168-246 — These two members are variants of one another: 53 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.
Duplicated block (33 lines × 2) Snapshots/Euclid/Sources/SceneKit.swift:122— Snapshots/Euclid/Sources/SceneKit.swift:122-154 | Snapshots/Euclid/Sources/SceneKit.swift:203-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Euclid/Sources/SceneKit.swift:122` 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 (29–32 lines × 2) Snapshots/Expression/Sources/Expression.swift:721— Snapshots/Expression/Sources/Expression.swift:721-752 | Sources/Tokenizer.swift:1057-1085 — 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 (24–31 lines × 2) Snapshots/Expression/Sources/Expression.swift:681— Snapshots/Expression/Sources/Expression.swift:681-711 | Sources/Tokenizer.swift:959-982 — 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 (27 lines × 2) Sources/Rules/WrapMultilineFunctionChains.swift:132— Sources/Rules/WrapMultilineFunctionChains.swift:132-158 | Sources/Rules/WrapMultilineFunctionChains.swift:204-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/WrapMultilineFunctionChains.swift:132` 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 (24–25 lines × 2) Sources/ParsingHelpers.swift:3540— Sources/ParsingHelpers.swift:3540-3564 | Sources/ParsingHelpers.swift:3617-3640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/ParsingHelpers.swift:3540` 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 (20 lines × 3) Snapshots/Euclid/Sources/SceneKit.swift:274— Snapshots/Euclid/Sources/SceneKit.swift:274-293 | Snapshots/Euclid/Sources/SceneKit.swift:326-345 | Snapshots/Euclid/Sources/SceneKit.swift:368-387 — 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 `Snapshots/Euclid/Sources/SceneKit.swift:274` 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 (18 lines × 4) Snapshots/Euclid/Sources/SceneKit.swift:279— Snapshots/Euclid/Sources/SceneKit.swift:279-296 | Snapshots/Euclid/Sources/SceneKit.swift:331-348 | Snapshots/Euclid/Sources/SceneKit.swift:373-390 | Snapshots/Euclid/Sources/SceneKit.swift:413-430 — 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 `Snapshots/Euclid/Sources/SceneKit.swift:279` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) Sources/FormattingHelpers.swift:2148— Sources/FormattingHelpers.swift:2148-2165 | Sources/Rules/OrganizeDeclarations.swift:982-996 — 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/FormattingHelpers.swift:2148` 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 (18 lines × 2) Sources/Tokenizer.swift:967— Sources/Tokenizer.swift:967-984 | Sources/Tokenizer.swift:1092-1109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Tokenizer.swift:967` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Tokenizer.swift:985` calls `isHead` and `Sources/Tokenizer.swift:1110` 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–17 lines × 2) Sources/Rules/ForWhere.swift:194— Sources/Rules/ForWhere.swift:194-208 | Sources/Rules/NestedIf.swift:173-189 — 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/Rules/ForWhere.swift:194` 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–16 lines × 2) EditorExtension/Extension/FormatFileCommand.swift:36— EditorExtension/Extension/FormatFileCommand.swift:36-49 | EditorExtension/Extension/LintFileCommand.swift:13-28 — 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 `EditorExtension/Extension/FormatFileCommand.swift:36` 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–16 lines × 2) Snapshots/Consumer/Sources/ConsumerCompiler.swift:680— Snapshots/Consumer/Sources/ConsumerCompiler.swift:680-694 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:721-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Snapshots/Consumer/Sources/ConsumerCompiler.swift:680` 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 (12–14 lines × 3) EditorExtension/Extension/FormatFileCommand.swift:42— EditorExtension/Extension/FormatFileCommand.swift:42-53 | EditorExtension/Extension/FormatSelectionCommand.swift:47-58 | EditorExtension/Extension/LintFileCommand.swift:19-32 — before extracting anything, compare `EditorExtension/Extension/FormatFileCommand.swift` and `EditorExtension/Extension/FormatSelectionCommand.swift` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) Snapshots/Euclid/Sources/SceneKit.swift:250— Snapshots/Euclid/Sources/SceneKit.swift:250-262 | Snapshots/Euclid/Sources/SceneKit.swift:300-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–12 lines × 2) Snapshots/Consumer/Sources/Consumer.swift:882— Snapshots/Consumer/Sources/Consumer.swift:882-888 | Snapshots/Consumer/Sources/ConsumerCompiler.swift:1233-1244 — 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 `Snapshots/Consumer/Sources/Consumer.swift:882` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–11 lines × 2) Sources/CommandLine.swift:1553— Sources/CommandLine.swift:1553-1561 | Sources/CommandLine.swift:1582-1592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CommandLine.swift:1553` 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/Tokenizer.swift:1361— Sources/Tokenizer.swift:1361-1371 | Sources/Tokenizer.swift:1448-1458 — both copies are in the same file, so extract the 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–9 lines × 2) Sources/Rules/PreferSwiftTesting.swift:461— Sources/Rules/PreferSwiftTesting.swift:461-468 | Sources/Rules/PreferSwiftTesting.swift:493-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Rules/PreferSwiftTesting.swift:461` 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–8 lines × 3) Sources/TypeName.swift:50— Sources/TypeName.swift:50-57 | Sources/TypeName.swift:70-75 | Sources/TypeName.swift:83-88 — 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/TypeName.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. 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/ParsingHelpers.swift:3006— Sources/ParsingHelpers.swift:3006-3012 | Sources/Rules/SinglePropertyPerLine.swift:257-264 — 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/ParsingHelpers.swift:3006` 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 (3–6 lines × 3) Sources/CommandLine.swift:1577— Sources/CommandLine.swift:1577-1579 | Sources/JSONReporter.swift:58-63 | Sources/SARIFReporter.swift:58-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/CommandLine.swift:1577` 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 `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 (5 lines × 3) Sources/FormattingHelpers.swift:2517— Sources/FormattingHelpers.swift:2517-2521 | Sources/FormattingHelpers.swift:3229-3233 | Sources/FormattingHelpers.swift:3313-3317 — 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 (12–13 lines × 2) Sources/Rules/SwiftTestingTestCaseNames.swift:122— Sources/Rules/SwiftTestingTestCaseNames.swift:122-134 | Sources/Rules/SwiftTestingTestCaseNames.swift:151-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. 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.
Off the main sequence: SwiftFormat — SwiftFormat: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
No direct assertions: testFormatting PerformanceTests/PerformanceTests.swift:63— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testWorstCaseFormatting PerformanceTests/PerformanceTests.swift:71— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testIndent PerformanceTests/PerformanceTests.swift:150— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testWorstCaseIndent PerformanceTests/PerformanceTests.swift:181— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testRedundantSelf PerformanceTests/PerformanceTests.swift:190— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testWorstCaseRedundantSelf PerformanceTests/PerformanceTests.swift:198— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testNumberFormatting PerformanceTests/PerformanceTests.swift:207— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testWorstCaseNumberFormatting PerformanceTests/PerformanceTests.swift:240— No conventional assertion call was detected, and 21 of 27 tests in `PerformanceTests` 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: testUppercaseAcronyms Tests/Rules/AcronymsTests.swift:13— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testUppercaseCustomAcronym Tests/Rules/AcronymsTests.swift:51— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testDisableUppercaseAcronym Tests/Rules/AcronymsTests.swift:69— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testRespectsPreserveSymbols Tests/Rules/AcronymsTests.swift:79— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testAcronymMatchesPartOfOtherWordAtEndOfIdentifier Tests/Rules/AcronymsTests.swift:94— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testAcronymNotMatchedAsSuffixOfAnotherAcronym Tests/Rules/AcronymsTests.swift:110— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPreserveAcronymsAsSubstringOfIdentifier Tests/Rules/AcronymsTests.swift:134— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPreserveAcronymsDoesNotAffectOtherIdentifiers Tests/Rules/AcronymsTests.swift:143— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPreserveAcronymsMatchesSubstringInLongerIdentifier Tests/Rules/AcronymsTests.swift:158— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testDefaultVisibilityCapitalizesInternalButNotPublicDeclarations Tests/Rules/AcronymsTests.swift:167— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPublicVisibilityCapitalizesPublicButNotOpenDeclarations Tests/Rules/AcronymsTests.swift:185— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPrivateVisibilityPreservesUnknownAndWiderDeclarations Tests/Rules/AcronymsTests.swift:210— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPreservesNameWhenCapitalizationWouldCollide Tests/Rules/AcronymsTests.swift:227— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testPreservesProtocolAndOverrideContracts Tests/Rules/AcronymsTests.swift:236— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testIfAndReplaced Tests/Rules/AndOperatorTests.swift:13— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testGuardAndReplaced Tests/Rules/AndOperatorTests.swift:23— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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: testWhileAndReplaced Tests/Rules/AndOperatorTests.swift:36— No conventional assertion call was detected, and 5461 of 5507 tests in `Rules` 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.
Duplicated predicate Sources/Rules/HoistAwait.swift:34— `$0 == .startOfScope("(") || $0 == .startOfScope("[")` appears character-identically in 2 files — Sources/Rules/HoistAwait.swift, Sources/Rules/HoistTry.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/Rules/ExtensionAccessControl.swift:28— `$0.keyword == "extension" && $0.visibility() == .public` appears character-identically in 3 files — Sources/Rules/ExtensionAccessControl.swift, Sources/Rules/RedundantPublic.swift, Sources/Rules/RedundantSendable.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/Rules/EnumNamespaces.swift:46— `$0.keyword == "func" && $0.hasModifier("@Test")` appears character-identically in 2 files — Sources/Rules/EnumNamespaces.swift, Sources/Rules/SwiftTestingTestCaseNames.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/Inference.swift:539— `(keywordFound || !identifierFound) && count > 0` appears character-identically in 2 files — Sources/Inference.swift, Sources/Rules/HoistPatternLet.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 Snapshots/Layout/UIDesigner/EditViewController.swift:14— `cls.isSubclass(of: UIView.self) || cls.isSubclass(of: UIViewController.self)` appears character-identically in 2 files — Snapshots/Layout/UIDesigner/EditViewController.swift, Snapshots/Layout/UIKitSymbols/UIKitSymbols.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/FormattingHelpers.swift:3565— `declaration.keyword == "var" || declaration.keyword == "let"` appears character-identically in 2 files — Sources/FormattingHelpers.swift, Sources/Rules/RedundantSwiftUIGroup.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/Rules/TestSuiteAccessControl.swift:100— `modifiers.contains("override") || modifiers.contains("@objc") || modifiers.contains("static")` appears character-identically in 2 files — Sources/Rules/TestSuiteAccessControl.swift, Sources/Rules/ValidateTestCases.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/Rules/TestSuiteAccessControl.swift:123— `modifiers.contains("private") || modifiers.contains("fileprivate")` appears character-identically in 2 files — Sources/Rules/TestSuiteAccessControl.swift, Sources/Rules/ValidateTestCases.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 Snapshots/Layout/Layout/RuntimeTypes.swift:423— `swift(>=4.1.5) || (!swift(>=4) && swift(>=3.4))` appears character-identically in 2 files — Snapshots/Layout/Layout/RuntimeTypes.swift, Snapshots/Layout/Layout/UIView+Layout.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/Rules/BlankLinesAtEndOfScope.swift:50— `token != .startOfScope("{") || formatter.options.scopeBlankLines == .remove` appears character-identically in 2 files — Sources/Rules/BlankLinesAtEndOfScope.swift, Sources/Rules/BlankLinesAtStartOfScope.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/Rules/EnvironmentEntry.swift:71— `typeDeclaration.keyword == "struct" || typeDeclaration.keyword == "enum"` appears character-identically in 2 files — Sources/Rules/EnvironmentEntry.swift, Sources/Rules/RedundantSendable.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.
Orphaned file EditorExtension/Shared/RulesStore.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Rules/RedundantEmptyView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/Rules/PreferExplicitFalse.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file EditorExtension/Application/Source/UserSelection.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/XMLReporter.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file EditorExtension/Application/Source/FreeTextTableCellView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file Sources/GithubActionsLogReporter.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file EditorExtension/Application/Source/ListSelectionTableCellView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
README/code drift Snapshots/Euclid/README.md:8— Snapshots/Euclid/README.md links to `Euclid.png?raw=true`, but `Snapshots/Euclid/Euclid.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift Snapshots/Euclid/README.md:59— Snapshots/Euclid/README.md links to `CONTRIBUTING.md`, but `Snapshots/Euclid/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift Snapshots/Layout/README.md:14— Snapshots/Layout/README.md links to `Layout.gif?raw=true`, but `Snapshots/Layout/Layout.gif` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 3 significant file(s) lose their only recent owner: Sources/FormatRule.swift, Sources/Rules/ElseOnSameLine.swift, Snapshots/SwiftUI/WordScramble/ContentView.swift. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 4 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 (10 single-owned of 160 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 160 of the 294 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Sources/Rules/PreferCountWhere.swift, Sources/JSONReporter.swift, EditorExtension/Extension/FormatSelectionCommand.swift, EditorExtension/Extension/FormatFileCommand.swift, Sources/Rules/PreferLazyMap.swift, Sources/Rules/ConsistentSwitchCaseSpacing.swift.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 5 project(s) overshoot their size bounds, lowering Project Cohesion to 6.0/10. The most over is `(repository root)` (48575 LoC, 406 module-visible types across 29 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· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 9 of 168 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 168 of the 294 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: EditorExtension/Shared/RulesStore.swift, Sources/Rules/RedundantEmptyView.swift, Sources/Rules/PreferExplicitFalse.swift, EditorExtension/Application/Source/UserSelection.swift, Sources/XMLReporter.swift, Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift, EditorExtension/Application/Source/FreeTextTableCellView.swift, Sources/GithubActionsLogReporter.swift (and 1 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 29986 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
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.
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 44 file(s) — `EditorExtension/Application/Source/RulesViewController.swift`, `Snapshots/Consumer/Examples/REPL/repl.swift`, `Snapshots/Consumer/Sources/Consumer.swift`, `Snapshots/Expression/Sources/AnyExpression.swift`, `Snapshots/Expression/Sources/Expression.swift`, … (+39 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.
Run 01a1776d-0288-77a2-a2eb-d5372bd51bb1 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 67 · Warnings: 807 · Recommendations: 5553 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 08:56 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.