Public report of debugtheworldbot/keyStats, published 15 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 15 November 2026, 02:15 UTC · Survey ID cd_72e3a17a6c9b4a38ae33a7ab584d8746
debugtheworldbot/keyStats
Measured 15 November 2026, 02:15 UTC, at code version 9bf60b2
Code coverage is not measured: .NET and JavaScript/TypeScript suite (Unclassified, CouldNotMeasureNoCollector).
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: 37,958 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Architecture, 48
Findings by how serious they are
46 critical288 serious38 minor
20 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 02:15 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
60of 60 dimensions measured by tools.
362of 372 findings point to an exact file and line, so you can open each one in the code. The other 10 concern the repository as a whole, such as missing documentation.
60dimensions across 6 lenses, read from 37,958 lines of product code in 2 projects.
debugtheworldbot/keyStats falls short of our standard for production, held back most by its Architecture lens, the way the code is structured into parts. It scores 54 out of 100 and is rated Adequate, and 30 of its 46 critical findings are security problems.
Architecture, at 48, is the weakest lens and counts most in the score. The best first step is checking whether the largest projects should be split, worth about 4 points. Removing the unread values comes next, worth about 2 points. Raising Architecture to 70 would lift the score to about 59.
Seventeen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven known security holes in the packages the code depends on can be used by attackers, and thirteen errors are caught and ignored, so failures can go unnoticed. Pinning each tool to an exact version, updating the vulnerable packages and handling or logging the ignored errors would close these risks. Loading the key from a secret store instead of the code would fix the three encryption keys written into the code, and passing outside input through environment variables would deal with the pipeline step that puts outside input straight into a shell command. The two data fields that are written but never read need removing.
The product code is 37,958 lines, about €93,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.
Outbound HTTP resilience · Outbound HTTP without resilience KeyStats.Windows/KeyStats/Services/SyncTransport.cs
Outbound HTTP resilience · Outbound HTTP without resilience KeyStats.Windows/KeyStats/Services/SyncTransport.cs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 13 findings
These 13 critical or serious findings were in the previous survey, on 29 October 2026, and are gone from this one.
€30,000 to €150,000, for 503 to 1,631 hours of work, about 0.6 person-years for 1 to 2 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 54. 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: 37,958 lines of product code
Comment lines
The estimate prices 37,671 lines. Comment lines count towards the size of 37,958 lines but aren't priced as work.
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
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 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.
Raises the score by about 4 points · Low effort · Project Cohesion
2
Resolve the 2 WriteOnlyPrivateField finding(s) in Explicit Debt — start with KeyNameMapper.cs, SyncCoordinator.cs.
Raises the score by about 2 points · Low effort · Explicit Debt
3
Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €93,000 to build again, about 0.6 person-years of work. Its weakest lens is Architecture, at 48 (Weak). Architecture is about whether the structure holds up as the product grows, and when the structure is weak, a change in one place ripples into many others. Because the weakest lens counts most in the score, work on Architecture also moves the score most.
Based on: the rebuild estimate · the Architecture grade · how much each lens counts
What to do: Start with the Architecture actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 Project Cohesion findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 6,564 lines over the last 90 days, which is about 26,621 lines a year. At that pace, the extra work comes to an estimated 2.9 to 17.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
20 modules, with 23 dependencies between them. One loop runs through 3 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.
KeyStats.Services uses KeyStats.Helpers, so a change to KeyStats.Helpers can break KeyStats.Services, while a change to KeyStats.Services can't break KeyStats.Helpers.
Position
Below the diagonal: KeyStats.Services uses a module listed above it, which is the healthy direction.
74 pairs of types, where a type in KeyStats.Services uses a type in KeyStats.Models. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
KeyStats.Services uses KeyStats.Models, so a change to KeyStats.Models can break KeyStats.Services, while a change to KeyStats.Services can't break KeyStats.Models.
Position
Below the diagonal: KeyStats.Services uses a module listed above it, which is the healthy direction.
14→19 KeyStats.Views.Controls uses KeyStats.ViewModelspart of a loop✕
Connections
3 pairs of types, where a type in KeyStats.Views.Controls uses a type in KeyStats.ViewModels.
KeyStats.Views.Controls uses KeyStats.ViewModels, so a change to KeyStats.ViewModels can break KeyStats.Views.Controls, while a change to KeyStats.Views.Controls can't break KeyStats.ViewModels.
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.
services.sync-worker.src.history uses services.sync-worker.src.types, so a change to services.sync-worker.src.types can break services.sync-worker.src.history, while a change to services.sync-worker.src.history can't break services.sync-worker.src.types.
Position
Below the diagonal: services.sync-worker.src.history uses a module listed above it, which is the healthy direction.
services.sync-worker.src.sync uses services.sync-worker.src.types, so a change to services.sync-worker.src.types can break services.sync-worker.src.sync, while a change to services.sync-worker.src.sync can't break services.sync-worker.src.types.
Position
Below the diagonal: services.sync-worker.src.sync uses a module listed above it, which is the healthy direction.
KeyStats.Views uses KeyStats.Models, so a change to KeyStats.Models can break KeyStats.Views, while a change to KeyStats.Views can't break KeyStats.Models.
Position
Below the diagonal: KeyStats.Views uses a module listed above it, which is the healthy direction.
KeyStats.Views uses KeyStats.Services, so a change to KeyStats.Services can break KeyStats.Views, while a change to KeyStats.Views can't break KeyStats.Services.
Position
Below the diagonal: KeyStats.Views uses a module listed above it, which is the healthy direction.
KeyStats.Views uses KeyStats.Views.Controls, so a change to KeyStats.Views.Controls can break KeyStats.Views, while a change to KeyStats.Views can't break KeyStats.Views.Controls.
Position
Below the diagonal: KeyStats.Views uses a module listed above it, which is the healthy direction.
17→19 KeyStats.Views uses KeyStats.ViewModelspart of a loop✕
Connections
4 pairs of types, where a type in KeyStats.Views uses a type in KeyStats.ViewModels.
KeyStats.Views uses KeyStats.ViewModels, so a change to KeyStats.ViewModels can break KeyStats.Views, while a change to KeyStats.Views can't break KeyStats.ViewModels.
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.
services.sync-worker.src uses services.sync-worker.src.cleanup, so a change to services.sync-worker.src.cleanup can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.cleanup.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
services.sync-worker.src uses services.sync-worker.src.env, so a change to services.sync-worker.src.env can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.env.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
services.sync-worker.src uses services.sync-worker.src.http, so a change to services.sync-worker.src.http can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.http.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
services.sync-worker.src uses services.sync-worker.src.types, so a change to services.sync-worker.src.types can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.types.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
services.sync-worker.src uses services.sync-worker.src.history, so a change to services.sync-worker.src.history can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.history.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
services.sync-worker.src uses services.sync-worker.src.sync, so a change to services.sync-worker.src.sync can break services.sync-worker.src, while a change to services.sync-worker.src can't break services.sync-worker.src.sync.
Position
Below the diagonal: services.sync-worker.src uses a module listed above it, which is the healthy direction.
KeyStats.ViewModels uses KeyStats.Models, so a change to KeyStats.Models can break KeyStats.ViewModels, while a change to KeyStats.ViewModels can't break KeyStats.Models.
Position
Below the diagonal: KeyStats.ViewModels uses a module listed above it, which is the healthy direction.
KeyStats.ViewModels uses KeyStats.Services, so a change to KeyStats.Services can break KeyStats.ViewModels, while a change to KeyStats.ViewModels can't break KeyStats.Services.
Position
Below the diagonal: KeyStats.ViewModels uses a module listed above it, which is the healthy direction.
KeyStats.ViewModels uses KeyStats.Views, so a change to KeyStats.Views can break KeyStats.ViewModels, while a change to KeyStats.ViewModels can't break KeyStats.Views.
Position
Below the diagonal: KeyStats.ViewModels uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
20
High / Critical
A03:2025 — Software Supply Chain Failures
17
High / Critical
Roadmap
Top priorities: Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED; Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race; 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.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED.
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.
Introduce deliberate module boundaries — by feature (vertical slices) if your team prefers, or by layer (domain/application/infrastructure). Even splitting into a few cohesive projects with a clear dependency direction would help.
Give every outbound call a bound the caller can rely on: set an explicit `HttpClient.Timeout` (or pass a `CancellationToken` from a `CancellationTokenSource` with a deadline) and flow the caller's own `CancellationToken` through, so a slow endpoint fails fast instead of hanging.
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 — 46
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 — 288
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 — 38
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 20
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 60 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 60 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, 362 of 372 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 51 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 9 test source file(s) (.ts, .swift) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source spans .cs, .swift, and the swift executor ran against the .swift half and never executed — so reliability was not measured for the repository as a whole. The .NET suite did build and re-run, and came back with 0 flaky across 2 measured tier(s) (unit: measured (0 flaky); JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in services/sync-worker/ (25 tests)): measured (0 flaky)) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: `dotnet list package` exited 1 with no output.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its NuGet package 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.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (7 contributor(s) across 364 commit(s) sampled, automation and bot accounts excluded). One of them holds 80% of the history; the other 6 hold 3.3% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 15 deducted marker(s) and the 0.8/KLoC density on this row were taken over this repository's .NET projects ALONE: .swift (17,360 lines, 46% of production source) went unread, because every marker collector on this path is reached through a C# workspace. D17's marker collectors need a compiler we do not have for that language, so none of its nine marker kinds were read there. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `KeyStats/Sync/SyncModels.swift`, `KeyStats/Sync/SyncTransport.swift`, `services/sync-worker/src/index.ts`, `services/sync-worker/worker-configuration.d.ts` 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.
AX6 Interface segregation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. (rule: no-root-manifest). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X22 Contradicted release guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X28 Index access outside its own emptiness guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X30 Support guard that admits what it rejects — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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 Dockerfile (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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
28 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was StatsManager.NormalizeKeyboardHeatmapKey at 87. A further 5 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 SyncKeyCanonicalizer.CanonicalPart at 86 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: KeyStats.Windows/KeyStats/Services/SyncKeyCanonicalizer.cs (SyncKeyCanonicalizer.CanonicalPart at 86). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 23 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with StatsManager.NormalizeKeyboardHeatmapKey (cyclomatic 87). — Refactoring it lifts Cyclomatic Complexity from 6.2 to about 6.5/10.
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.
+ 38 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 43 bodies over 15 down to 15 or less in Cognitive Complexity — start with SyncCoordinator.performSync (cognitive 52), SyncCoordinator.finishPendingProvisioning (cognitive 50), SyncCoordinator.SyncCoreAsync (cognitive 49). — 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 43 together lifts Cognitive Complexity from 6.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes5.2 / 10Adequate✓ 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 15 FileTooLong finding(s) in God Classes — start with SyncCoordinator.cs, StatsPopoverViewController.swift, SyncCoordinator.swift. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 14 TooManyMethods finding(s) in God Classes — start with StatsPopoverViewController.swift (2), SyncCoordinator.cs, StatsManager.swift. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 11 MethodTooLong finding(s) in God Classes — start with AllTimeStatsViewController.swift (2), SyncCoordinator.swift (2), SyncCoordinator.cs (2). — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D4 · Code Duplication4.2 / 10Weak✓ Tool-verified
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
60 duplicated block group(s) detected. 14.5 % of the production lines (2,575 of 17,737) are in a reported copy. A further 53 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 57 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with SettingsViewController.swift (2), StatsPopupWindow.xaml.cs, AllTimeStatsViewController.swift. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 6 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with TrayIconViewModel.cs, App.xaml.cs, StatsPopoverViewController.swift. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 Edited copy of a member (7 corresponding lines) finding(s) in Code Duplication — start with StatsPopoverViewController.swift, SyncCrypto.cs, StatsManager.swift. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
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 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with SettingsWindow.xaml.cs, App.xaml.cs, AppStats.cs. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Cycles found: 0.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ 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, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 51 tests. Measured on the C# suite only — at least 9 test source file(s) (.ts, .swift) went unread, so its test quality is unmeasured and is not in these counts.
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 142 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 8 direct `PackageReference`(s), and 134 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package 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.
No churn × complexity hotspots in the window. Repeated repair below the complexity floor: KeyStats.Windows/KeyStats/Views/FloatingStatsWindow.xaml.cs (3 of 3 changes were fixes)
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with FloatingStatsWindow.xaml.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_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.
15 deducted debt markers + 7 dead symbols across 17737 LoC in the .NET projects (0.8/KLoC) → score 8.3. Measured on the .NET source only: .swift (46% of production source) was not read, and carries at least 0 uncounted task marker(s) in 0 file(s).
Dead code: GetActiveProcessName · ×7KeyStats.Windows/KeyStats/Helpers/ActiveWindowManager.cs:115
What to do
Resolve the 13 EmptyCatchBlock finding(s) in Explicit Debt — start with App.xaml.cs (4), AppIconHelper.cs (2), StartupManager.cs (2). — One of this dimension's main actionable groups (13 issue-level).
Resolve the 2 WriteOnlyPrivateField finding(s) in Explicit Debt — start with KeyNameMapper.cs, SyncCoordinator.cs. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 7 Dead code finding(s) in Explicit Debt — start with NativeInterop.cs (2), ActiveWindowManager.cs, KeyNameMapper.cs. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
Resolve the 2 redundant comment finding(s) in Comment Value — start with StatsChartControl.xaml.cs, StatsPopupWindow.xaml.cs. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 2 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionREDACTED:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — 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).
20 finding(s): 0 critical, 20 high, 0 medium, 0 low. 17 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 3 file(s) — `scripts/sign_app.sh` (line 44), `services/sync-worker/src/index.ts` (line 33), `services/sync-worker/worker-configuration.d.ts` (line 13207) — 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 1 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
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 17 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 (17 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 Gemfile.lock 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 7 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d30_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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 44 of the 59 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.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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 2 platform declaration(s) and 0 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.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
`ThemeManager` keeps one instance of itself in the static `Instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_initialized, IsDarkTheme; e.g. `_initialized` at line 23). — KeyStats.Windows/KeyStats/Helpers/ThemeManager.cs:8
`InputMonitorService` keeps one instance of itself in the static `_instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_keyboardProc, _mouseProc, _lastHookCallbackTick, _isMonitoring, _watchdogTimer, _keyboardHookId; e.g. `_keyboardProc` at line 59). — KeyStats.Windows/KeyStats/Services/InputMonitorService.cs:11
`StatsManager` keeps one instance of itself in the static `_instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_displayStatsAggregator, _isSyncEnabledProvider, _isImportBlockedProvider, _lastNotifiedKeyPresses, _lastNotifiedClicks; e.g. `_displayStatsAggregator` at line 585). — KeyStats.Windows/KeyStats/Services/StatsManager.cs:14
`NotificationService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_instance; e.g. `_instance` at line 9). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — KeyStats.Windows/KeyStats/Services/NotificationService.cs:6
`StartupManager` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_instance; e.g. `_instance` at line 11). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — KeyStats.Windows/KeyStats/Services/StartupManager.cs:8
What to do
Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
A `static` field is one slot for the whole process, however its type is created: back it with a thread-safe type (ConcurrentDictionary, Interlocked), take a lock around every write, or move it into a registered singleton that does.
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.
The namespaces KeyStats.ViewModels ↔ KeyStats.Views ↔ KeyStats.Views.Controls depend on each other. The lightest dependency in the cycle is KeyStats.ViewModels → KeyStats.Views (KeyStats.ViewModels.TrayIconViewModel → KeyStats.Views.StatsPopupWindow, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:11
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
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.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
~17.7k production LoC (387 types) across 1 project(s) / 21 namespace(s) with no recognised architectural style or layering — at this size, deliberate module boundaries would help. No DDD/clean/vertical-slice/CQRS/transaction-script organisation was detected — code is likely organised ad hoc, which makes change and onboarding harder as it grows.
What to do
Introduce deliberate module boundaries — by feature (vertical slices) if your team prefers, or by layer (domain/application/infrastructure). Even splitting into a few cohesive projects with a clear dependency direction would help.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
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 · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
A placeholder string ("REPLACE_ME") is still in shipped code — typical of generated boilerplate that was never filled in. — KeyStats.Windows/KeyStats/Services/SyncServiceConfiguration.cs:51
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
1 ADR-shaped document(s) detected by content — `docs/superpowers/plans/2026-04-20-accessibility-helper-split.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
README_ZH.md links to `./README_EN.md`, but `README_EN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, 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_ZH.md:3
What to do
Reconcile the README with reality: README_ZH.md links to `./README_EN.md`, but `README_EN.md` does not exist.
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 6 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. — REDACTED:4
`KeyStats.Windows/KeyStats.Sync.Tests/KeyStats.Sync.Tests.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — KeyStats.Windows/KeyStats.Sync.Tests/KeyStats.Sync.Tests.csproj:14
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.
Enable Dependabot/Renovate or a dependency-review gate.
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 · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out. — KeyStats.Windows/KeyStats/Services/SyncTransport.cs:60
`new HttpClient(handler, disposeHandler: true)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out. — KeyStats.Windows/KeyStats/Services/SyncTransport.cs:60
What to do
Give every outbound call a bound the caller can rely on: set an explicit `HttpClient.Timeout` (or pass a `CancellationToken` from a `CancellationTokenSource` with a deadline) and flow the caller's own `CancellationToken` through, so a slow endpoint fails fast instead of hanging.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. 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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety8.1 / 10Strong✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
services/sync-worker/src/routes.ts:489 · services/sync-worker/src/routes.ts:528 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-worker/src/routes.ts:489
services/sync-worker/scripts/validate-contracts.mjs:193 · services/sync-worker/scripts/validate-contracts.mjs:228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — services/sync-worker/scripts/validate-contracts.mjs:193
services/sync-worker/src/routes.ts:658 · services/sync-worker/src/routes.ts:737 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-worker/src/routes.ts:658
services/sync-worker/src/routes.ts:146 · services/sync-worker/src/routes.ts:268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — services/sync-worker/src/routes.ts:146
services/sync-worker/src/auth.ts:121 · services/sync-worker/src/history.ts:205 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — services/sync-worker/src/auth.ts:121
services/sync-worker/src/validation.ts:34 · services/sync-worker/src/validation.ts:41 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — services/sync-worker/src/validation.ts:34
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
services/sync-worker/scripts/validate-contracts.mjs:14 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — services/sync-worker/scripts/validate-contracts.mjs:14
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
completePairingSession has cyclomatic complexity 40 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:257
recoverVault has cyclomatic complexity 31 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:429
route has cyclomatic complexity 29 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:23
finalizeSync has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/sync.ts:282
approvePairingSession has cyclomatic complexity 19 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:192
prepareSyncMutation has cyclomatic complexity 17 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/sync.ts:228
materializeHistoryRows has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/history.ts:212
cleanupOrphanedObjects has cyclomatic complexity 16 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/cleanup.ts:193
readJson has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/http.ts:35
joinPairingSession has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:134
authorizeVaultDeletion has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/routes.ts:720
validateRecord has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/crypto.ts:113
parseSyncRequest has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — services/sync-worker/src/sync.ts:109
Do you agree with this assessment?
R3 · Large Files3.8 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
services/sync-worker/src/routes.ts has 872 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — services/sync-worker/src/routes.ts:1
services/sync-worker/src/sync.ts has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — services/sync-worker/src/sync.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage8.2 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×2) — services/sync-worker/src/routes.ts:1, services/sync-worker/src/index.ts:1
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✗ · typecheck ✓ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add eslint as REDACTED scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code9.8 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Nothing imports this binding — it is safe to review for removal. (×5) — services/sync-worker/src/crypto.ts:77, services/sync-worker/src/history.ts:40, services/sync-worker/src/sync.ts:25, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`Entropy` is the DPAPI additional entropy and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. (×3) — KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:14, KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:12, KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:17
What to do
Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations. This repository constructs key or salt material fixed at compile time at 3 sites, not one: `KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:14` (DPAPI additional entropy, `Entropy`), `KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:12` (DPAPI additional entropy, `Entropy`), `KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:17` (DPAPI additional entropy, `Entropy`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.3 `!` suppressions per 1k syntax nodes — 31 suppression(s) across the 94342 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
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 — 3 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.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — no DI registrations detected
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. 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 — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D12 Dependency Hygiene — Dependency hygiene not measured
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution, but this repository's production source is mostly .swift, .ts, which the C#/VB workspace does not load — the projects that loaded are an immaterial minority, so solution shape was not assessed for this repository. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — small single-context codebase (17,737 production LoC in the .NET projects) — bounded contexts are not needed at this size No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 reads resolved call sites in the languages it reads only — this repository's production source is .swift, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 4 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.
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.
D8 Code Coverage — Coverage NOT MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half could not be measured — services/sync-worker/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
IC1 Incompleteness & stubs — IC1 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
X1 Async correctness — X1 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — X18 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — X2 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — X22 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — X27 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X28 Index access outside its own emptiness guard — X28 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X29 Per-element action decided by a fixed element — X29 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X3 Exception handling — X3 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — X30 reached only 47% of this repository's production lines — swift (17,444 lines), typescript (2,456 lines), javascript (321 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
EmptyCatchBlock KeyStats.Windows/KeyStats/App.xaml.cs:699— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/App.xaml.cs:715— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/App.xaml.cs:727— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/App.xaml.cs:1276— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Helpers/ActiveWindowManager.cs:186— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:91— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:143— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Helpers/ThemeManager.cs:62— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Services/StartupManager.cs:111— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Services/StartupManager.cs:123— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:175— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:553— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock KeyStats.Windows/KeyStats/Services/SyncTransport.cs:378— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
S1 · Cryptographic Hygiene· Cryptographic key material is a compile-time constant · ×3
Cryptographic key material is a compile-time constant KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:14— `Entropy` is the DPAPI additional entropy and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:12— `Entropy` is the DPAPI additional entropy and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Cryptographic key material is a compile-time constant KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:17— `Entropy` is the DPAPI additional entropy and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
WriteOnlyPrivateField KeyStats.Windows/KeyStats/Helpers/KeyNameMapper.cs:60— private HashSet<int> NavigationKeys — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:44— private string _clientVersion — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
Namespace dependency cycle KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:11— The namespaces KeyStats.ViewModels ↔ KeyStats.Views ↔ KeyStats.Views.Controls depend on each other. The lightest dependency in the cycle is KeyStats.ViewModels → KeyStats.Views (KeyStats.ViewModels.TrayIconViewModel → KeyStats.Views.StatsPopupWindow, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
FileTooLong: Services/SyncCoordinator.cs KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs— FileTooLong — 2005 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1505 over it, 4.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: KeyStats/StatsPopoverViewController.swift KeyStats/StatsPopoverViewController.swift— FileTooLong — 1670 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1170 over it, 3.34× 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: Sync/SyncCoordinator.swift KeyStats/Sync/SyncCoordinator.swift— FileTooLong — 1335 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SyncCoordinator (58-1687). The bar is 500 significant lines; this is 835 over it, 2.67× 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: KeyStats/StatsManager.swift KeyStats/StatsManager.swift— FileTooLong — 1269 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: StatsManager (83-1392). The bar is 500 significant lines; this is 769 over it, 2.54× 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: KeyStats/KeyboardHeatmapViewController.swift KeyStats/KeyboardHeatmapViewController.swift— FileTooLong — 1173 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 673 over it, 2.35× 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: Services/StatsManager.cs KeyStats.Windows/KeyStats/Services/StatsManager.cs— FileTooLong — 1166 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 666 over it, 2.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: KeyStats/AllTimeStatsViewController.swift KeyStats/AllTimeStatsViewController.swift— FileTooLong — 1127 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 627 over it, 2.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: KeyStats/SettingsViewController.swift KeyStats/SettingsViewController.swift— FileTooLong — 1086 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SettingsViewController (23-1440). The bar is 500 significant lines; this is 586 over it, 2.17× 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: KeyStats/App.xaml.cs KeyStats.Windows/KeyStats/App.xaml.cs— FileTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 276 over it, 1.55× 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: src/routes.ts services/sync-worker/src/routes.ts— FileTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 256 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: KeyStats/AppStatsViewController.swift KeyStats/AppStatsViewController.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: Sync/SyncSettingsWindowController.swift KeyStats/Sync/SyncSettingsWindowController.swift— FileTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SyncSettingsViewController (31-756). The bar is 500 significant lines; this is 98 over it, 1.20× 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: Helpers/AppIconHelper.cs KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs— FileTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 89 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: KeyStats/StatsModels.swift KeyStats/StatsModels.swift— FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Controls/StatsChartControl.xaml.cs KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs— FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18 over it, 1.04× 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.
TooManyMethods: SyncCoordinator KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs— TooManyMethods — 1981 significant lines (blank, comment-only and punctuation-only lines excluded), 105 methods. The bar is 30 methods; this is 75 over it, 3.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.
TooManyMethods: StatsManager KeyStats/StatsManager.swift:83— TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatsManager KeyStats.Windows/KeyStats/Services/StatsManager.cs— TooManyMethods — 1115 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SettingsViewController KeyStats/SettingsViewController.swift:23— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SyncCoordinator KeyStats/Sync/SyncCoordinator.swift:58— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× 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: NativeInterop KeyStats.Windows/KeyStats/Helpers/NativeInterop.cs— TooManyMethods — 201 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: StatsPopoverViewController KeyStats/StatsPopoverViewController.swift:21— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App KeyStats.Windows/KeyStats/App.xaml.cs— TooManyMethods — 675 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 30 methods; this is 15 over it, 1.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.
TooManyMethods: AppIconHelper KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs— TooManyMethods — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: SyncSettingsViewController KeyStats/Sync/SyncSettingsWindowController.swift:31— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SyncCrypto KeyStats.Windows/KeyStats/Services/SyncCrypto.cs— TooManyMethods — 294 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: KeyboardHeatmapViewController KeyStats/KeyboardHeatmapViewController.swift:36— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SettingsWindow KeyStats.Windows/KeyStats/Views/SettingsWindow.xaml.cs— TooManyMethods — 311 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatsChartView KeyStats/StatsPopoverViewController.swift:1469— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: StatsPopoverViewController.setupUI KeyStats/StatsPopoverViewController.swift:143— MethodTooLong — setupUI runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× 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: SettingsViewController.setupUI KeyStats/SettingsViewController.swift:194— MethodTooLong — setupUI runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AllTimeStatsViewController.setupUI KeyStats/AllTimeStatsViewController.swift:149— MethodTooLong — setupUI runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× 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: SyncCoordinator.finishPendingProvisioning KeyStats/Sync/SyncCoordinator.swift:370— MethodTooLong — finishPendingProvisioning runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SyncCoordinator.SyncCoreAsync KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1537— MethodTooLong — SyncCoreAsync 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: AllTimeStatsViewController.updateInsights KeyStats/AllTimeStatsViewController.swift:396— MethodTooLong — updateInsights 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: SyncCoordinator.RecoverVaultAsync KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:562— MethodTooLong — RecoverVaultAsync runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: SyncSettingsViewController.setupUI KeyStats/Sync/SyncSettingsWindowController.swift:77— MethodTooLong — setupUI runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: KeyboardHeatmapViewController.setupUI KeyStats/KeyboardHeatmapViewController.swift:144— MethodTooLong — setupUI 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: KeyboardHeatmapControl.BuildLayout KeyStats.Windows/KeyStats/Views/Controls/KeyboardHeatmapControl.cs:400— MethodTooLong — BuildLayout runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: SyncCoordinator.performSync KeyStats/Sync/SyncCoordinator.swift:976— MethodTooLong — performSync runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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.
ClassTooLong: SyncCoordinator KeyStats/Sync/SyncCoordinator.swift:58— ClassTooLong — 1290 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 890 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SettingsViewController KeyStats/SettingsViewController.swift:23— ClassTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 672 over it, 2.68× 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: StatsManager KeyStats/StatsManager.swift:83— ClassTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded), 98 methods. The bar is 400 significant lines; this is 510 over it, 2.28× 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: StatsPopoverViewController KeyStats/StatsPopoverViewController.swift:21— ClassTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 327 over it, 1.82× 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: SyncSettingsViewController KeyStats/Sync/SyncSettingsWindowController.swift:31— ClassTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 175 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatsChartView KeyStats/StatsPopoverViewController.swift:1469— ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 151 over it, 1.38× 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: AllTimeStatsViewController KeyStats/AllTimeStatsViewController.swift:35— ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 134 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatsChartControl KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 100 over it, 1.25× 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: KeyboardHeatmapViewController KeyStats/KeyboardHeatmapViewController.swift:36— ClassTooLong — 473 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 73 over it, 1.18× 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 (8 lines × 2) KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:95— KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:95-102 | KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:294-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) KeyStats/AllTimeStatsViewController.swift:1010— KeyStats/AllTimeStatsViewController.swift:1010-1017 | KeyStats/AllTimeStatsViewController.swift:1154-1161 — both copies are in the same file, so extract the 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) KeyStats/AppDelegate.swift:244— KeyStats/AppDelegate.swift:244-251 | KeyStats/SettingsViewController.swift:1432-1439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) KeyStats/HelperXPCClient.swift:50— KeyStats/HelperXPCClient.swift:50-57 | KeyStatsHelper/HelperXPCListener.swift:43-50 — 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) KeyStats/SettingsViewController.swift:579— KeyStats/SettingsViewController.swift:579-586 | KeyStats/SettingsViewController.swift:702-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/SettingsViewController.swift:579` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) KeyStats/SettingsViewController.swift:632— KeyStats/SettingsViewController.swift:632-639 | KeyStats/SettingsViewController.swift:1033-1040 — both copies are in the same file, so extract the 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) KeyStats/StatsManager.swift:363— KeyStats/StatsManager.swift:363-370 | KeyStats/StatsManager.swift:374-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) KeyStats/Sync/SyncSettingsWindowController.swift:647— KeyStats/Sync/SyncSettingsWindowController.swift:647-654 | KeyStats/Sync/SyncSettingsWindowController.swift:656-663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `KeyStats/Sync/SyncSettingsWindowController.swift:656` calls `NSTextField`, `NSLocalizedString`, `systemFont` and `KeyStats/Sync/SyncSettingsWindowController.swift:665` 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) KeyStats/StatsPopoverViewController.swift:1342— KeyStats/StatsPopoverViewController.swift:1342-1349 | KeyStats/StatsPopoverViewController.swift:1363-1370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/StatsPopoverViewController.swift:1342` 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.
Dead code: GetActiveProcessName KeyStats.Windows/KeyStats/Helpers/ActiveWindowManager.cs:115— Method GetActiveProcessName — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: IsModifierKey KeyStats.Windows/KeyStats/Helpers/KeyNameMapper.cs:208— Method IsModifierKey — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: GetKeyState KeyStats.Windows/KeyStats/Helpers/NativeInterop.cs:110— Method GetKeyState — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: LoWord KeyStats.Windows/KeyStats/Helpers/NativeInterop.cs:178— Method LoWord — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: ClearNotifications KeyStats.Windows/KeyStats/Services/NotificationService.cs:41— Method ClearNotifications — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: Sha256Base64 KeyStats.Windows/KeyStats/Services/SyncCrypto.cs:264— Method Sha256Base64 — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: OpenStats_Click KeyStats.Windows/KeyStats/Views/SettingsWindow.xaml.cs:111— Method OpenStats_Click — Roslyn's SymbolFinder walked every project the solution loads, including KeyStats, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Duplicated block (7 lines × 2) KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:62— KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:62-68 | KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:84-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) KeyStats.Windows/KeyStats/App.xaml.cs:754— KeyStats.Windows/KeyStats/App.xaml.cs:754-760 | KeyStats.Windows/KeyStats/Services/StartupManager.cs:167-173 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) KeyStats/StatsPopoverViewController.swift:184— KeyStats/StatsPopoverViewController.swift:184-190 | KeyStats/StatsPopoverViewController.swift:208-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) KeyStats/Sync/SyncCrypto.swift:326— KeyStats/Sync/SyncCrypto.swift:326-332 | KeyStats/Sync/SyncCrypto.swift:356-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) KeyStats/Sync/SyncSettingsWindowController.swift:652— KeyStats/Sync/SyncSettingsWindowController.swift:652-658 | KeyStats/Sync/SyncSettingsWindowController.swift:666-672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) KeyStats/SettingsViewController.swift:1415— KeyStats/SettingsViewController.swift:1415-1421 | KeyStats/SettingsViewController.swift:1424-1430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×5
Edited copy of a member (7 corresponding lines) KeyStats/StatsPopoverViewController.swift:2087— KeyStats/StatsPopoverViewController.swift:2087-2100 | KeyStats/StatsPopoverViewController.swift:2102-2108 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) KeyStats.Windows/KeyStats/Services/SyncCrypto.cs:203— KeyStats.Windows/KeyStats/Services/SyncCrypto.cs:203-209 | KeyStats.Windows/KeyStats/Services/SyncCrypto.cs:212-218 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) KeyStats/StatsManager.swift:1681— KeyStats/StatsManager.swift:1681-1693 | KeyStats/StatsManager.swift:1695-1701 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) KeyStats.Windows/KeyStats/Views/SyncSettingsWindow.xaml.cs:378— KeyStats.Windows/KeyStats/Views/SyncSettingsWindow.xaml.cs:378-384 | KeyStats.Windows/KeyStats/Views/SyncSettingsWindow.xaml.cs:403-409 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) KeyStats/SettingsViewController.swift:711— KeyStats/SettingsViewController.swift:711-718 | KeyStats/Sync/SyncSettingsWindowController.swift:709-715 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 2) KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs:327— KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs:327-332 | KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs:345-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs:327` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:124— KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:124-129 | KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:72-77 — 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 `KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:124` 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 (6 lines × 2) KeyStats/HelperXPCClient.swift:92— KeyStats/HelperXPCClient.swift:92-98 | KeyStats/HelperXPCClient.swift:139-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/HelperXPCClient.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 (6 lines × 2) KeyStats/SettingsViewController.swift:1241— KeyStats/SettingsViewController.swift:1241-1246 | KeyStats/SettingsViewController.swift:1273-1278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/SettingsViewController.swift:1241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) KeyStats/HourlyStatsViewController.swift:392— KeyStats/HourlyStatsViewController.swift:392-397 | KeyStats/KeyboardHeatmapViewController.swift:653-658 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) KeyStats/AllTimeStatsViewController.swift:24— KeyStats/AllTimeStatsViewController.swift:24-33 | KeyStats/KeyboardHeatmapViewController.swift:25-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) KeyStats/AllTimeStatsViewController.swift:522— KeyStats/AllTimeStatsViewController.swift:522-531 | KeyStats/AllTimeStatsViewController.swift:535-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) KeyStats/AllTimeStatsViewController.swift:835— KeyStats/AllTimeStatsViewController.swift:835-844 | KeyStats/AllTimeStatsViewController.swift:1007-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) KeyStats/HourlyStatsViewController.swift:322— KeyStats/HourlyStatsViewController.swift:322-331 | KeyStats/KeyboardHeatmapViewController.swift:582-591 — 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 `KeyStats/HourlyStatsViewController.swift:322` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) KeyStats/StatsManager.swift:6— KeyStats/StatsManager.swift:6-15 | KeyStats/StatsModels.swift:56-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×4
Edited copy of a member (13 corresponding lines) KeyStats/SettingsViewController.swift:574— KeyStats/SettingsViewController.swift:574-586 | KeyStats/SettingsViewController.swift:697-709 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2301— KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2301-2313 | KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2316-2328 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:49— KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:49-71 | KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:45-57 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) KeyStats/SettingsViewController.swift:920— KeyStats/SettingsViewController.swift:920-932 | KeyStats/SettingsViewController.swift:934-947 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) KeyStats/StatsManager.swift:362— KeyStats/StatsManager.swift:362-370 | KeyStats/StatsManager.swift:373-381 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) KeyStats/StatsModels.swift:629— KeyStats/StatsModels.swift:629-637 | KeyStats/StatsModels.swift:689-697 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) KeyStats/MainWindowViewController.swift:44— KeyStats/MainWindowViewController.swift:44-52 | KeyStats/StatsPopoverViewController.swift:537-545 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) KeyStats/MouseDistanceCalibrationViewController.swift:202— KeyStats/MouseDistanceCalibrationViewController.swift:202-211 | KeyStats/StatsPopoverViewController.swift:635-643 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) KeyStats.Windows/KeyStats/Services/StatsManager.cs:770— KeyStats.Windows/KeyStats/Services/StatsManager.cs:770-774 | KeyStats.Windows/KeyStats/Services/SyncStateStore.cs:129-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats.Windows/KeyStats/Services/StatsManager.cs:770` 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) KeyStats/StatsModels.swift:631— KeyStats/StatsModels.swift:631-635 | KeyStats/StatsModels.swift:691-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) KeyStats/AllTimeStatsViewController.swift:749— KeyStats/AllTimeStatsViewController.swift:749-753 | KeyStats/StatsPopoverViewController.swift:710-714 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) KeyStats/MainWindowViewController.swift:7— KeyStats/MainWindowViewController.swift:7-11 | KeyStats/Sync/SyncSettingsWindowController.swift:57-61 — 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.
Low cohesion: SettingsWindow (LCOM4 9) KeyStats.Windows/KeyStats/Views/SettingsWindow.xaml.cs:16— SettingsWindow's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: App (LCOM4 7) KeyStats.Windows/KeyStats/App.xaml.cs:27— App'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: AppStats (LCOM4 7) KeyStats.Windows/KeyStats/Models/AppStats.cs:7— AppStats'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: MouseCalibrationWindow (LCOM4 4) KeyStats.Windows/KeyStats/Views/MouseCalibrationWindow.xaml.cs:13— MouseCalibrationWindow'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.
Stateful shared instance: ThemeManager KeyStats.Windows/KeyStats/Helpers/ThemeManager.cs:8— `ThemeManager` keeps one instance of itself in the static `Instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_initialized, IsDarkTheme; e.g. `_initialized` at line 23).
Stateful shared instance: InputMonitorService KeyStats.Windows/KeyStats/Services/InputMonitorService.cs:11— `InputMonitorService` keeps one instance of itself in the static `_instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_keyboardProc, _mouseProc, _lastHookCallbackTick, _isMonitoring, _watchdogTimer, _keyboardHookId; e.g. `_keyboardProc` at line 59).
Stateful shared instance: StatsManager KeyStats.Windows/KeyStats/Services/StatsManager.cs:14— `StatsManager` keeps one instance of itself in the static `_instance`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_displayStatsAggregator, _isSyncEnabledProvider, _isImportBlockedProvider, _lastNotifiedKeyPresses, _lastNotifiedClicks; e.g. `_displayStatsAggregator` at line 585).
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) KeyStats/StatsManager.swift:1062— KeyStats/StatsManager.swift:1062-1071 | KeyStats/StatsManager.swift:1073-1084 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) KeyStats/HoverIconButton.swift:38— KeyStats/HoverIconButton.swift:38-47 | KeyStats/StatsPopoverViewController.swift:1561-1570 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) KeyStats/StatsManager.swift:1020— KeyStats/StatsManager.swift:1020-1029 | KeyStats/StatsManager.swift:1670-1679 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×3
Edited copy of a member (4 corresponding lines) KeyStats/HourlyStats.swift:253— KeyStats/HourlyStats.swift:253-256 | KeyStats/Sync/SyncModels.swift:153-156 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) KeyStats/AllTimeStatsViewController.swift:1118— KeyStats/AllTimeStatsViewController.swift:1118-1121 | KeyStats/StatsPopoverViewController.swift:1101-1104 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) KeyStats/AllTimeStatsViewController.swift:1522— KeyStats/AllTimeStatsViewController.swift:1522-1525 | KeyStats/StatsPopoverViewController.swift:1572-1575 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 2) KeyStats/AllTimeStatsViewController.swift:180— KeyStats/AllTimeStatsViewController.swift:180-191 | KeyStats/AppStatsViewController.swift:112-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) KeyStats/AppStatsViewController.swift:571— KeyStats/AppStatsViewController.swift:571-582 | KeyStats/AppStatsViewController.swift:698-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AppStatsViewController.swift:571` 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) KeyStats/StatsManager.swift:1594— KeyStats/StatsManager.swift:1594-1605 | KeyStats/StatsManager.swift:1817-1828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/StatsManager.swift:1594` 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.
AX2 · Stateful singletons· Process-global static state · ×2
Process-global static state: NotificationService KeyStats.Windows/KeyStats/Services/NotificationService.cs:6— `NotificationService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_instance; e.g. `_instance` at line 9). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
Process-global static state: StartupManager KeyStats.Windows/KeyStats/Services/StartupManager.cs:8— `StartupManager` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_instance; e.g. `_instance` at line 11). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) KeyStats/AllTimeStatsViewController.swift:864— KeyStats/AllTimeStatsViewController.swift:864-879 | KeyStats/AllTimeStatsViewController.swift:1036-1051 | KeyStats/AllTimeStatsViewController.swift:1233-1251 | KeyStats/AllTimeStatsViewController.swift:1287-1309 — 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) KeyStats/AppStatsViewController.swift:63— KeyStats/AppStatsViewController.swift:63-192 | KeyStats/SettingsViewController.swift:526-549 | KeyStats/Sync/SyncSettingsWindowController.swift:639-694 | KeyStats/Sync/SyncSettingsWindowController.swift:727-736 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×2
Edited copy of a member (58 corresponding lines) KeyStats/StatsModels.swift:397— KeyStats/StatsModels.swift:397-480 | KeyStats/Sync/SyncModels.swift:213-270 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (58 corresponding lines) KeyStats/HourlyStatsViewController.swift:333— KeyStats/HourlyStatsViewController.swift:333-390 | KeyStats/KeyboardHeatmapViewController.swift:593-651 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) KeyStats/AllTimeStatsViewController.swift:834— KeyStats/AllTimeStatsViewController.swift:834-848 | KeyStats/AllTimeStatsViewController.swift:1006-1024 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) KeyStats/StatsModels.swift:500— KeyStats/StatsModels.swift:500-514 | KeyStats/StatsModels.swift:516-530 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:168— KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:168-199 | KeyStats.Windows/KeyStats/Services/SyncStateStore.cs:30-65 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) KeyStats.Windows/KeyStats/Services/StatsManager.cs:429— KeyStats.Windows/KeyStats/Services/StatsManager.cs:429-460 | KeyStats.Windows/KeyStats/Services/StatsManager.cs:463-494 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×2
Edited copies of one member (4 members, 16+ corresponding lines) KeyStats/AllTimeStatsWindowController.swift:6— KeyStats/AllTimeStatsWindowController.swift:6-23 | KeyStats/AppStatsWindowController.swift:6-23 | KeyStats/KeyboardHeatmapWindowController.swift:6-25 | KeyStats/SettingsWindowController.swift:6-21 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2586— KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2586-2601 | KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2644-2660 | KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2663-2678 | KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2683-2699 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) KeyStats/Sync/SyncModels.swift:54— KeyStats/Sync/SyncModels.swift:54-72 | KeyStats/Sync/SyncModels.swift:283-301 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) KeyStats/MenuBarController.swift:411— KeyStats/MenuBarController.swift:411-430 | KeyStats/StatsPopoverViewController.swift:1244-1262 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×2
Edited copy of a member (12 corresponding lines) KeyStats/SettingsViewController.swift:949— KeyStats/SettingsViewController.swift:949-960 | KeyStats/SettingsViewController.swift:962-974 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) KeyStats/StatsManager.swift:608— KeyStats/StatsManager.swift:608-619 | KeyStats/StatsManager.swift:623-634 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (21 lines × 2) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:701— KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:701-721 | KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1167-1187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:701` 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 (21 lines × 2) KeyStats.Windows/KeyStats/App.xaml.cs:1001— KeyStats.Windows/KeyStats/App.xaml.cs:1001-1021 | KeyStats.Windows/KeyStats/App.xaml.cs:1031-1051 — both copies are in the same file, so extract the 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 (23 lines × 2) KeyStats.Windows/KeyStats/App.xaml.cs:710— KeyStats.Windows/KeyStats/App.xaml.cs:710-732 | KeyStats.Windows/KeyStats/Services/StartupManager.cs:106-128 — 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 `KeyStats.Windows/KeyStats/App.xaml.cs:710` 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 (23 lines × 2) KeyStats/AllTimeStatsViewController.swift:106— KeyStats/AllTimeStatsViewController.swift:106-128 | KeyStats/SettingsViewController.swift:128-150 — 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 (11 lines × 2) KeyStats.Windows/KeyStats/Helpers/HeatmapPalette.cs:172— KeyStats.Windows/KeyStats/Helpers/HeatmapPalette.cs:172-182 | KeyStats.Windows/KeyStats/Views/Controls/KeyboardHeatmapControl.cs:354-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) KeyStats/AppStatsViewController.swift:555— KeyStats/AppStatsViewController.swift:555-565 | KeyStats/AppStatsViewController.swift:676-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 5) KeyStats/AllTimeStatsViewController.swift:92— KeyStats/AllTimeStatsViewController.swift:92-98 | KeyStats/AppStatsViewController.swift:30-36 | KeyStats/KeyboardHeatmapViewController.swift:105-111 | KeyStats/MouseDistanceCalibrationViewController.swift:32-38 | KeyStats/SettingsViewController.swift:114-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AllTimeStatsViewController.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 (7 lines × 5) KeyStats/AllTimeStatsViewController.swift:16— KeyStats/AllTimeStatsViewController.swift:16-22 | KeyStats/KeyboardHeatmapViewController.swift:12-18 | KeyStats/MouseDistanceCalibrationViewController.swift:11-17 | KeyStats/SettingsViewController.swift:15-21 | KeyStats/StatsPopoverViewController.swift:12-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Outbound HTTP without resilience KeyStats.Windows/KeyStats/Services/SyncTransport.cs:60— `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
Outbound HTTP without resilience KeyStats.Windows/KeyStats/Services/SyncTransport.cs:60— `new HttpClient(handler, disposeHandler: true)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
Duplicated block (6 lines × 2 locations) services/sync-worker/src/auth.ts:121— services/sync-worker/src/auth.ts:121 · services/sync-worker/src/history.ts:205 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (6 lines × 2 locations) services/sync-worker/src/validation.ts:34— services/sync-worker/src/validation.ts:34 · services/sync-worker/src/validation.ts:41 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R4 · Test Coverage· No test reaches this file · ×2
No test reaches this file services/sync-worker/src/routes.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file services/sync-worker/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Appears unstructured (no recognised architecture) — ~17.7k production LoC (387 types) across 1 project(s) / 21 namespace(s) with no recognised architectural style or layering — at this size, deliberate module boundaries would help. No DDD/clean/vertical-slice/CQRS/transaction-script organisation was detected — code is likely organised ad hoc, which makes change and onboarding harder as it grows.
StatsManager.NormalizeKeyboardHeatmapKey (cyclomatic 87) KeyStats.Windows/KeyStats/Services/StatsManager.cs:1581— StatsManager.NormalizeKeyboardHeatmapKey has cyclomatic complexity 87 (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.
SyncCoordinator.SyncCoreAsync (cyclomatic 42) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1537— SyncCoordinator.SyncCoreAsync 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.
SyncCoordinator.SyncCoordinator.ctor (cyclomatic 39) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:82— SyncCoordinator.SyncCoordinator.ctor has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
routes.completePairingSession (cyclomatic 38) services/sync-worker/src/routes.ts:257— routes.completePairingSession has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SyncCoordinator.finishPendingProvisioning (cyclomatic 34) KeyStats/Sync/SyncCoordinator.swift:370— SyncCoordinator.finishPendingProvisioning 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.
SyncPendingSecretsStore.Validate (cyclomatic 33) KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:94— SyncPendingSecretsStore.Validate 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.
SyncCoordinator.performSync (cyclomatic 31) KeyStats/Sync/SyncCoordinator.swift:976— SyncCoordinator.performSync 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.
routes.route (cyclomatic 29) services/sync-worker/src/routes.ts:23— routes.route has cyclomatic complexity 29 (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.
routes.recoverVault (cyclomatic 29) services/sync-worker/src/routes.ts:429— routes.recoverVault 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.
RemoteEventProcessor.receiveEvent (cyclomatic 28) KeyStats/RemoteEventProcessor.swift:16— RemoteEventProcessor.receiveEvent 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.
CloudflareSyncTransport.ReadSafeErrorDetails (cyclomatic 26) KeyStats.Windows/KeyStats/Services/SyncTransport.cs:316— CloudflareSyncTransport.ReadSafeErrorDetails 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.
KeyNameMapper.GetBaseKeyName (cyclomatic 24) KeyStats.Windows/KeyStats/Helpers/KeyNameMapper.cs:83— KeyNameMapper.GetBaseKeyName has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SyncCoordinator.RecoverVaultAsync (cyclomatic 24) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:562— SyncCoordinator.RecoverVaultAsync 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.
StatsModels.swift.keyboardEventModifierNames (cyclomatic 23) KeyStats/StatsModels.swift:217— StatsModels.swift.keyboardEventModifierNames has cyclomatic complexity 23 (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. This is NOT this file's highest cyclomatic complexity: StatsModels.swift.normalizedKeyboardHeatmapDisplayKey (cyclomatic 36) 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.
SyncCoordinator.ValidateCoreSnapshot (cyclomatic 22) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:2361— SyncCoordinator.ValidateCoreSnapshot has cyclomatic complexity 22 (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. This is NOT this file's highest cyclomatic complexity: SyncCoordinator.GetStatus (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
SyncCoordinator.PrepareSync (cyclomatic 21) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1755— SyncCoordinator.PrepareSync has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal 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: SyncCoordinator.GetStatus (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
StatsPopupWindow.PositionNearTray (cyclomatic 20) KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:360— StatsPopupWindow.PositionNearTray 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.
SyncSettingsViewController.refreshStatusOnly (cyclomatic 18) KeyStats/Sync/SyncSettingsWindowController.swift:224— SyncSettingsViewController.refreshStatusOnly has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
routes.approvePairingSession (cyclomatic 18) services/sync-worker/src/routes.ts:192— routes.approvePairingSession 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.
SyncCoordinator.Start (cyclomatic 17) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:213— SyncCoordinator.Start 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: SyncCoordinator.GetStatus (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
SyncSettingsWindow.RefreshStatus (cyclomatic 17) KeyStats.Windows/KeyStats/Views/SyncSettingsWindow.xaml.cs:53— SyncSettingsWindow.RefreshStatus 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.
HourlyStats.validate (cyclomatic 17) KeyStats/HourlyStats.swift:102— HourlyStats.validate 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.
CoreDaySnapshotV1.validated (cyclomatic 17) KeyStats/Sync/SyncModels.swift:74— CoreDaySnapshotV1.validated has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: SyncKeyCanonicalizer.canonicalPart (cyclomatic 44) 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.
CloudflareSyncTransport.send (cyclomatic 17) KeyStats/Sync/SyncTransport.swift:263— CloudflareSyncTransport.send has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sync.prepareSyncMutation (cyclomatic 17) services/sync-worker/src/sync.ts:228— sync.prepareSyncMutation 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.
SyncCoordinator.scheduleIfNeeded (cyclomatic 16) KeyStats/Sync/SyncCoordinator.swift:1325— SyncCoordinator.scheduleIfNeeded 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.
cleanup.cleanupOrphanedObjects (cyclomatic 16) services/sync-worker/src/cleanup.ts:193— cleanup.cleanupOrphanedObjects 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.
history.materializeHistoryRows (cyclomatic 16) services/sync-worker/src/history.ts:212— history.materializeHistoryRows 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.
Repeated repair: KeyStats.Windows/KeyStats/Views/FloatingStatsWindow.xaml.cs KeyStats.Windows/KeyStats/Views/FloatingStatsWindow.xaml.cs:225— KeyStats.Windows/KeyStats/Views/FloatingStatsWindow.xaml.cs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is FloatingStatsWindow.ApplyLayoutSettings at line 225), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): center floating stats and size cells to content”; “fix(windows): widen floating stats window instead of truncating values (#147)”; “fix: hide floating stats from window switcher”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 16:30:56 +08:00' --until='2026-11-09 16:30:56 +08:00' --full-history --no-merges -- KeyStats.Windows/KeyStats/Views/FloatingStatsWindow.xaml.cs`: 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.
SyncCoordinator.performSync (cognitive 52) KeyStats/Sync/SyncCoordinator.swift:976— SyncCoordinator.performSync has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 5 (13 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncCoordinator.finishPendingProvisioning (cognitive 50) KeyStats/Sync/SyncCoordinator.swift:370— SyncCoordinator.finishPendingProvisioning has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 13, error handling 2 (4 pts), ternaries 4, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncCoordinator.SyncCoreAsync (cognitive 49) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1537— SyncCoordinator.SyncCoreAsync has cognitive complexity 49 (threshold 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.
SyncCoordinator.SyncCoordinator.ctor (cognitive 47) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:82— SyncCoordinator.SyncCoordinator.ctor has cognitive complexity 47 (threshold 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.
routes.recoverVault (cognitive 41) services/sync-worker/src/routes.ts:429— routes.recoverVault has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 6, error handling 2 (3 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routes.completePairingSession (cognitive 40) services/sync-worker/src/routes.ts:257— routes.completePairingSession has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 13, error handling 1, ternaries 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.
RemoteEventProcessor.receiveEvent (cognitive 37) KeyStats/RemoteEventProcessor.swift:16— RemoteEventProcessor.receiveEvent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sync.prepareSyncMutation (cognitive 33) services/sync-worker/src/sync.ts:228— sync.prepareSyncMutation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4 (nesting depth added 17). 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.
HourlyStats.countsAligned (cognitive 32) KeyStats/HourlyStats.swift:179— HourlyStats.countsAligned has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (8 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routes.route (cognitive 28) services/sync-worker/src/routes.ts:23— routes.route has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 13. 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.
StatsManager.AggregateKeyboardHeatmapCounts (cognitive 24) KeyStats.Windows/KeyStats/Services/StatsManager.cs:1532— StatsManager.AggregateKeyboardHeatmapCounts has cognitive complexity 24 (threshold 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.
cleanup.deleteTombstonedVaults (cognitive 24) services/sync-worker/src/cleanup.ts:236— cleanup.deleteTombstonedVaults has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
history.materializeHistoryRows (cognitive 24) services/sync-worker/src/history.ts:212— history.materializeHistoryRows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, 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.
AppIconHelper.BuildSteamExecutableIndex (cognitive 23) KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:437— AppIconHelper.BuildSteamExecutableIndex has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal 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.
SyncCoordinator.RecoverVaultAsync (cognitive 23) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:562— SyncCoordinator.RecoverVaultAsync has cognitive complexity 23 (threshold 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.
SyncCoordinator.reconcileAcceptedRecords (cognitive 23) KeyStats/Sync/SyncCoordinator.swift:553— SyncCoordinator.reconcileAcceptedRecords has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncSettingsViewController.refreshStatusOnly (cognitive 23) KeyStats/Sync/SyncSettingsWindowController.swift:224— SyncSettingsViewController.refreshStatusOnly has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6 (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.
SyncCoordinator.ApplyHistoryChanges (cognitive 22) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1879— SyncCoordinator.ApplyHistoryChanges has cognitive complexity 22 (threshold 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.
SyncPendingSecretsStore.Validate (cognitive 22) KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:94— SyncPendingSecretsStore.Validate has cognitive complexity 22 (threshold 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.
CloudflareSyncTransport.ReadSafeErrorDetails (cognitive 22) KeyStats.Windows/KeyStats/Services/SyncTransport.cs:316— CloudflareSyncTransport.ReadSafeErrorDetails has cognitive complexity 22 (threshold 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.
StatsPopupWindow.PositionNearTray (cognitive 22) KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:360— StatsPopupWindow.PositionNearTray has cognitive complexity 22 (threshold 15). 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.
StatsModels.swift.keyboardEventModifierNames (cognitive 22) KeyStats/StatsModels.swift:217— StatsModels.swift.keyboardEventModifierNames has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 11. 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.
RemoteShardCache.Apply (cognitive 21) KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:34— RemoteShardCache.Apply has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal 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.
StatsManager.NormalizeKeyboardHeatmapKey (cognitive 21) KeyStats.Windows/KeyStats/Services/StatsManager.cs:1581— StatsManager.NormalizeKeyboardHeatmapKey has cognitive complexity 21 (threshold 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.
SyncCoordinator.PrepareSync (cognitive 21) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:1755— SyncCoordinator.PrepareSync has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal 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.
SyncCoordinator.scheduleIfNeeded (cognitive 21) KeyStats/Sync/SyncCoordinator.swift:1325— SyncCoordinator.scheduleIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cleanup.cleanupOrphanedObjects (cognitive 21) services/sync-worker/src/cleanup.ts:193— cleanup.cleanupOrphanedObjects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncCoordinator.Start (cognitive 20) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:213— SyncCoordinator.Start has cognitive complexity 20 (threshold 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.
StatsModels.swift.standaloneModifierKeyName (cognitive 19) KeyStats/StatsModels.swift:173— StatsModels.swift.standaloneModifierKeyName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (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.
SettingsWindow.RefreshSyncStatus (cognitive 18) KeyStats.Windows/KeyStats/Views/SettingsWindow.xaml.cs:134— SettingsWindow.RefreshSyncStatus has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
HourlyStats.points (cognitive 18) KeyStats/HourlyStats.swift:43— HourlyStats.points has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HourlyStats.validate (cognitive 18) KeyStats/HourlyStats.swift:102— HourlyStats.validate has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (5 pts), loops 1 (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.
HeatmapPalette.color (cognitive 18) KeyStats/KeyboardHeatmapViewController.swift:1438— HeatmapPalette.color has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 2 (3 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SyncCoordinator.scheduleApproverPairingRefresh (cognitive 18) KeyStats/Sync/SyncCoordinator.swift:1540— SyncCoordinator.scheduleApproverPairingRefresh has cognitive complexity 18 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreDaySnapshotV1.validated (cognitive 18) KeyStats/Sync/SyncModels.swift:74— CoreDaySnapshotV1.validated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, 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.
StatsManager.ImportStatsData (cognitive 17) KeyStats.Windows/KeyStats/Services/StatsManager.cs:849— StatsManager.ImportStatsData has cognitive complexity 17 (threshold 15). 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.
AllTimeStatsViewController.checkVisibleAnimations (cognitive 17) KeyStats/AllTimeStatsViewController.swift:665— AllTimeStatsViewController.checkVisibleAnimations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, boolean chains 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.
StatsPopoverViewController.historyControlsChanged (cognitive 17) KeyStats/StatsPopoverViewController.swift:774— StatsPopoverViewController.historyControlsChanged has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 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.
sync.finalizeSync (cognitive 17) services/sync-worker/src/sync.ts:282— sync.finalizeSync has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 4 (6 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SyncCoordinator.RefreshStateAsync (cognitive 16) KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:290— SyncCoordinator.RefreshStateAsync has cognitive complexity 16 (threshold 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.
MenuBarStatusSwiftUIView.body (cognitive 16) KeyStats/MenuBarController.swift:265— MenuBarStatusSwiftUIView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 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.
SyncCoordinator.prepareRecords (cognitive 16) KeyStats/Sync/SyncCoordinator.swift:1112— SyncCoordinator.prepareRecords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
CloudflareSyncTransport.send (cognitive 16) KeyStats/Sync/SyncTransport.swift:263— CloudflareSyncTransport.send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 1, loops 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.
FunctionTooLong: routes.completePairingSession services/sync-worker/src/routes.ts:257— FunctionTooLong — completePairingSession runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) KeyStats/AllTimeStatsViewController.swift:92— KeyStats/AllTimeStatsViewController.swift:92-100 | KeyStats/AppStatsViewController.swift:30-38 | KeyStats/KeyboardHeatmapViewController.swift:105-113 | KeyStats/MouseDistanceCalibrationViewController.swift:32-40 | KeyStats/SettingsViewController.swift:114-122 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) KeyStats/StatsManager.swift:17— KeyStats/StatsManager.swift:17-52 | KeyStats/StatsModels.swift:67-100 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) KeyStats/StatsManager.swift:1578— KeyStats/StatsManager.swift:1578-1605 | KeyStats/StatsManager.swift:1801-1828 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×1
Edited copies of one member (3 members, 23+ corresponding lines) KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:122— KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:122-148 | KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs:70-92 | KeyStats.Windows/KeyStats/Services/SyncStateStore.cs:145-174 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:166— KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:166-200 | KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:203-235 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) KeyStats/HourlyStatsViewController.swift:314— KeyStats/HourlyStatsViewController.swift:314-331 | KeyStats/KeyboardHeatmapViewController.swift:574-591 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) KeyStats/MenuBarController.swift:337— KeyStats/MenuBarController.swift:337-353 | KeyStats/StatsPopoverViewController.swift:1042-1060 | KeyStats/StatsPopoverViewController.swift:1074-1090 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) KeyStats.Windows/KeyStats/App.xaml.cs:706— KeyStats.Windows/KeyStats/App.xaml.cs:706-732 | KeyStats.Windows/KeyStats/Services/StartupManager.cs:102-128 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) KeyStats/SettingsViewController.swift:1414— KeyStats/SettingsViewController.swift:1414-1421 | KeyStats/SettingsViewController.swift:1423-1430 | KeyStats/Sync/SyncSettingsWindowController.swift:548-556 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) KeyStats/HourlyStatsWindowController.swift:6— KeyStats/HourlyStatsWindowController.swift:6-16 | KeyStats/Sync/SyncSettingsWindowController.swift:6-16 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) KeyStats.Windows/KeyStats/App.xaml.cs:1000— KeyStats.Windows/KeyStats/App.xaml.cs:1000-1024 | KeyStats.Windows/KeyStats/App.xaml.cs:1030-1054 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) KeyStats.Windows/KeyStats/Services/StatsManager.cs:349— KeyStats.Windows/KeyStats/Services/StatsManager.cs:349-365 | KeyStats.Windows/KeyStats/Services/StatsManager.cs:368-384 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) KeyStats.Windows/KeyStats/Views/ConfirmDialog.xaml.cs:22— KeyStats.Windows/KeyStats/Views/ConfirmDialog.xaml.cs:22-44 | KeyStats.Windows/KeyStats/Views/ImportModeDialog.xaml.cs:13-35 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) KeyStats/Sync/SyncModels.swift:158— KeyStats/Sync/SyncModels.swift:158-165 | KeyStats/Sync/SyncModels.swift:181-185 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) KeyStats/Sync/SyncCoordinator.swift:907— KeyStats/Sync/SyncCoordinator.swift:907-929 | KeyStats/Sync/SyncCoordinator.swift:953-972 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) KeyStats/StatsManager.swift:407— KeyStats/StatsManager.swift:407-423 | KeyStats/StatsManager.swift:425-441 | KeyStats/StatsManager.swift:443-459 | KeyStats/StatsManager.swift:461-477 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) KeyStats/AppStatsWindowController.swift:29— KeyStats/AppStatsWindowController.swift:29-39 | KeyStats/SettingsWindowController.swift:27-33 | KeyStats/Sync/SyncSettingsWindowController.swift:22-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) KeyStats/AllTimeStatsViewController.swift:11— KeyStats/AllTimeStatsViewController.swift:11-14 | KeyStats/AppStatsViewController.swift:763-766 | KeyStats/KeyboardHeatmapViewController.swift:20-23 | KeyStats/SettingsViewController.swift:10-13 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) KeyStats.Windows/KeyStats/App.xaml.cs:753— KeyStats.Windows/KeyStats/App.xaml.cs:753-760 | KeyStats.Windows/KeyStats/Services/StartupManager.cs:166-173 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) KeyStats.Windows/KeyStats/ViewModels/StatsPopupViewModel.cs:361— KeyStats.Windows/KeyStats/ViewModels/StatsPopupViewModel.cs:361-366 | KeyStats.Windows/KeyStats/ViewModels/TrayIconViewModel.cs:238-243 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) KeyStats.Windows/KeyStats/Views/ConfirmDialog.xaml.cs:23— KeyStats.Windows/KeyStats/Views/ConfirmDialog.xaml.cs:23-39 | KeyStats.Windows/KeyStats/Views/ImportModeDialog.xaml.cs:14-30 — 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 `KeyStats.Windows/KeyStats/Views/ConfirmDialog.xaml.cs:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:304— KeyStats.Windows/KeyStats/Services/RemoteShardCache.cs:304-312 | KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:152-160 | KeyStats.Windows/KeyStats/Services/SyncStateStore.cs:200-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (56 lines × 2) KeyStats/HourlyStatsChartView.swift:209— KeyStats/HourlyStatsChartView.swift:209-264 | KeyStats/StatsPopoverViewController.swift:1789-1844 — 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 (25 lines × 2) KeyStats/SettingsViewController.swift:644— KeyStats/SettingsViewController.swift:644-668 | KeyStats/StatsPopoverViewController.swift:559-583 — 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 (19 lines × 2) KeyStats/HourlyStatsViewController.swift:352— KeyStats/HourlyStatsViewController.swift:352-370 | KeyStats/KeyboardHeatmapViewController.swift:612-630 — 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 (18 lines × 3) KeyStats/StatsManager.swift:35— KeyStats/StatsManager.swift:35-52 | KeyStats/StatsModels.swift:83-100 | KeyStats/StatsModels.swift:365-382 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/StatsManager.swift:35` 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) KeyStats/HourlyStatsViewController.swift:373— KeyStats/HourlyStatsViewController.swift:373-390 | KeyStats/KeyboardHeatmapViewController.swift:634-651 — 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 `KeyStats/HourlyStatsViewController.swift:373` 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 (16 lines × 2) KeyStats/AllTimeStatsWindowController.swift:8— KeyStats/AllTimeStatsWindowController.swift:8-23 | KeyStats/AppStatsWindowController.swift:8-23 — 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 `KeyStats/AllTimeStatsWindowController.swift:8` 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 (14–16 lines × 2) KeyStats/StatsManager.swift:18— KeyStats/StatsManager.swift:18-33 | KeyStats/StatsModels.swift:68-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–15 lines × 4) KeyStats/AllTimeStatsViewController.swift:865— KeyStats/AllTimeStatsViewController.swift:865-877 | KeyStats/AllTimeStatsViewController.swift:1037-1049 | KeyStats/AllTimeStatsViewController.swift:1234-1246 | KeyStats/AllTimeStatsViewController.swift:1288-1302 — 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 `KeyStats/AllTimeStatsViewController.swift:865` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `KeyStats/AllTimeStatsViewController.swift:1249` calls `animateIn` and `KeyStats/AllTimeStatsViewController.swift:878` 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 (14–15 lines × 2) KeyStats/AllTimeStatsViewController.swift:894— KeyStats/AllTimeStatsViewController.swift:894-908 | KeyStats/AllTimeStatsViewController.swift:1079-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AllTimeStatsViewController.swift:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) KeyStats/AllTimeStatsViewController.swift:437— KeyStats/AllTimeStatsViewController.swift:437-450 | KeyStats/AllTimeStatsViewController.swift:547-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AllTimeStatsViewController.swift:437` 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–13 lines × 2) KeyStats/StatsModels.swift:450— KeyStats/StatsModels.swift:450-462 | KeyStats/Sync/SyncModels.swift:247-252 — 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 `KeyStats/Sync/SyncModels.swift:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) KeyStats/StatsModels.swift:502— KeyStats/StatsModels.swift:502-514 | KeyStats/StatsModels.swift:518-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/StatsModels.swift:502` 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 (10–11 lines × 2) KeyStats/AllTimeStatsViewController.swift:883— KeyStats/AllTimeStatsViewController.swift:883-893 | KeyStats/AllTimeStatsViewController.swift:1066-1075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AllTimeStatsViewController.swift:883` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) KeyStats/AllTimeStatsViewController.swift:102— KeyStats/AllTimeStatsViewController.swift:102-111 | KeyStats/AppStatsViewController.swift:40-49 | KeyStats/KeyboardHeatmapViewController.swift:115-125 — 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 `KeyStats/AllTimeStatsViewController.swift:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) KeyStats/AllTimeStatsWindowController.swift:10— KeyStats/AllTimeStatsWindowController.swift:10-17 | KeyStats/AppStatsWindowController.swift:10-17 | KeyStats/SettingsWindowController.swift:10-17 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `KeyStats/AllTimeStatsWindowController.swift:18` calls `NSSize` and `KeyStats/SettingsWindowController.swift:18` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) KeyStats/AllTimeStatsViewController.swift:1570— KeyStats/AllTimeStatsViewController.swift:1570-1576 | KeyStats/StatsPopoverViewController.swift:1600-1605 — 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 `KeyStats/AllTimeStatsViewController.swift:1570` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 4) KeyStats/AppStatsViewController.swift:145— KeyStats/AppStatsViewController.swift:145-150 | KeyStats/SettingsViewController.swift:532-537 | KeyStats/Sync/SyncSettingsWindowController.swift:678-681 | KeyStats/Sync/SyncSettingsWindowController.swift:728-732 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `KeyStats/AppStatsViewController.swift:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `KeyStats/AppStatsViewController.swift:150` calls `constraint` and `KeyStats/Sync/SyncSettingsWindowController.swift:681` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 6) KeyStats/AllTimeStatsViewController.swift:3— KeyStats/AllTimeStatsViewController.swift:3-9 | KeyStats/AppStatsViewController.swift:755-761 | KeyStats/KeyboardHeatmapViewController.swift:4-10 | KeyStats/MouseDistanceCalibrationViewController.swift:3-9 | KeyStats/SettingsViewController.swift:2-8 | KeyStats/StatsPopoverViewController.swift:4-10 — 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 6 call sites, so a change lands once.
Coverage not measured — .NET and JavaScript/TypeScript suite — Coverage NOT MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half could not be measured — services/sync-worker/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
Duplicated block (13 lines × 2 locations) services/sync-worker/src/routes.ts:489— services/sync-worker/src/routes.ts:489 · services/sync-worker/src/routes.ts:528 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) services/sync-worker/scripts/validate-contracts.mjs:193— services/sync-worker/scripts/validate-contracts.mjs:193 · services/sync-worker/scripts/validate-contracts.mjs:228 — both copies are in the same file, so extract the 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 locations) services/sync-worker/src/routes.ts:658— services/sync-worker/src/routes.ts:658 · services/sync-worker/src/routes.ts:737 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) services/sync-worker/src/routes.ts:146— services/sync-worker/src/routes.ts:146 · services/sync-worker/src/routes.ts:268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Boundary violation [package:third-party-deep-import] services/sync-worker/scripts/validate-contracts.mjs:14— services/sync-worker/scripts/validate-contracts.mjs:14 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Complex function completePairingSession (cyclomatic 40, cognitive 42) services/sync-worker/src/routes.ts:257— completePairingSession has cyclomatic complexity 40 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function recoverVault (cyclomatic 31, cognitive 44) services/sync-worker/src/routes.ts:429— recoverVault has cyclomatic complexity 31 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function route (cyclomatic 29, cognitive 28) services/sync-worker/src/routes.ts:23— route has cyclomatic complexity 29 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function finalizeSync (cyclomatic 26, cognitive 27) services/sync-worker/src/sync.ts:282— finalizeSync has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function approvePairingSession (cyclomatic 19, cognitive 13) services/sync-worker/src/routes.ts:192— approvePairingSession has cyclomatic complexity 19 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function prepareSyncMutation (cyclomatic 17, cognitive 33) services/sync-worker/src/sync.ts:228— prepareSyncMutation has cyclomatic complexity 17 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function materializeHistoryRows (cyclomatic 16, cognitive 25) services/sync-worker/src/history.ts:212— materializeHistoryRows has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function cleanupOrphanedObjects (cyclomatic 16, cognitive 22) services/sync-worker/src/cleanup.ts:193— cleanupOrphanedObjects has cyclomatic complexity 16 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function readJson (cyclomatic 16, cognitive 20) services/sync-worker/src/http.ts:35— readJson has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function joinPairingSession (cyclomatic 16, cognitive 14) services/sync-worker/src/routes.ts:134— joinPairingSession has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function authorizeVaultDeletion (cyclomatic 13, cognitive 15) services/sync-worker/src/routes.ts:720— authorizeVaultDeletion has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateRecord (cyclomatic 13, cognitive 12) services/sync-worker/src/crypto.ts:113— validateRecord has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseSyncRequest (cyclomatic 11, cognitive 10) services/sync-worker/src/sync.ts:109— parseSyncRequest has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· services/sync-worker/src/routes.ts · ×1
services/sync-worker/src/routes.ts: 872 lines of code services/sync-worker/src/routes.ts:1— services/sync-worker/src/routes.ts has 872 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· services/sync-worker/src/sync.ts · ×1
services/sync-worker/src/sync.ts: 409 lines of code services/sync-worker/src/sync.ts:1— services/sync-worker/src/sync.ts has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Duplicated predicate KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:17— `File.Exists(_path) || File.Exists(_path + ".bak")` appears character-identically in 2 files — KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs, KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs. 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 KeyStats.Windows/KeyStats/Services/StatsManager.cs:2010— `double.IsNaN(metersPerPixel) || double.IsInfinity(metersPerPixel) || metersPerPixel <= 0` appears character-identically in 2 files — KeyStats.Windows/KeyStats/Services/StatsManager.cs, KeyStats.Windows/KeyStats/Views/MouseCalibrationWindow.xaml.cs. 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 KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs:140— `ex is IOException || ex is UnauthorizedAccessException || ex is JsonException || ex is CryptographicException || ex is NotSupportedException` appears character-identically in 2 files — KeyStats.Windows/KeyStats/Services/SyncCredentialStore.cs, KeyStats.Windows/KeyStats/Services/SyncPendingSecretsStore.cs. 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 services/sync-worker/src/crypto.ts:59— `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 3 files — services/sync-worker/src/crypto.ts, services/sync-worker/src/history.ts, services/sync-worker/src/http.ts. 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 services/sync-worker/src/routes.ts:301— `body.encryptedDeviceProfile === undefined || body.encryptedDeviceProfile === null` appears character-identically in 2 files — services/sync-worker/src/routes.ts, services/sync-worker/src/sync.ts. 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 services/sync-worker/src/routes.ts:880— `device.profile_nonce && device.profile_ciphertext && device.profile_tag` appears character-identically in 2 files — services/sync-worker/src/routes.ts, services/sync-worker/src/sync.ts. 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 services/sync-worker/src/auth.ts:26— `token.length < 40 || token.length > 160 || token.includes("\n")` appears character-identically in 2 files — services/sync-worker/src/auth.ts, services/sync-worker/src/routes.ts. 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 KeyStats.Windows/KeyStats/App.xaml.cs:754— `string.IsNullOrWhiteSpace(left) || string.IsNullOrWhiteSpace(right)` appears character-identically in 2 files — KeyStats.Windows/KeyStats/App.xaml.cs, KeyStats.Windows/KeyStats/Services/StartupManager.cs. 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 KeyStats/AppStats.swift:51— `!container.contains(.sideBackClicks) && !container.contains(.sideForwardClicks)` appears character-identically in 2 files — KeyStats/AppStats.swift, KeyStats/StatsModels.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 KeyStats/HourlyStatsChartView.swift:231— `previousSlope == 0 || nextSlope == 0 || (previousSlope > 0) != (nextSlope > 0)` appears character-identically in 2 files — KeyStats/HourlyStatsChartView.swift, KeyStats/StatsPopoverViewController.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch KeyStats.Windows/KeyStats/App.xaml.cs:746— `GetShortcutTargetPath` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/ActiveWindowManager.cs:73— `GetActiveAppInfo` swallows every exception into `return ActiveAppInfo.Unknown;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/ActiveWindowManager.cs:106— `ResolveAppInfo` swallows every exception into `return ActiveAppInfo.Unknown;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:718— `TryReadSteamAppManifest` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:919— `ResolveShortcutProperty` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:980— `NormalizeDirectoryPath` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:1046— `ExtractIconFromFile` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Helpers/AppIconHelper.cs:1079— `ExtractIconFromFileByIndex` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Services/StartupManager.cs:27— `IsEnabled` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch KeyStats.Windows/KeyStats/Services/StatsManager.cs:790— `TryDeserialize` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
redundant comment KeyStats.Windows/KeyStats/Views/Controls/StatsChartControl.xaml.cs:226— "Draw axis labels" repeats the code it sits on: 3 of its 3 words (draw, axis, labels) are already in `DrawAxisLabels(_plotLeft, _plotTop, _plotWidth, _plotHeight, maxValue, data);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment KeyStats.Windows/KeyStats/Views/StatsPopupWindow.xaml.cs:85— "Track page view" repeats the code it sits on: 3 of its 3 words (track, page, view) are already in `App.CurrentApp?.TrackPageView("stats_popup");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D21 · Naming Consistency· `RunUiAction` returns an awaitable but lacks the `Async` suffix its 38 peers carry · ×1
`RunUiAction` returns an awaitable but lacks the `Async` suffix its 38 peers carry KeyStats.Windows/KeyStats/Views/SyncSettingsWindow.xaml.cs:427— 38 of the 39 awaitable methods of project KeyStats are named with an affix the repository binds to awaitables (38 of 39; unit: awaitable methods of project KeyStats). Peers: SyncCoordinator.RefreshStateAsync (KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:290); SyncCoordinator.CreateVaultAsync (KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:442); SyncCoordinator.RecoverVaultAsync (KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:562); SyncCoordinator.RetryRecoveryReplacingAsync (KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:814); SyncCoordinator.BeginPairingAsync (KeyStats.Windows/KeyStats/Services/SyncCoordinator.cs:861). Rename to `RunUiActionAsync`. [rule N4b]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion REDACTED:1— `KeyStats` overshoots its size bounds (17737 LoC, 128 public types across 8 namespaces). 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
GD1 · Unfinished & placeholder code· Placeholder literal left in code · ×1
Placeholder literal left in code KeyStats.Windows/KeyStats/Services/SyncServiceConfiguration.cs:51— A placeholder string ("REPLACE_ME") is still in shipped code — typical of generated boilerplate that was never filled in.
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `docs/superpowers/plans/2026-04-20-accessibility-helper-split.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
README/code drift README_ZH.md:3— README_ZH.md links to `./README_EN.md`, but `README_EN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, 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.
No SAST REDACTED:4— 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 6 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.
No dependency-update automation KeyStats.Windows/KeyStats.Sync.Tests/KeyStats.Sync.Tests.csproj:14— `KeyStats.Windows/KeyStats.Sync.Tests/KeyStats.Sync.Tests.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
Null-forgiving operator (`!`) suppressions override nullable warnings — ~0.3 `!` suppressions per 1k syntax nodes — 31 suppression(s) across the 94342 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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 4 file(s) — `KeyStats/Sync/SyncModels.swift`, `KeyStats/Sync/SyncTransport.swift`, `services/sync-worker/src/index.ts`, `services/sync-worker/worker-configuration.d.ts` — 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 01a1dcfc-c225-7637-8602-5c60acc93f78 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 46 · Warnings: 288 · Recommendations: 38 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 15-11-2026 @ 02:15 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.