Public report of shirkeharsh/mooziac, published 16 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, 16 November 2026, 21:14 UTC · Survey ID cd_da2ad7176e724060bc9b01748be2f227
shirkeharsh/mooziac
Measured 16 November 2026, 21:14 UTC, at code version 8ba5f68
Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
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,916 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.2 person-years · Weakest lens: Accessibility, 37.0
Findings by how serious they are
46 critical607 serious22 minor
32 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
16 November 2026, 21:14 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 ▸
39of 39 dimensions measured by tools.
672of 675 findings point to an exact file and line, so you can open each one in the code. The other 3 concern the repository as a whole, such as missing documentation.
39dimensions across 7 lenses, read from 37,916 lines of product code in 1 project.
shirkeharsh/mooziac falls short of our standard for production, in part because it has pages that don't say their language. It scores 48.8 out of 100 and is rated Weak, and eight of its 46 critical findings are security problems.
Accessibility, at 37.0, is the weakest lens and counts most in the score. The best first step for the work it takes is replacing the two exposed passwords or keys and switching the old ones off, worth about 5.3 points. Structuring the pages would lift Accessibility itself, worth about 5.4 points. Raising Accessibility to 70 would lift the score to about 58.2.
Five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two passwords or keys in the code and one in the code's history are open to anyone who can read the repository, and fourteen buttons or links have no name a screen reader can say. Pinning each tool to an exact version, replacing each exposed password or key and naming the buttons and links would close these risks. The nine form fields without a label need a label.
The product code is 37,916 lines, about €36,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.
If Accessibility rose from 37.0 to 70, the lowest score rated Strong, the score would rise from 48.8 to about 58.2.
Code composition: what the lines of code are
Product code 97%Tests 3%
Rebuild cost: about €36,000 · Estimate
Cost to rebuild
€12,000 to €60,000, for 199 to 631 hours of work, about 0.2 person-years for one engineer
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.7 at a score of 49. 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,916 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: 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. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).
Raises the score by about 5.3 points · Low effort · REDACTED Scanning
2
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 5.4 points · Medium effort · Page structure
3
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 5.1 points · Medium effort · Text alternatives
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €36,000 to build again, about 0.2 person-years of work. Its weakest lens is Accessibility, at 37.0 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5.3 points for low effort, because it clears the 2 REDACTED Scanning 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 4.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 10% to 22% on every change. The history of the code shows how much it changes: about 63,236 lines over the last 90 days, which is about 256,457 lines a year. At that pace, the extra work comes to an estimated 64 to 383.9 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: 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.
32 modules, with 4 dependencies between them. Every module uses only modules listed above it, so there are no loops.
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.
1 pair of types, where a type in Resources.Extensions.uBlockOriginLite.js.filter-manager-ui uses a type in Resources.Extensions.uBlockOriginLite.js.filter-editor.
Resources.Extensions.uBlockOriginLite.js.filter-manager-ui uses Resources.Extensions.uBlockOriginLite.js.filter-editor, so a change to Resources.Extensions.uBlockOriginLite.js.filter-editor can break Resources.Extensions.uBlockOriginLite.js.filter-manager-ui, while a change to Resources.Extensions.uBlockOriginLite.js.filter-manager-ui can't break Resources.Extensions.uBlockOriginLite.js.filter-editor.
Position
Below the diagonal: Resources.Extensions.uBlockOriginLite.js.filter-manager-ui uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Resources.Extensions.uBlockOriginLite.js.ro-dnr-editor uses a type in Resources.Extensions.uBlockOriginLite.js.dnr-editor.
Resources.Extensions.uBlockOriginLite.js.ro-dnr-editor uses Resources.Extensions.uBlockOriginLite.js.dnr-editor, so a change to Resources.Extensions.uBlockOriginLite.js.dnr-editor can break Resources.Extensions.uBlockOriginLite.js.ro-dnr-editor, while a change to Resources.Extensions.uBlockOriginLite.js.ro-dnr-editor can't break Resources.Extensions.uBlockOriginLite.js.dnr-editor.
Position
Below the diagonal: Resources.Extensions.uBlockOriginLite.js.ro-dnr-editor uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Resources.Extensions.uBlockOriginLite.js.rw-dnr-editor uses a type in Resources.Extensions.uBlockOriginLite.js.dnr-editor.
Resources.Extensions.uBlockOriginLite.js.rw-dnr-editor uses Resources.Extensions.uBlockOriginLite.js.dnr-editor, so a change to Resources.Extensions.uBlockOriginLite.js.dnr-editor can break Resources.Extensions.uBlockOriginLite.js.rw-dnr-editor, while a change to Resources.Extensions.uBlockOriginLite.js.rw-dnr-editor can't break Resources.Extensions.uBlockOriginLite.js.dnr-editor.
Position
Below the diagonal: Resources.Extensions.uBlockOriginLite.js.rw-dnr-editor uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in Resources.Extensions.uBlockOriginLite.web_accessible_resources.google-ima uses a type in Resources.Extensions.uBlockOriginLite.rulesets.scripting.scriptlet.main.scriptlet-begin.
Resources.Extensions.uBlockOriginLite.web_accessible_resources.google-ima uses Resources.Extensions.uBlockOriginLite.rulesets.scripting.scriptlet.main.scriptlet-begin, so a change to Resources.Extensions.uBlockOriginLite.rulesets.scripting.scriptlet.main.scriptlet-begin can break Resources.Extensions.uBlockOriginLite.web_accessible_resources.google-ima, while a change to Resources.Extensions.uBlockOriginLite.web_accessible_resources.google-ima can't break Resources.Extensions.uBlockOriginLite.rulesets.scripting.scriptlet.main.scriptlet-begin.
Position
Below the diagonal: Resources.Extensions.uBlockOriginLite.web_accessible_resources.google-ima uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 62.3 · Adequate · gated by D2, D4 ·
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
5
High / Critical
A07:2025 — Authentication Failures
4
High / Critical
Roadmap
Top priorities: Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh; Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2); Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
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 — 607
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 — 22
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 32
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 39 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 39 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 672 of 675 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
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 source is present (.swift) and this repository declares a SwiftPM test suite (Mooziac), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — 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. Not scored — 0 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
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 (2 contributor(s) across 145 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 1 hold 1% 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.
D21 Naming 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming 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. 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 — 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. 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — 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.
D26 Project Cohesion — 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. `(repository root)` (37916 LoC, 364 module-visible types across 32 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
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. `Sources/Mooziac/Managers/DownloadManager.swift`, `Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 21 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — 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. 'SQLite3' is imported (Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — 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. 'SQLite3' is imported (Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — 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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust and Java source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust or Java was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust, Dart, F# and Elixir source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust, Dart, F# or Elixir was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — 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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — 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 reads C# and Visual Basic syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin, PHP, F# and Visual Basic source only, and no C# was loaded, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — 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 reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin, PHP or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — 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 reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart, Ruby and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart, Ruby or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — 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 reads C# syntax, and Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart, Ruby and Erlang source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart, Ruby or Erlang was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — 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 reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations: 17 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
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.
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.
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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D20 ADR Quality: ADR quality 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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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").
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.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
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.
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.
66 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was NowPlayingManager.userContentController at 123. A further 2 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 GestureAction.displayName at 17 — 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: Sources/Mooziac/Models/GestureMappingModels.swift (GestureAction.displayName at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 61 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with NowPlayingManager.userContentController (cyclomatic 123), KeyboardShortcutHandler.handleKeyDown (cyclomatic 63). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 4.5 to about 5.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
+ 102 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 60 down to 60 or less in Cognitive Complexity — start with NowPlayingManager.userContentController (cognitive 166), YTMClient.parseTopTrack (cognitive 136), DynamicIslandPlayerView.updateState (cognitive 93). — 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 9 together lifts Cognitive Complexity from 2.0 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes5.9 / 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 30 MethodTooLong finding(s) in God Classes — start with PlaylistLibraryView.swift (3), ObserverBridge.swift (2), SettingsPanel+Drawers.swift (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 19 FileTooLong finding(s) in God Classes — start with SettingsPanel+Drawers.swift, LocalDatabaseManager.swift, Core.swift. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 13 ClassTooLong finding(s) in God Classes — start with PlaylistLibraryView.swift, Core.swift, PlaylistManager.swift. — One of this dimension's main actionable groups (13 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 Duplication2.6 / 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.
198 duplicated block group(s) detected. 18.4 % of the production lines (6,978 of 37,916) are in a reported copy. A further 97 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 137 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with OfflineLibraryView.swift (3), PlaylistLibraryView+ContextMenu.swift (3), PlaylistLibraryView+Cells.swift (2). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 13 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with SettingsPanel+Gestures.swift (2), YouTubeDatabaseManager.swift (2), OfflineLibraryView.swift (2). — One of this dimension's main actionable groups (13 warning-level).
Resolve the 12 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with OfflineLibraryView.swift (2), PlaylistLibraryView.swift (2), ArtworkTheme.swift (2). — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 20 Low cohesion finding(s) in Cohesion (LCOM4) — start with WebExtensionHost.swift (2), MainVideoWindowController.swift, LocalDatabaseManager.swift. — One of this dimension's main actionable groups (20 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality9.7 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 56 tests.
No assertions: testYouTubeSettingsDefaultsAndNotificationsTests/MooziacTests/YouTubeVideoTests.swift:194
What to do
Resolve the 1 No assertions finding(s) in Test Quality — start with YouTubeVideoTests.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 0 third-party package(s) use a banned license. This repository's 1 SwiftPM file(s) declare no third-party dependencies and no committed resolution pins any, so there is no third-party package licence to grade — a complete answer, not a gap in coverage. It also commits no CocoaPods or Carthage manifest, so SwiftPM is the only package manager it takes dependencies through. This repository's OWN licence is its own choice and is not judged here.
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.
Top hotspots: Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift (10×123=1230); Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift (18×49=882); Sources/Mooziac/Managers/PlaylistManager.swift (7×43=301) Repeated repair below the complexity floor: Sources/Mooziac/Views/Components/GlassSearchField.swift (3 of 5 changes were fixes); Sources/Mooziac/Managers/LikedSongsManager.swift (3 of 4 changes were fixes)
Resolve the 15 Hotspot finding(s) in Churn × Complexity Hotspots — start with ObserverBridge.swift, Core.swift, PlaylistManager.swift. — One of this dimension's main actionable groups (15 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with GlassSearchField.swift, LikedSongsManager.swift. — One of this dimension's main actionable groups (2 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.
0 deducted task-comment markers across 37916 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
✓ On the Gold path — maintain.
Detailed fixes: d17_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: 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.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Package.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
5 finding(s): 0 critical, 5 high, 0 medium, 0 low. 5 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.
REDACTED
What to do
No action in Static Analysis (SAST) — all 5 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 (5 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 87 of the 106 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Change coupling finding(s) in Change Coupling — start with PlaylistLibraryView.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.
✓ On the Gold path — maintain.
Detailed fixes: d37_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives3.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. — Resources/Extensions/uBlockOriginLite/js/i18n.js:332
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels4.3 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×7) — Resources/Extensions/uBlockOriginLite/dashboard.html:28, Resources/Extensions/uBlockOriginLite/dashboard.html:29, Resources/Extensions/uBlockOriginLite/dashboard.html:30, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×3) — Resources/Extensions/uBlockOriginLite/dashboard.html:38, Resources/Extensions/uBlockOriginLite/dashboard.html:122, Resources/Extensions/uBlockOriginLite/dashboard.html:134
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×6) — Resources/Extensions/uBlockOriginLite/dashboard.html:109, Resources/Extensions/uBlockOriginLite/dashboard.html:110, Resources/Extensions/uBlockOriginLite/dashboard.html:138, …
An <optgroup> groups <option>s but has no label, so assistive tech announces the group with no name. Add a label attribute. — Resources/Extensions/uBlockOriginLite/dashboard.html:157
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×7) — Resources/Extensions/uBlockOriginLite/dashboard.html:174, Resources/Extensions/uBlockOriginLite/dashboard.html:175, Resources/Extensions/uBlockOriginLite/dashboard.html:176, …
This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×2) — Resources/Extensions/uBlockOriginLite/report.html:31, Resources/Extensions/uBlockOriginLite/report.html:37
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure3.2 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×8) — Resources/Extensions/uBlockOriginLite/dashboard.html:2, Resources/Extensions/uBlockOriginLite/matched-rules.html:2, Resources/Extensions/uBlockOriginLite/picker-ui.html:2, …
An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>. (×3) — Resources/Extensions/uBlockOriginLite/dashboard.html:2, Resources/Extensions/uBlockOriginLite/popup.html:2, Resources/Extensions/uBlockOriginLite/strictblock.html:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×7) — Resources/Extensions/uBlockOriginLite/dashboard.html:2, Resources/Extensions/uBlockOriginLite/picker-ui.html:2, Resources/Extensions/uBlockOriginLite/report.html:2, …
An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. (×3) — Resources/Extensions/uBlockOriginLite/dashboard.html:45, Resources/Extensions/uBlockOriginLite/dashboard.html:96, Resources/Extensions/uBlockOriginLite/report.html:21
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="matchedEntries">, so there is no content here to wrap — render the <main> from the component mounted into it. — Resources/Extensions/uBlockOriginLite/matched-rules.html:2
An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. — Resources/Extensions/uBlockOriginLite/web_accessible_resources/googlesyndication_adsbygoogle.js:31
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.pro-finger-pointer` moves (`transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/trackpad.html:87
`.apple-pro-hud` moves (`transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/trackpad.html:111
`.apple-ripple` moves (`animation: apple-ripple-expand 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/trackpad.html:120
`nav > .tabButton:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — Resources/Extensions/uBlockOriginLite/css/dashboard.css:30
`:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — Resources/Extensions/uBlockOriginLite/css/popup.css:38
`:root :focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — Resources/Extensions/uBlockOriginLite/css/tool-overlay-ui.css:24
`aside .fa-icon` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/Extensions/uBlockOriginLite/css/popup.css:65
`body.committing #commit-spinner` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/Extensions/uBlockOriginLite/css/settings.css:118
`body.busy section[data-pane="busy"] .fa-icon` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Resources/Extensions/uBlockOriginLite/css/settings.css:427
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
`MooziacHeaderBarDelegate` declares 18 requirements: `headerBarDidTapClose`, `headerBarDidTapQuit`, `headerBarDidTapMinimize`, `headerBarDidTapBack`, `headerBarDidTapForward`, `headerBarDidTapReload`, `headerBarDidTapCaptions`, `headerBarDidTapLike`, `headerBarDidTapPlaylists`, `headerBarDidTapHistory`, `headerBarDidTapDownload`, `headerBarDidTapSpeedPicker`, `headerBarDidTapBestPart`, `headerBarDidTapQualityPicker`, `headerBarDidTapShield`, `headerBarDidTapPiP`, `headerBarDidTapTheater`, `headerBarDidTapFullscreen`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:4
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the 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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the 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.
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 2 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:11
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.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
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.
`sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/Mooziac/Views/Windows/LaunchAnimationController.swift:129
`fetchFormats` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift:91
What to do
Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — Sources/Mooziac/Views/Windows/LaunchAnimationController.swift:134, Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:283
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — Sources/Mooziac/Managers/DownloadManager.swift:986
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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.
D36 Supply-chain Provenance & Signing — 1 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
X10 Duplicated predicate — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: this repository stores data through 'SQLite3' (Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:3) but declares no persisted model this check reads (SwiftData @Model, Core Data, Realm, GRDB and Fluent types, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'SQLite3' (Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:3) but declares no persisted model this check reads (SwiftData @Model, Core Data NSManagedObject, Realm Object, GRDB record and Fluent Model properties, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 69 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D12 Dependency Hygiene — Not scored — 0 SwiftPM declaration(s) across 1 `Package.swift` and 0 committed pin(s) were read for PINNING discipline (0 defect(s) reported), but the outdated signal comes from listing each declared repository's release tags rather than from a registry, and none of them resolved to a version to compare, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
D21 Naming Consistency — Naming consistency does not read html yet; not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D5 Coupling — Not applicable — this SwiftPM build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Swift suite
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 7 current-state document(s) make no claim of a kind M4 checks. 6 claim(s) of kinds M4 does not check were not checked (path 3, command argument 2, cd 1); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage 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 — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not 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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X13 Undrained process stream — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X23 Unguarded diagnostic materialisation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. Swift's `Array`, `Dictionary` and `Set` are values: `for x in items` walks the copy taken when the loop starts, so a body that adds to or removes from `items` changes a different value, nothing is invalidated, and every original element is still visited. This repository's Swift names no Foundation mutable collection (`NSMutableArray` and kin), the one kind a Swift loop can walk by reference. Not a gap in the analyzer and not a finding about your code.
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Swift was read, and it logs through none: `print` and `NSLog` take one finished line, and os's `Logger` keeps each interpolated value as its own argument, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through swift-log (`import Logging`) and `os_log` calls would be judged.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
<html> without a lang Resources/Extensions/uBlockOriginLite/dashboard.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/matched-rules.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/picker-ui.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/popup.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/report.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/strictblock.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/unpicker-ui.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Resources/Extensions/uBlockOriginLite/zapper-ui.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC2 · Forms & labels· <button> with no accessible text · ×7
<button> with no accessible text Resources/Extensions/uBlockOriginLite/dashboard.html:28— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/dashboard.html:29— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/dashboard.html:30— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/dashboard.html:31— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/dashboard.html:32— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/picker-ui.html:37— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text Resources/Extensions/uBlockOriginLite/strictblock.html:41— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels· Link with no accessible name · ×7
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:174— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:175— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:176— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:177— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:180— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:181— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name Resources/Extensions/uBlockOriginLite/dashboard.html:182— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC2 · Forms & labels· <input> without a programmatic label · ×5
<input> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:38— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:109— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:110— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:122— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:138— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure· Document <title> is empty · ×3
Document <title> is empty Resources/Extensions/uBlockOriginLite/dashboard.html:2— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
Document <title> is empty Resources/Extensions/uBlockOriginLite/popup.html:2— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
Document <title> is empty Resources/Extensions/uBlockOriginLite/strictblock.html:2— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label Resources/Extensions/uBlockOriginLite/dashboard.html:134— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label Resources/Extensions/uBlockOriginLite/picker-ui.html:23— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <label> that labels no control · ×2
<label> that labels no control Resources/Extensions/uBlockOriginLite/report.html:31— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control Resources/Extensions/uBlockOriginLite/report.html:37— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <select> without a programmatic label · ×2
<select> without a programmatic label Resources/Extensions/uBlockOriginLite/report.html:32— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Resources/Extensions/uBlockOriginLite/report.html:38— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC1 · Text alternatives· <img> without a text alternative · ×1
<img> without a text alternative Resources/Extensions/uBlockOriginLite/js/i18n.js:332— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC3 · Page structure· <iframe> without a title · ×1
<iframe> without a title Resources/Extensions/uBlockOriginLite/web_accessible_resources/googlesyndication_adsbygoogle.js:31— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
MethodTooLong: DynamicIslandPlayerView.setupSettingsContainerView Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:109— MethodTooLong — setupSettingsContainerView runs 569 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 469 over it, 5.69× 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: NowPlayingManager.setupInWebView Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:6— MethodTooLong — setupInWebView runs 563 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 463 over it, 5.63× 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: DynamicIslandPlayerView.setupUI Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:292— MethodTooLong — setupUI runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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: PlaylistLibraryView.menu Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:7— MethodTooLong — menu runs 250 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 150 over it, 2.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: YTMWebViewContainer.init Sources/Mooziac/Web/YTMWebView.swift:163— MethodTooLong — init runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× 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: NowPlayingManager.userContentController Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:821— MethodTooLong — userContentController runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× 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: DynamicIslandPlayerView.makePlaylistRow Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:888— MethodTooLong — makePlaylistRow runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× 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: PlaylistLibraryView.setupUI Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:113— MethodTooLong — setupUI runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: DynamicIslandPlayerView.applyTheme Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:156— MethodTooLong — applyTheme runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: KeyboardShortcutHandler.handleKeyDown Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift:45— MethodTooLong — handleKeyDown runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: PlaylistLibraryView.reload Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:714— MethodTooLong — reload runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VisualMatrixVideoGenerator.run Sources/Mooziac/Support/VisualMatrixVideoGenerator.swift:7— MethodTooLong — run runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: OfflineLibraryView.setupUI Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:53— MethodTooLong — setupUI 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: StatusItemManager.showContextMenu Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:170— MethodTooLong — showContextMenu runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× 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: RatingPromptWindowController.setupUI Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:33— MethodTooLong — setupUI runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VisualMatrixSnapshotGenerator.generateInteractiveHTMLGallery Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:312— MethodTooLong — generateInteractiveHTMLGallery runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: CircularProgressDownloadButton.updateVisuals Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:118— MethodTooLong — updateVisuals runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: YouTubeDownloadSheetController.setupUI Sources/Mooziac/YouTube/Views/YouTubeDownloadSheetController.swift:81— MethodTooLong — setupUI runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VisualMatrixSnapshotGenerator.run Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:5— MethodTooLong — run runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LyricsManager.fetchLyrics Sources/Mooziac/Managers/LyricsManager.swift:281— MethodTooLong — fetchLyrics 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: DynamicIslandPlayerView.resetPlaylistSectionChrome Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:28— MethodTooLong — resetPlaylistSectionChrome 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: UpdateManager.showUpdateAvailableAlert Sources/Mooziac/Managers/UpdateManager.swift:231— MethodTooLong — showUpdateAvailableAlert runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NowPlayingManager.togglePlayPause Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:45— MethodTooLong — togglePlayPause 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: PlaylistLibraryView.applyTheme Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:526— MethodTooLong — applyTheme runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DownloadManager.executeYtDlpDownloadTask Sources/Mooziac/Managers/DownloadManager.swift:562— MethodTooLong — executeYtDlpDownloadTask runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Low cohesion: MainVideoWindowController (LCOM4 24) Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:6— MainVideoWindowController's methods fall into 24 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 24 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: LocalDatabaseManager (LCOM4 19) Sources/Mooziac/Managers/LocalDatabaseManager.swift:190— LocalDatabaseManager's methods fall into 19 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 19 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: StatusItemManager (LCOM4 17) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:10— StatusItemManager's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PlaylistLibraryView (LCOM4 17) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:10— PlaylistLibraryView's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DynamicIslandPlayerView (LCOM4 13) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:20— DynamicIslandPlayerView's methods fall into 13 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 13 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: MainViewController (LCOM4 11) Sources/Mooziac/Core/MainViewController.swift:13— MainViewController's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ReactiveIconButton (LCOM4 10) Sources/Mooziac/Views/Components/ReactiveIconButton.swift:4— ReactiveIconButton's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DisplayManager (LCOM4 6) Sources/Mooziac/Core/DisplayManager.swift:4— DisplayManager's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: HistoryManager (LCOM4 6) Sources/Mooziac/Managers/HistoryManager.swift:4— HistoryManager's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: OfflineTableView (LCOM4 5) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:885— OfflineTableView's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GestureMappingManager (LCOM4 4) Sources/Mooziac/Input/GestureMappingManager.swift:4— GestureMappingManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: LikedSongsManager (LCOM4 4) Sources/Mooziac/Managers/LikedSongsManager.swift:4— LikedSongsManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MenuCapsuleToggleRowView (LCOM4 4) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:4— MenuCapsuleToggleRowView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RatingPromptWindowController (LCOM4 4) Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:3— RatingPromptWindowController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VideoPlayerCoordinator (LCOM4 4) Sources/Mooziac/YouTube/Core/VideoPlayerCoordinator.swift:5— VideoPlayerCoordinator's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MooziacExtensionTab (LCOM4 4) Sources/Mooziac/YouTube/Extensions/WebExtensionHost.swift:17— MooziacExtensionTab's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MooziacExtensionWindow (LCOM4 4) Sources/Mooziac/YouTube/Extensions/WebExtensionHost.swift:66— MooziacExtensionWindow's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WebExtensionManager (LCOM4 4) Sources/Mooziac/YouTube/Extensions/WebExtensionManager.swift:5— WebExtensionManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MooziacHeaderBarView (LCOM4 4) Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:25— MooziacHeaderBarView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SettingsLinkButton (LCOM4 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:4— SettingsLinkButton'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.
FileTooLong: DynamicIslandPlayerView/SettingsPanel+Drawers.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift— FileTooLong — 1172 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 672 over it, 2.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: Managers/LocalDatabaseManager.swift Sources/Mooziac/Managers/LocalDatabaseManager.swift— FileTooLong — 1124 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: LocalDatabaseManager (190-1463). The bar is 500 significant lines; this is 624 over it, 2.25× 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: DynamicIslandPlayerView/Core.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift— FileTooLong — 1030 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DynamicIslandPlayerView (20-1385). The bar is 500 significant lines; this is 530 over it, 2.06× 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: Managers/PlaylistManager.swift Sources/Mooziac/Managers/PlaylistManager.swift— FileTooLong — 1014 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: PlaylistManager (26-1442). The bar is 500 significant lines; this is 514 over it, 2.03× 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: Libraries/PlaylistLibraryView.swift Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift— FileTooLong — 1013 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: PlaylistLibraryView (10-1333). The bar is 500 significant lines; this is 513 over it, 2.03× 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: Core/MainVideoWindowController.swift Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift— FileTooLong — 968 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MainVideoWindowController (6-1436). The bar is 500 significant lines; this is 468 over it, 1.94× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Managers/DownloadManager.swift Sources/Mooziac/Managers/DownloadManager.swift— FileTooLong — 967 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: DownloadManager (24-1278). The bar is 500 significant lines; this is 467 over it, 1.93× 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: Libraries/PlaylistLibraryView+Cells.swift Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift— FileTooLong — 926 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 426 over it, 1.85× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift— FileTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 373 over it, 1.75× 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: Web/YTMWebView.swift Sources/Mooziac/Web/YTMWebView.swift— FileTooLong — 810 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: YTMWebViewContainer (131-1184). The bar is 500 significant lines; this is 310 over it, 1.62× 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: NowPlayingManager/ObserverBridge.swift Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift— FileTooLong — 804 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 304 over it, 1.61× 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: NowPlayingManager/PlayerControls.swift Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift— FileTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 291 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: YTMClient (14-1174). The bar is 500 significant lines; this is 283 over it, 1.57× 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: Libraries/OfflineLibraryView.swift Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift— FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: OfflineLibraryView (10-642). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: DynamicIslandPlayerView/SettingsPanel+Rows.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: DynamicIslandPlayerView/SettingsPanel.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift— FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 171 over it, 1.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: Libraries/PlaylistLibraryView+ContextMenu.swift Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift— FileTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 148 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Views/YouTubeDownloadSheetController.swift Sources/Mooziac/YouTube/Views/YouTubeDownloadSheetController.swift— FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: YouTubeDownloadSheetController (8-616). The bar is 500 significant lines; this is 97 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: StatusItemManager/StatusItemManager.swift Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift— FileTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: StatusItemManager (10-874). The bar is 500 significant lines; this is 63 over it, 1.13× 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.
Duplicated block (7 lines × 2) Sources/Mooziac/Input/KeyboardCommandHandler.swift:59— Sources/Mooziac/Input/KeyboardCommandHandler.swift:59-65 | Sources/Mooziac/Input/KeyboardCommandHandler.swift:68-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/Mooziac/Managers/LyricsManager.swift:677— Sources/Mooziac/Managers/LyricsManager.swift:677-683 | Sources/Mooziac/Managers/LyricsManager.swift:700-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/Mooziac/Managers/SyncedLyricsParser.swift:134— Sources/Mooziac/Managers/SyncedLyricsParser.swift:134-140 | Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:249-255 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:970— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:970-976 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:61-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:351— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:351-357 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:625-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:378— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:378-384 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:647-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:305— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:305-311 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:533-539 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:539— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:539-545 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:352-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:775— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:775-782 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:435-441 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:775` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:73— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:73-79 | Sources/Mooziac/YouTube/Views/FloatingHUDWindowController.swift:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:93— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:93-99 | Sources/Mooziac/YouTube/Views/FloatingHUDWindowController.swift:58-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:248— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:248-254 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:486-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:257` calls `history`, `VALUES` and `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:495` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:152— Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:152-158 | Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:162-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `to` to `pathE` in one and `pathF` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:123— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:123-129 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:754-760 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:123` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:761` calls `addSubview`, `setupGestureMappingSubView` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:131` 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 × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:37— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:37-43 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:97-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:45— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:45-51 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:105-111 — 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.
Hotspot: Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:821— Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in NowPlayingManager.userContentController at line 821. 5 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:693— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in DynamicIslandPlayerView.updateState at line 693. 5 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Managers/PlaylistManager.swift Sources/Mooziac/Managers/PlaylistManager.swift:234— Sources/Mooziac/Managers/PlaylistManager.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in PlaylistManager.reorderItems at line 234. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Managers/PlaylistManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:156— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DynamicIslandPlayerView.applyTheme at line 156. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:599— Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in StatusItemManager.startEventMonitors at line 599. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Managers/LyricsManager.swift Sources/Mooziac/Managers/LyricsManager.swift:281— Sources/Mooziac/Managers/LyricsManager.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in LyricsManager.fetchLyrics at line 281. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Managers/LyricsManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Managers/DownloadManager.swift Sources/Mooziac/Managers/DownloadManager.swift:562— Sources/Mooziac/Managers/DownloadManager.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in DownloadManager.executeYtDlpDownloadTask at line 562. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Managers/DownloadManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:813— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in OfflineTrackCellView.configure at line 813. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift:45— Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in KeyboardShortcutHandler.handleKeyDown at line 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:280— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in CenteredMenuBarLyricsWindowController.updateLyricsFrame at line 280. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Managers/DiscordRPCManager.swift Sources/Mooziac/Managers/DiscordRPCManager.swift:376— Sources/Mooziac/Managers/DiscordRPCManager.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in DiscordRPCManager.updatePresenceInternal at line 376. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Managers/DiscordRPCManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:368— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in DynamicIslandPlayerView.updateSettingsThemeHighlight at line 368. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:118— Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CircularProgressDownloadButton.updateVisuals at line 118. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Input/GestureMappingManager.swift Sources/Mooziac/Input/GestureMappingManager.swift:77— Sources/Mooziac/Input/GestureMappingManager.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in GestureMappingManager.executeAction at line 77. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Input/GestureMappingManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/Mooziac/Input/GlobalHotKeyManager.swift Sources/Mooziac/Input/GlobalHotKeyManager.swift:20— Sources/Mooziac/Input/GlobalHotKeyManager.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in GlobalHotKeyManager.registerCarbonHotKeys at line 20. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Input/GlobalHotKeyManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
ClassTooLong: PlaylistLibraryView Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:10— ClassTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded), 100 methods. The bar is 400 significant lines; this is 607 over it, 2.52× 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: DynamicIslandPlayerView Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:20— ClassTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded), 200 methods. The bar is 400 significant lines; this is 605 over it, 2.51× 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: PlaylistManager Sources/Mooziac/Managers/PlaylistManager.swift:26— ClassTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 596 over it, 2.49× 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: MainVideoWindowController Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:6— ClassTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 565 over it, 2.41× 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: LocalDatabaseManager Sources/Mooziac/Managers/LocalDatabaseManager.swift:190— ClassTooLong — 961 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 561 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DownloadManager Sources/Mooziac/Managers/DownloadManager.swift:24— ClassTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 473 over it, 2.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.
ClassTooLong: YTMClient REDACTED:14— ClassTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 380 over it, 1.95× 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: YTMWebViewContainer Sources/Mooziac/Web/YTMWebView.swift:131— ClassTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 319 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.
ClassTooLong: StatusItemManager Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:10— ClassTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 157 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LyricsManager Sources/Mooziac/Managers/LyricsManager.swift:4— ClassTooLong — 492 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 92 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.
ClassTooLong: YouTubeDownloadSheetController Sources/Mooziac/YouTube/Views/YouTubeDownloadSheetController.swift:7— ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 52 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OfflineLibraryView Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:10— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UpdateManager Sources/Mooziac/Managers/UpdateManager.swift:4— ClassTooLong — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 27 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.
Duplicated block (5 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:820— Sources/Mooziac/Managers/PlaylistManager.swift:820-824 | Sources/Mooziac/Managers/PlaylistManager.swift:831-835 — both copies are in the same file, so extract the 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) REDACTED:552— REDACTED:552-556 | REDACTED:559-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:60— Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:60-66 | Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:86-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Components/WaveformProgressView.swift:260— Sources/Mooziac/Views/Components/WaveformProgressView.swift:260-264 | Sources/Mooziac/Views/Components/WaveformProgressView.swift:327-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:6— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:6-10 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:800-804 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:6` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:103— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:103-107 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:115-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Mooziac/Web/YTMWebView.swift:1023— Sources/Mooziac/Web/YTMWebView.swift:1023-1027 | Sources/Mooziac/Web/YTMWebView.swift:1131-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Web/YTMWebView.swift:1023` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:429— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:429-433 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:517-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:484— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:484-488 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:609-613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:615` calls `sqlite3_bind_text` and `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:490` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:920— Sources/Mooziac/Managers/LocalDatabaseManager.swift:920-924 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1034-1038 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:920` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:568— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:568-572 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:34-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:568` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:850— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:850-854 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:856-860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:444— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:444-448 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:697-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/Mooziac/Managers/DownloadManager.swift:486— Sources/Mooziac/Managers/DownloadManager.swift:486-495 | Sources/Mooziac/Managers/DownloadManager.swift:510-519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:384— Sources/Mooziac/Managers/PlaylistManager.swift:384-393 | Sources/Mooziac/Managers/PlaylistManager.swift:421-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:384` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) REDACTED:625— REDACTED:625-634 | REDACTED:829-838 — both copies are in the same file, so extract the 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 `REDACTED:625` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Components/HeaderView.swift:85— Sources/Mooziac/Views/Components/HeaderView.swift:85-94 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:666-675 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:277— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:277-286 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:294-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:277` 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 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436-445 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1396-1405 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1274— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1274-1283 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:614-623 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:184— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:184-193 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:214-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:249— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:249-258 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:335-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:248` calls `controlButtonTint` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:333` 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 (10 lines × 2) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:38— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:38-47 | Sources/Mooziac/YouTube/Views/FloatingHUDWindowController.swift:11-20 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1326— Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1326-1335 | Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1342-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:548— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:548-557 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:576-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:420— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:420-427 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1154-1161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:1124— Sources/Mooziac/Managers/LocalDatabaseManager.swift:1124-1131 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1327-1334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:1124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Managers/LocalDatabaseManager.swift:1133` calls `sqlite3_bind_int`, `Int32` and `Sources/Mooziac/Managers/LocalDatabaseManager.swift:1336` 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) REDACTED:208— REDACTED:208-215 | REDACTED:236-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:514— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:514-521 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:549-556 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98-105 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:180-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98-105 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:284-291 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:292` calls `firstIndex` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:106` 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 (8 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:388— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:388-395 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1068-1075 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:388` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:401— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:401-408 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:82-89 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:401` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:990— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:990-997 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1025-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:990` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:375— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:375-382 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:434-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:375` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:373` calls `sqlite3_bind_text` and `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:433` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/OfflineOverlayView.swift:96— Sources/Mooziac/Views/Libraries/OfflineOverlayView.swift:96-103 | Sources/Mooziac/Views/Libraries/OfflineOverlayView.swift:109-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineOverlayView.swift:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:454— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:454-461 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:474-481 — both copies are in the same file, so extract the 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.
TooManyMethods: DynamicIslandPlayerView Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:20— TooManyMethods — 200 methods, declared across 7 files: DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift (68), DynamicIslandPlayerView/SettingsPanel+Drawers.swift (60), DynamicIslandPlayerView/Core.swift (45), DynamicIslandPlayerView/SettingsPanel+Appearance.swift (9), +3 more file(s). The bar is 30 methods; this is 170 over it, 6.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlaylistLibraryView Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:10— TooManyMethods — 100 methods, declared across 3 files: Libraries/PlaylistLibraryView.swift (46), Libraries/PlaylistLibraryView+ContextMenu.swift (39), Libraries/PlaylistLibraryView+TableView.swift (15). The bar is 30 methods; this is 70 over it, 3.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainVideoWindowController Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:6— TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatusItemManager Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:10— TooManyMethods — 61 methods, declared across 2 files: StatusItemManager/StatusItemManager.swift (35), StatusItemManager/ContextMenu.swift (26). The bar is 30 methods; this is 31 over it, 2.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlaylistManager Sources/Mooziac/Managers/PlaylistManager.swift:26— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NowPlayingManager Sources/Mooziac/Core/NowPlayingManager/NowPlayingManager.swift:5— TooManyMethods — 49 methods, declared across 4 files: NowPlayingManager/NowPlayingManager.swift (20), NowPlayingManager/PlayerControls.swift (18), NowPlayingManager/Queue.swift (8), NowPlayingManager/ObserverBridge.swift (3). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LocalDatabaseManager Sources/Mooziac/Managers/LocalDatabaseManager.swift:190— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: DownloadManager Sources/Mooziac/Managers/DownloadManager.swift:24— 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: MainViewController Sources/Mooziac/Core/MainViewController.swift:13— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MooziacHeaderBarView Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:25— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: YTMClient REDACTED:14— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (9 lines × 2) Sources/Mooziac/Managers/LyricsManager.swift:428— Sources/Mooziac/Managers/LyricsManager.swift:428-436 | Sources/Mooziac/Managers/LyricsManager.swift:640-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LyricsManager.swift:428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:331— Sources/Mooziac/Managers/PlaylistManager.swift:331-339 | Sources/Mooziac/Managers/PlaylistManager.swift:360-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:331` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:1136— Sources/Mooziac/Managers/PlaylistManager.swift:1136-1144 | Sources/Mooziac/Managers/PlaylistManager.swift:1174-1182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Managers/PlaylistManager.swift:1173` calls `playPreviousTrackInPlaylist` and `Sources/Mooziac/Managers/PlaylistManager.swift:1135` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) REDACTED:975— REDACTED:975-983 | REDACTED:1108-1116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Components/ReactiveIconButton.swift:106— Sources/Mooziac/Views/Components/ReactiveIconButton.swift:106-114 | Sources/Mooziac/Views/Components/ReactiveIconButton.swift:216-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:252— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:252-260 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:374-382 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:412— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:412-420 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:890-898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `PlaylistItemRecord` in one and `HistoryRecord` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:846— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:846-854 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:950-958 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:846` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:526— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:526-534 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:546-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:526` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/Mooziac/Views/Components/ReactiveIconButton.swift:54— Sources/Mooziac/Views/Components/ReactiveIconButton.swift:54-67 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:321-329 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1264— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1264-1269 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1290-1295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:9— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:9-14 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:810-815 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:9` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:808` calls `showAddToPlaylistSubView` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:7` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461-466 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:840-845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:332— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:332-337 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:575-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:332` 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) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:515— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:515-520 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:828-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:515` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1107— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1107-1112 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:828-833 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Mooziac/Audio/AppVolumeManager.swift:42— Sources/Mooziac/Audio/AppVolumeManager.swift:42-47 | Sources/Mooziac/Audio/EdgeVolumeEngine.swift:10-15 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Sources/Mooziac/Core/NowPlayingManager/Queue.swift:184— Sources/Mooziac/Core/NowPlayingManager/Queue.swift:184-189 | Sources/Mooziac/Core/NowPlayingManager/Queue.swift:407-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/Queue.swift:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:560— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:560-565 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:605-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC3 · Page structure· Page without a main landmark · ×8
Page without a main landmark Resources/Extensions/uBlockOriginLite/dashboard.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/Extensions/uBlockOriginLite/matched-rules.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="matchedEntries">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark Resources/Extensions/uBlockOriginLite/picker-ui.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/Extensions/uBlockOriginLite/report.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/Extensions/uBlockOriginLite/strictblock.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/Extensions/uBlockOriginLite/unpicker-ui.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/Extensions/uBlockOriginLite/zapper-ui.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Resources/trackpad.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×7
Edited copy of a member (19 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:453— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:453-471 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:473-491 — 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) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:232— Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:232-250 | Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:252-270 — 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1478— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1478-1496 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1498-1516 — 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) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1298— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1298-1316 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1144-1165 — 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) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:38— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:38-62 | Sources/Mooziac/YouTube/Views/FloatingHUDWindowController.swift:11-29 — 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) Sources/Mooziac/Audio/NativeAudioPlayer.swift:153— Sources/Mooziac/Audio/NativeAudioPlayer.swift:153-173 | Sources/Mooziac/Audio/NativeAudioPlayer.swift:175-193 — 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) Sources/Mooziac/Managers/LocalDatabaseManager.swift:221— Sources/Mooziac/Managers/LocalDatabaseManager.swift:221-243 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:143-161 — 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×6
Animation without a prefers-reduced-motion guard Resources/trackpad.html:87— `.pro-finger-pointer` moves (`transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard Resources/trackpad.html:111— `.apple-pro-hud` moves (`transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard Resources/trackpad.html:120— `.apple-ripple` moves (`animation: apple-ripple-expand 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard Resources/Extensions/uBlockOriginLite/css/popup.css:65— `aside .fa-icon` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard Resources/Extensions/uBlockOriginLite/css/settings.css:118— `body.committing #commit-spinner` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard Resources/Extensions/uBlockOriginLite/css/settings.css:427— `body.busy section[data-pane="busy"] .fa-icon` moves (`animation: spin 1s steps(8) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×6
Edited copy of a member (18 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1095— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1095-1112 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:815-833 — 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.
Edited copy of a member (18 corresponding lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1253— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1253-1270 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1272-1289 — 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.
Edited copy of a member (18 corresponding lines) Sources/Mooziac/Managers/LocalDatabaseManager.swift:683— Sources/Mooziac/Managers/LocalDatabaseManager.swift:683-700 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:702-730 — 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.
Edited copy of a member (18 corresponding lines) REDACTED:182— REDACTED:182-199 | REDACTED:202-219 — 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.
Edited copy of a member (18 corresponding lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:187— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:187-205 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:221-238 — 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.
Edited copy of a member (18 corresponding lines) Sources/Mooziac/Audio/AudioRouteMonitor.swift:98— Sources/Mooziac/Audio/AudioRouteMonitor.swift:98-115 | Sources/Mooziac/Audio/EdgeVolumeEngine.swift:25-43 — 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 copy of a member (10 corresponding lines) · ×6
Edited copy of a member (10 corresponding lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:226— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:226-235 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:237-246 — 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) Sources/Mooziac/Managers/PlaylistManager.swift:819— Sources/Mooziac/Managers/PlaylistManager.swift:819-828 | Sources/Mooziac/Managers/PlaylistManager.swift:830-839 — 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) Sources/Mooziac/Managers/LocalDatabaseManager.swift:169— Sources/Mooziac/Managers/LocalDatabaseManager.swift:169-187 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:35-44 — 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:295— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:295-306 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:877-886 — 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) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:386— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:386-395 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1066-1075 — 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) Sources/Mooziac/Managers/LocalDatabaseManager.swift:486— Sources/Mooziac/Managers/LocalDatabaseManager.swift:486-499 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:163-172 — 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.
Duplicated block (8 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:140— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:140-147 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:217-224 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:288-295 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:161— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:161-168 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:423-430 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:122-129 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:120` calls `SymbolConfiguration`, `NSImage`, `withSymbolConfiguration` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:160` 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 (8 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:326— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:326-333 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:402-409 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:516-523 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:27— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:27-34 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:99-106 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:182-189 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:143— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:143-150 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:209-216 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:276-283 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:143` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:319— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:319-326 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:413-420 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:502-509 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:787— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:787-798 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:800-811 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:162-173 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:175-186 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:652— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:652-672 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:475-500 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:553-572 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:574-596 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:679— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:679-695 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:697-713 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:372-388 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:390-406 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1167— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1167-1191 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1263-1287 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1289-1313 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1321-1345 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:154— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:154-233 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461-570 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:655-769 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:840-905 — 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 (5 corresponding lines) · ×5
Edited copy of a member (5 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1322— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1322-1326 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1328-1332 — 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.
Edited copy of a member (5 corresponding lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1113— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1113-1117 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:330-334 — 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.
Edited copy of a member (5 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:422— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:422-426 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:541-545 — 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.
Edited copy of a member (5 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:428— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:428-432 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:547-551 — 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.
Edited copy of a member (5 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:506— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:506-510 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:302-306 — 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.
Duplicated block (14 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:1357— Sources/Mooziac/Managers/PlaylistManager.swift:1357-1370 | Sources/Mooziac/Managers/PlaylistSyncManager.swift:116-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:1357` 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 lines × 2) Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:71— Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:71-84 | Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:97-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:71` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `animated` to `Bool = true` in one and `Bool` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:478— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:478-491 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:577-590 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:478` 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 (14 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:797— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:797-810 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:865-878 — both copies are in the same file, so extract the 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 (14 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:803— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:803-816 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:837-850 — both copies are in the same file, so extract the 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 (11 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:156— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:156-166 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:235-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:233` calls `registerForDraggedTypes` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:154` 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 (11 lines × 2) Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:618— Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:618-628 | Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:631-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:217— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:217-227 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:283-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:294` calls `NSColor` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:228` 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 (11 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:1260— Sources/Mooziac/Managers/PlaylistManager.swift:1260-1270 | Sources/Mooziac/Managers/PlaylistManager.swift:1300-1310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:1260` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:891— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:891-901 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:8-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 both call sites, so a change lands once.
Duplicated block (6 lines × 3) Sources/Mooziac/Managers/LocalDatabaseManager.swift:711— Sources/Mooziac/Managers/LocalDatabaseManager.swift:711-716 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:792-797 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:970-975 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:711` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/Mooziac/Support/AppExtensions.swift:128— Sources/Mooziac/Support/AppExtensions.swift:128-133 | Sources/Mooziac/Support/AppExtensions.swift:142-147 | Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:101-106 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Support/AppExtensions.swift:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:382— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:382-387 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:651-656 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1107-1112 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:382` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1104` calls `constraint` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:379` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:419— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:419-424 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:437-442 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:454-459 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:400— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:400-405 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:81-86 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1171-1176 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×4
Edited copy of a member (13 corresponding lines) REDACTED:431— REDACTED:431-449 | REDACTED:451-463 — 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) Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1324— Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1324-1336 | Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:1338-1359 — 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) Sources/Mooziac/Managers/LocalDatabaseManager.swift:884— Sources/Mooziac/Managers/LocalDatabaseManager.swift:884-896 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1414-1434 — 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:172— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:172-185 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:207-219 — 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.
Duplicated block (5 lines × 3) REDACTED:569— REDACTED:569-573 | REDACTED:627-631 | REDACTED:831-835 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) REDACTED:624— REDACTED:624-628 | REDACTED:819-823 | REDACTED:828-832 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:953— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:953-957 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:972-976 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:63-67 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:951` calls `addItem` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:970` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) Sources/Mooziac/Support/AppExtensions.swift:123— Sources/Mooziac/Support/AppExtensions.swift:123-127 | Sources/Mooziac/Support/AppExtensions.swift:137-141 | Sources/Mooziac/Support/AppExtensions.swift:154-158 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Support/AppExtensions.swift:123` 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×3
Focus outline removed in CSS without a :focus replacement Resources/Extensions/uBlockOriginLite/css/dashboard.css:30— `nav > .tabButton:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement Resources/Extensions/uBlockOriginLite/css/popup.css:38— `:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement Resources/Extensions/uBlockOriginLite/css/tool-overlay-ui.css:24— `:root :focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:483— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:483-506 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:608-624 — 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.
Edited copy of a member (17 corresponding lines) Sources/Mooziac/Audio/EdgeVolumeEngine.swift:337— Sources/Mooziac/Audio/EdgeVolumeEngine.swift:337-353 | Sources/Mooziac/Audio/EdgeVolumeEngine.swift:355-371 — 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.
Edited copy of a member (17 corresponding lines) Sources/Mooziac/Core/StatusItemManager/StatusItemPanel.swift:4— Sources/Mooziac/Core/StatusItemManager/StatusItemPanel.swift:4-20 | Sources/Mooziac/Views/Windows/NativeGestureTutorialWindowController.swift:9-26 — 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 (12 corresponding lines) · ×3
Edited copy of a member (12 corresponding lines) Sources/Mooziac/Support/AppExtensions.swift:122— Sources/Mooziac/Support/AppExtensions.swift:122-133 | Sources/Mooziac/Support/AppExtensions.swift:136-147 — 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:4— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Gestures.swift:4-17 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:795-806 — 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) Sources/Mooziac/Support/AppExtensions.swift:150— Sources/Mooziac/Support/AppExtensions.swift:150-162 | Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:95-106 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) Sources/Mooziac/Views/Components/GlassSearchField.swift:78— Sources/Mooziac/Views/Components/GlassSearchField.swift:78-86 | Sources/Mooziac/Views/Components/GlassSearchField.swift:88-96 — 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) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:568— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:568-576 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:34-42 — 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) Sources/Mooziac/Views/Components/GlassSearchField.swift:45— Sources/Mooziac/Views/Components/GlassSearchField.swift:45-54 | Sources/Mooziac/Views/Components/GlassSearchField.swift:98-106 — 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.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×3
Edited copy of a member (7 corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:648— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:648-654 | Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:656-662 — 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) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:799— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:799-805 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:340-349 — 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) Sources/Mooziac/Models/ProgressStyle.swift:19— Sources/Mooziac/Models/ProgressStyle.swift:19-25 | Sources/Mooziac/YouTube/Web/YouTubeQualityManager.swift:13-19 — 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 (19 lines × 2) Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:30— Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:30-48 | Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:32-50 — 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:14— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:14-32 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:129-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:548— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:548-566 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:747-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:548` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:1031— Sources/Mooziac/Managers/PlaylistManager.swift:1031-1046 | Sources/Mooziac/Managers/PlaylistManager.swift:1081-1096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:1031` 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) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:59— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:59-74 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:122-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:119` calls `registerForDraggedTypes` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:56` 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 (16 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:1094— Sources/Mooziac/Managers/LocalDatabaseManager.swift:1094-1109 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1131-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:659— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:659-669 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:482-492 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:559-569 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:581-591 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:659` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1176— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1176-1186 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1272-1282 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1298-1308 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1330-1340 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:788— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:788-798 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:801-811 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:163-173 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:176-186 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. 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 × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:472— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:472-479 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:703-710 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:932-939 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1167-1174 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:930` calls `URL`, `LocalTrack` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:701` 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 × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:14— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:14-21 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:129-136 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:217-224 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:283-290 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:215— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:215-222 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:552-559 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:751-758 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:890-897 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:215` 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 × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:337— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:337-343 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:612-618 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:822-828 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1068-1074 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:46— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:46-52 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:161-167 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:248-254 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:316-322 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:570— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:570-576 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:588-594 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:462-468 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:480-486 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:570` 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.
Empty <h3> heading Resources/Extensions/uBlockOriginLite/dashboard.html:45— An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
Empty <h3> heading Resources/Extensions/uBlockOriginLite/dashboard.html:96— An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
Repeated repair: Sources/Mooziac/Views/Components/GlassSearchField.swift Sources/Mooziac/Views/Components/GlassSearchField.swift:262— Sources/Mooziac/Views/Components/GlassSearchField.swift changed 5 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 12 (its worst body is GlassSearchField.performKeyEquivalent at line 262), 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: “chore(release): v1.1.4 - Synced lyrics HUD, Web Audio keepalive, search bar polish & updater fixes”; “fix(ui): remove grey background inside search bar for pure white theme”; “fix(theme): dynamic high-contrast adaptivity for Watery theme in Light mode”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Views/Components/GlassSearchField.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: Sources/Mooziac/Managers/LikedSongsManager.swift Sources/Mooziac/Managers/LikedSongsManager.swift:156— Sources/Mooziac/Managers/LikedSongsManager.swift changed 4 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 7 (its worst body is LikedSongsManager.syncNext at line 156), 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(likes): strictly use 1st-party session tokens and keep UI heart synced with local database”; “fix(likes): prevent logged-out liked songs from being removed by DOM sync”; “Release v1.0.9: Google Auth fix, legacy GPU translucency fix, auto-helper downloader”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 00:32:10 +05:30' --until='2026-11-16 00:32:10 +05:30' --full-history --no-merges -- Sources/Mooziac/Managers/LikedSongsManager.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/Mooziac/Managers/LocalDatabaseManager.swift:502— Sources/Mooziac/Managers/LocalDatabaseManager.swift:502-550 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:818-849 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:851-882 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:935-963 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:392-420 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:449-481 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:679— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:679-774 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:54-145 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:261-387 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:539-656 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:749-865 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:997-1112 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:502— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:502-538 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:1020-1038 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:862-893 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:966-997 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:999-1032 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:569— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:569-585 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:587-603 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:605-625 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:461-477 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:479-495 — 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 (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) REDACTED:1030— REDACTED:1030-1051 | REDACTED:1085-1105 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1273— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1273-1296 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:613-633 — These two members are one piece of code written twice and then edited apart: 21 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, 13+ corresponding lines) · ×2
Edited copies of one member (4 members, 13+ corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:715— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:715-727 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:314-326 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:408-420 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:497-509 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 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, 13+ corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:807— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:807-819 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:821-833 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:835-847 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:849-861 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 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 (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:513— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:513-529 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:547-562 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) Sources/Mooziac/Core/NowPlayingManager/NowPlayingManager.swift:348— Sources/Mooziac/Core/NowPlayingManager/NowPlayingManager.swift:348-363 | Sources/Mooziac/Core/NowPlayingManager/NowPlayingManager.swift:365-387 — These two members are one piece of code written twice and then edited apart: 16 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, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) Sources/Mooziac/Views/Components/HeaderView.swift:82— Sources/Mooziac/Views/Components/HeaderView.swift:82-100 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:251-264 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:373-388 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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.
Edited copies of one member (3 members, 14+ corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:434— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:434-451 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:627-644 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:434-447 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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 (8 corresponding lines) · ×2
Edited copy of a member (8 corresponding lines) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:73— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:73-91 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:102-109 — 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.
Edited copy of a member (8 corresponding lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:682— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:682-689 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:691-698 — 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 copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) Sources/Mooziac/Input/KeyboardCommandHandler.swift:85— Sources/Mooziac/Input/KeyboardCommandHandler.swift:85-91 | Sources/Mooziac/Views/Components/WaveformProgressView.swift:347-353 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:837-843 — 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.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:505— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:505-511 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:538-545 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:351-358 — 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.
Duplicated block (24 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:172— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:172-195 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:280-303 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:172` 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 (24 lines × 2) Sources/Mooziac/Managers/PlaylistManager.swift:479— Sources/Mooziac/Managers/PlaylistManager.swift:479-502 | Sources/Mooziac/Managers/PlaylistManager.swift:538-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:538` 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 (22 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:828— Sources/Mooziac/Managers/LocalDatabaseManager.swift:828-849 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:861-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:828` 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 (22 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1192— Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1192-1213 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1217-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1192` 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 (18 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:232— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:232-249 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:343-360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:232` 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 (18 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:970— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:970-987 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1004-1021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:970` 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 (15–16 lines × 2) REDACTED:867— REDACTED:867-881 | REDACTED:1127-1142 — both copies are in the same file, so extract the 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 `REDACTED:867` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:661— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:661-675 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:772-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:661` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:676` calls `updateDownloadButtonState` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:788` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) Sources/Mooziac/Managers/DiscordRPCManager.swift:463— Sources/Mooziac/Managers/DiscordRPCManager.swift:463-477 | Sources/Mooziac/Managers/DiscordRPCManager.swift:493-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/DiscordRPCManager.swift:463` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) Sources/Mooziac/Managers/DownloadManager.swift:1112— Sources/Mooziac/Managers/DownloadManager.swift:1112-1126 | Sources/Mooziac/Managers/DownloadManager.swift:1146-1159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/DownloadManager.swift:1146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:140— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:140-154 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:218-232 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:233` calls `registerForDraggedTypes` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:156` 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 (15 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:316— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:316-330 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:333-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:680— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:680-692 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:698-710 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:373-385 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:391-403 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:419— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:419-431 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:672-684 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:897-909 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1134-1146 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:434` calls `NSColor` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1149` 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 (12 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:366— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:366-377 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:616-627 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:628` calls `secondaryTextColor` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:378` 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 (12 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:154— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:154-165 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:655-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:41— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:41-51 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:156-166 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:243-253 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:870— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:870-880 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:976-986 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1010-1020 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:870` 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 × 4) Sources/Mooziac/Managers/DownloadManager.swift:96— Sources/Mooziac/Managers/DownloadManager.swift:96-104 | Sources/Mooziac/Managers/LocalLibraryManager.swift:41-49 | Sources/Mooziac/Managers/LocalLibraryManager.swift:52-60 | Sources/Mooziac/Managers/LocalLibraryManager.swift:85-93 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/DownloadManager.swift:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:144— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:144-152 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:451-459 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:645-653 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:830-838 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:144` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436-444 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:959-967 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1396-1404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:776— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:776-785 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:151-160 | Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:362-370 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8–9 lines × 2) Sources/Mooziac/Views/Components/GlassSearchField.swift:203— Sources/Mooziac/Views/Components/GlassSearchField.swift:203-210 | Sources/Mooziac/Views/Components/GlassSearchField.swift:214-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Components/GlassSearchField.swift:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:292— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:292-299 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:301-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:172— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:172-178 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:434-440 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:135-141 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:172` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:133` calls `SymbolConfiguration`, `NSImage`, `withSymbolConfiguration` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:171` 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 × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:380— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:380-386 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:467-473 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:549-555 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:380` 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 (2–5 lines × 3) Sources/Mooziac/Managers/LyricsManager.swift:518— Sources/Mooziac/Managers/LyricsManager.swift:518-522 | Sources/Mooziac/Managers/LyricsManager.swift:557-561 | Sources/Mooziac/Managers/LyricsManager.swift:708-709 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LyricsManager.swift:518` 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 (2–5 lines × 3) Sources/Mooziac/Managers/DownloadManager.swift:265— Sources/Mooziac/Managers/DownloadManager.swift:265-266 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1172-1176 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:723-727 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1172` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Sync-over-async blocking Sources/Mooziac/Views/Windows/LaunchAnimationController.swift:129— `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Sync-over-async blocking Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift:91— `fetchFormats` is async and calls .waitUntilExit() — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Swallowed exception (caught, then discarded) Sources/Mooziac/Views/Windows/LaunchAnimationController.swift:134— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:283— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
AC2 · Forms & labels· <optgroup> without a label · ×1
<optgroup> without a label Resources/Extensions/uBlockOriginLite/dashboard.html:157— An <optgroup> groups <option>s but has no label, so assistive tech announces the group with no name. Add a label attribute.
Empty <h2> heading Resources/Extensions/uBlockOriginLite/report.html:21— An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
NowPlayingManager.userContentController (cyclomatic 123) Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:821— NowPlayingManager.userContentController has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KeyboardShortcutHandler.handleKeyDown (cyclomatic 63) Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift:45— KeyboardShortcutHandler.handleKeyDown has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
YTMClient.parseTopTrack (cyclomatic 49) REDACTED:712— YTMClient.parseTopTrack has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DynamicIslandPlayerView.updateState (cyclomatic 49) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:693— DynamicIslandPlayerView.updateState has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LyricsManager.fetchLyrics (cyclomatic 43) Sources/Mooziac/Managers/LyricsManager.swift:281— LyricsManager.fetchLyrics has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistManager.reorderItems (cyclomatic 43) Sources/Mooziac/Managers/PlaylistManager.swift:234— PlaylistManager.reorderItems has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistLibraryView.menu (cyclomatic 43) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:7— PlaylistLibraryView.menu has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EdgeVolumeEngine.handleTouches (cyclomatic 42) Sources/Mooziac/Audio/EdgeVolumeEngine.swift:373— EdgeVolumeEngine.handleTouches 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.
PlaylistManager.appendCurrentPlayingTrack (cyclomatic 37) Sources/Mooziac/Managers/PlaylistManager.swift:472— PlaylistManager.appendCurrentPlayingTrack has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DynamicIslandPlayerView.handleLibraryRowReorderPan (cyclomatic 36) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:656— DynamicIslandPlayerView.handleLibraryRowReorderPan has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
YTMClient.parseTracks (cyclomatic 35) REDACTED:611— YTMClient.parseTracks has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiscordRPCManager.updatePresenceInternal (cyclomatic 33) Sources/Mooziac/Managers/DiscordRPCManager.swift:376— DiscordRPCManager.updatePresenceInternal has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DownloadManager.executeYtDlpDownloadTask (cyclomatic 33) Sources/Mooziac/Managers/DownloadManager.swift:562— DownloadManager.executeYtDlpDownloadTask has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistItemRowCellView.configure (cyclomatic 33) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:389— PlaylistItemRowCellView.configure has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DynamicIslandPlayerView.refreshPlaylistsSection (cyclomatic 33) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:363— DynamicIslandPlayerView.refreshPlaylistsSection has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HistoryRowCellView.configure (cyclomatic 30) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:867— HistoryRowCellView.configure has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DynamicIslandPlayerView.setupUI (cyclomatic 28) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:292— DynamicIslandPlayerView.setupUI 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.
PlaylistManager.removeCurrentPlayingTrackFromPlaylist (cyclomatic 27) Sources/Mooziac/Managers/PlaylistManager.swift:598— PlaylistManager.removeCurrentPlayingTrackFromPlaylist has cyclomatic complexity 27 (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.
LikedSongRowCellView.configure (cyclomatic 27) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1114— LikedSongRowCellView.configure has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DynamicIslandPlayerView.makePlaylistRow (cyclomatic 27) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:888— DynamicIslandPlayerView.makePlaylistRow has cyclomatic complexity 27 (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.
LyricsManager.fetchRawSyncedLRCFromLRCLib (cyclomatic 26) Sources/Mooziac/Managers/LyricsManager.swift:665— LyricsManager.fetchRawSyncedLRCFromLRCLib has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GestureMappingManager.executeAction (cyclomatic 25) Sources/Mooziac/Input/GestureMappingManager.swift:77— GestureMappingManager.executeAction has cyclomatic complexity 25 (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.
PlaylistLibraryView.tableView (cyclomatic 25) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:594— PlaylistLibraryView.tableView has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
HistoryRowView.setupUI (cyclomatic 25) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:655— HistoryRowView.setupUI has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlaylistManager.isCurrentTrackInPlaylist (cyclomatic 24) Sources/Mooziac/Managers/PlaylistManager.swift:566— PlaylistManager.isCurrentTrackInPlaylist has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
YTMClient.fetchDirectStreamURL (cyclomatic 23) REDACTED:853— YTMClient.fetchDirectStreamURL has cyclomatic complexity 23 (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.
PlaylistLibraryView.tableView (cyclomatic 23) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:60— PlaylistLibraryView.tableView has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DynamicIslandPlayerView.updateSettingsThemeHighlight (cyclomatic 23) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:368— DynamicIslandPlayerView.updateSettingsThemeHighlight has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
URLFilter.containsLink (cyclomatic 22) Sources/Mooziac/Web/URLFilter.swift:4— URLFilter.containsLink 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.
CircularProgressDownloadButton.updateVisuals (cyclomatic 22) Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:118— CircularProgressDownloadButton.updateVisuals has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
YouTubeDownloadService.download (cyclomatic 22) Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift:239— YouTubeDownloadService.download has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GestureMappingManager.executeYouTubeAction (cyclomatic 21) Sources/Mooziac/Input/GestureMappingManager.swift:158— GestureMappingManager.executeYouTubeAction has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
StatusItemManager.startEventMonitors (cyclomatic 21) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:599— StatusItemManager.startEventMonitors has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CenteredMenuBarLyricsWindowController.updateLyricsFrame (cyclomatic 21) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:280— CenteredMenuBarLyricsWindowController.updateLyricsFrame has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsPanel+Rows.swift.isTrackPlaying (cyclomatic 21) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:27— SettingsPanel+Rows.swift.isTrackPlaying has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DownloadManager.finalizeSuccessfulJob (cyclomatic 20) Sources/Mooziac/Managers/DownloadManager.swift:707— DownloadManager.finalizeSuccessfulJob has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistManager.startLikedSongsPlayback (cyclomatic 20) Sources/Mooziac/Managers/PlaylistManager.swift:990— PlaylistManager.startLikedSongsPlayback has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PlaylistManager.importPlaylist (cyclomatic 20) Sources/Mooziac/Managers/PlaylistManager.swift:1312— PlaylistManager.importPlaylist has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StatusItemManager.panelDidMove (cyclomatic 20) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:201— StatusItemManager.panelDidMove 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.
YouTubePlayerBridge.userContentController (cyclomatic 20) Sources/Mooziac/YouTube/Web/YouTubePlayerBridge.swift:632— YouTubePlayerBridge.userContentController 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.
DynamicIslandPlayerView.updateDownloadButtonState (cyclomatic 20) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1149— DynamicIslandPlayerView.updateDownloadButtonState has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
KeyboardCommandHandler.handle (cyclomatic 19) Sources/Mooziac/Input/KeyboardCommandHandler.swift:8— KeyboardCommandHandler.handle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SyncedLyricsParser.activeLineAndWord (cyclomatic 19) Sources/Mooziac/Managers/SyncedLyricsParser.swift:112— SyncedLyricsParser.activeLineAndWord has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
YTMClient.parsePlaylistTitle (cyclomatic 19) REDACTED:549— YTMClient.parsePlaylistTitle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainVideoWindowController.headerBarDidTapPlaylists (cyclomatic 19) Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:623— MainVideoWindowController.headerBarDidTapPlaylists has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppArtworkHelper.extractAndDownsample (cyclomatic 18) Sources/Mooziac/Managers/AppArtworkHelper.swift:254— AppArtworkHelper.extractAndDownsample has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LyricsManager.matchScore (cyclomatic 18) Sources/Mooziac/Managers/LyricsManager.swift:130— LyricsManager.matchScore has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistManager.playNextTrackInPlaylist (cyclomatic 18) Sources/Mooziac/Managers/PlaylistManager.swift:1130— PlaylistManager.playNextTrackInPlaylist 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.
YTMClient.extractVideoId (cyclomatic 18) REDACTED:817— YTMClient.extractVideoId 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.
OfflineTrackCellView.configure (cyclomatic 18) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:813— OfflineTrackCellView.configure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CenteredMenuBarLyricsWindowController.handleStateUpdate (cyclomatic 18) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:151— CenteredMenuBarLyricsWindowController.handleStateUpdate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaylistManager.resolve (cyclomatic 17) Sources/Mooziac/Managers/PlaylistManager.swift:706— PlaylistManager.resolve 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.
SyncedLyricsParser.parse (cyclomatic 17) Sources/Mooziac/Managers/SyncedLyricsParser.swift:52— SyncedLyricsParser.parse 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.
PlaylistLibraryView.applyFilter (cyclomatic 17) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:898— PlaylistLibraryView.applyFilter 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.
SwipeToDeleteContainerView.scrollWheel (cyclomatic 17) Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:428— SwipeToDeleteContainerView.scrollWheel 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.
DynamicIslandPlayerView.applyTheme (cyclomatic 17) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:156— DynamicIslandPlayerView.applyTheme 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.
DynamicIslandPlayerView.updateDownloadProgressInVisibleRows (cyclomatic 17) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:615— DynamicIslandPlayerView.updateDownloadProgressInVisibleRows 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.
DetailItemRowView.setupUI (cyclomatic 17) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461— DetailItemRowView.setupUI 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.
GlobalHotKeyManager.registerCarbonHotKeys (cyclomatic 16) Sources/Mooziac/Input/GlobalHotKeyManager.swift:20— GlobalHotKeyManager.registerCarbonHotKeys has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LocalLibraryManager.enumerateFilesystemTracks (cyclomatic 16) Sources/Mooziac/Managers/LocalLibraryManager.swift:186— LocalLibraryManager.enumerateFilesystemTracks 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.
LocalLibraryManager.extractMetadata (cyclomatic 16) Sources/Mooziac/Managers/LocalLibraryManager.swift:285— LocalLibraryManager.extractMetadata 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.
LyricsManager.searchLRCLibFallback (cyclomatic 16) Sources/Mooziac/Managers/LyricsManager.swift:501— LyricsManager.searchLRCLibFallback 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.
LyricsManager.searchLRCLibTitleOnly (cyclomatic 16) Sources/Mooziac/Managers/LyricsManager.swift:542— LyricsManager.searchLRCLibTitleOnly 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.
StatusItemManager.positionCustomWindow (cyclomatic 16) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:273— StatusItemManager.positionCustomWindow has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InteractiveWaveformProgressView.draw (cyclomatic 16) Sources/Mooziac/Views/Components/WaveformProgressView.swift:221— InteractiveWaveformProgressView.draw 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.
PlaylistLibraryView.showLikedSongTrackMenu (cyclomatic 16) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:388— PlaylistLibraryView.showLikedSongTrackMenu has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
No assertions: testYouTubeSettingsDefaultsAndNotifications Tests/MooziacTests/YouTubeVideoTests.swift:194— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
NowPlayingManager.userContentController (cognitive 166) Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:821— NowPlayingManager.userContentController has cognitive complexity 166 (threshold 15). Drivers by points: if/else 48 (86 pts), boolean chains 72, ternaries 5 (7 pts), match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.parseTopTrack (cognitive 136) REDACTED:712— YTMClient.parseTopTrack has cognitive complexity 136 (threshold 15). Drivers by points: if/else 22 (86 pts), loops 8 (27 pts), boolean chains 17, ternaries 1 (6 pts) (nesting depth added 88). 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.
DynamicIslandPlayerView.updateState (cognitive 93) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:693— DynamicIslandPlayerView.updateState has cognitive complexity 93 (threshold 15). Drivers by points: if/else 37 (72 pts), boolean chains 11, ternaries 5 (10 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.reorderItems (cognitive 79) Sources/Mooziac/Managers/PlaylistManager.swift:234— PlaylistManager.reorderItems has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 17, ternaries 4 (16 pts), loops 3 (6 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LyricsManager.fetchLyrics (cognitive 78) Sources/Mooziac/Managers/LyricsManager.swift:281— LyricsManager.fetchLyrics has cognitive complexity 78 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 11, error handling 3 (10 pts), loops 2 (3 pts), match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EdgeVolumeEngine.handleTouches (cognitive 76) Sources/Mooziac/Audio/EdgeVolumeEngine.swift:373— EdgeVolumeEngine.handleTouches has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (59 pts), boolean chains 16, loops 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DynamicIslandPlayerView.handleLibraryRowReorderPan (cognitive 76) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:656— DynamicIslandPlayerView.handleLibraryRowReorderPan has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (56 pts), boolean chains 8, loops 3 (8 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyboardShortcutHandler.handleKeyDown (cognitive 64) Sources/Mooziac/YouTube/Input/KeyboardShortcutHandler.swift:45— KeyboardShortcutHandler.handleKeyDown has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 12, match/switch 5 (10 pts), ternaries 2 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistLibraryView.menu (cognitive 61) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:7— PlaylistLibraryView.menu has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 14, loops 5 (10 pts), ternaries 2 (5 pts), match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.parseTracks (cognitive 57) REDACTED:611— YTMClient.parseTracks has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 17, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DynamicIslandPlayerView.refreshPlaylistsSection (cognitive 53) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:363— DynamicIslandPlayerView.refreshPlaylistsSection has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 8 (20 pts), boolean chains 3, match/switch 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistItemRowCellView.configure (cognitive 52) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:389— PlaylistItemRowCellView.configure has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (32 pts), ternaries 6 (10 pts), boolean chains 8, match/switch 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DownloadManager.executeYtDlpDownloadTask (cognitive 49) Sources/Mooziac/Managers/DownloadManager.swift:562— DownloadManager.executeYtDlpDownloadTask has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 11, loops 2 (5 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryRowCellView.configure (cognitive 49) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:867— HistoryRowCellView.configure has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 10, ternaries 6 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainVideoWindowController.headerBarDidTapPlaylists (cognitive 45) Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:623— MainVideoWindowController.headerBarDidTapPlaylists has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 4 (10 pts), ternaries 1 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiscordRPCManager.updatePresenceInternal (cognitive 42) Sources/Mooziac/Managers/DiscordRPCManager.swift:376— DiscordRPCManager.updatePresenceInternal has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 14, ternaries 2 (4 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.appendCurrentPlayingTrack (cognitive 42) Sources/Mooziac/Managers/PlaylistManager.swift:472— PlaylistManager.appendCurrentPlayingTrack has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 22, if/else 7 (11 pts), ternaries 7 (9 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LikedSongRowCellView.configure (cognitive 41) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1114— LikedSongRowCellView.configure has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 10, ternaries 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyncedLyricsParser.parse (cognitive 39) Sources/Mooziac/Managers/SyncedLyricsParser.swift:52— SyncedLyricsParser.parse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.importPlaylist (cognitive 38) Sources/Mooziac/Managers/PlaylistManager.swift:1312— PlaylistManager.importPlaylist has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 2 (4 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.setupUI (cognitive 38) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:292— DynamicIslandPlayerView.setupUI has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 10, ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.makePlaylistRow (cognitive 38) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:888— DynamicIslandPlayerView.makePlaylistRow has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (25 pts), ternaries 7, boolean chains 6 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlaylistLibraryView.tableView (cognitive 35) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:60— PlaylistLibraryView.tableView has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VisualMatrixSnapshotGenerator.run (cognitive 34) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:5— VisualMatrixSnapshotGenerator.run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (6 pts), error handling 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsManager.fetchRawSyncedLRCFromLRCLib (cognitive 33) Sources/Mooziac/Managers/LyricsManager.swift:665— LyricsManager.fetchRawSyncedLRCFromLRCLib has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 14 (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.
SwipeToDeleteContainerView.scrollWheel (cognitive 33) Sources/Mooziac/Views/Libraries/SwipeToDeleteContainerView.swift:428— SwipeToDeleteContainerView.scrollWheel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DownloadManager.finalizeSuccessfulJob (cognitive 32) Sources/Mooziac/Managers/DownloadManager.swift:707— DownloadManager.finalizeSuccessfulJob has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 4 (8 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.fetchTrackDetails (cognitive 31) REDACTED:250— YTMClient.fetchTrackDetails has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), ternaries 1 (4 pts), error handling 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebExtensionManager.loadSingleExtension (cognitive 31) Sources/Mooziac/YouTube/Extensions/WebExtensionManager.swift:121— WebExtensionManager.loadSingleExtension has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (12 pts), boolean chains 1, error handling 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
KeyboardCommandHandler.handle (cognitive 30) Sources/Mooziac/Input/KeyboardCommandHandler.swift:8— KeyboardCommandHandler.handle has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 10 (13 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.updateDownloadProgressInVisibleRows (cognitive 30) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:615— DynamicIslandPlayerView.updateDownloadProgressInVisibleRows has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 7, loops 2 (4 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.
SettingsPanel+Rows.swift.isTrackPlaying (cognitive 30) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:27— SettingsPanel+Rows.swift.isTrackPlaying has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 13 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppArtworkHelper.extractAndDownsample (cognitive 29) Sources/Mooziac/Managers/AppArtworkHelper.swift:254— AppArtworkHelper.extractAndDownsample has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 7, loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.removeCurrentPlayingTrackFromPlaylist (cognitive 29) Sources/Mooziac/Managers/PlaylistManager.swift:598— PlaylistManager.removeCurrentPlayingTrackFromPlaylist has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 18, if/else 6 (7 pts), ternaries 2 (4 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
YouTubeDownloadService.download (cognitive 29) Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift:239— YouTubeDownloadService.download has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (23 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LyricsManager.fetchFromLRCLib (cognitive 28) Sources/Mooziac/Managers/LyricsManager.swift:458— LyricsManager.fetchFromLRCLib has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 4 (nesting depth added 15). 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.
SyncedLyricsParser.activeLineAndWord (cognitive 28) Sources/Mooziac/Managers/SyncedLyricsParser.swift:112— SyncedLyricsParser.activeLineAndWord has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.parseTimedLyrics::searchTimed (cognitive 28) REDACTED:1055— YTMClient.parseTimedLyrics::searchTimed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), boolean chains 4 (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.
OfflineTrackCellView.configure (cognitive 28) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:813— OfflineTrackCellView.configure has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 6 (11 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CenteredMenuBarLyricsWindowController.updateLyricsFrame (cognitive 28) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:280— CenteredMenuBarLyricsWindowController.updateLyricsFrame has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalLibraryManager.enumerateFilesystemTracks (cognitive 27) Sources/Mooziac/Managers/LocalLibraryManager.swift:186— LocalLibraryManager.enumerateFilesystemTracks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.parsePlaylistTitle (cognitive 27) REDACTED:549— YTMClient.parsePlaylistTitle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
URLFilter.containsLink (cognitive 27) Sources/Mooziac/Web/URLFilter.swift:4— URLFilter.containsLink has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (11 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PlaylistLibraryView.tableView (cognitive 27) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:594— PlaylistLibraryView.tableView has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 12, error handling 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.resetPlaylistSectionChrome (cognitive 27) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:28— DynamicIslandPlayerView.resetPlaylistSectionChrome has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryRowView.setupUI (cognitive 27) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:655— HistoryRowView.setupUI has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts), ternaries 5, match/switch 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LocalLibraryManager.extractMetadata (cognitive 26) Sources/Mooziac/Managers/LocalLibraryManager.swift:285— LocalLibraryManager.extractMetadata has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CircularProgressDownloadButton.updateVisuals (cognitive 26) Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:118— CircularProgressDownloadButton.updateVisuals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, ternaries 3 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.applyTheme (cognitive 26) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift:156— DynamicIslandPlayerView.applyTheme has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 5 (7 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateManager.showUpdateAvailableAlert (cognitive 25) Sources/Mooziac/Managers/UpdateManager.swift:231— UpdateManager.showUpdateAvailableAlert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). Of this number, 13 points are the body's own statements and 12 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainViewController.findBestLocalTrack (cognitive 24) Sources/Mooziac/Core/MainViewController.swift:406— MainViewController.findBestLocalTrack has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiscordRPCManager.drainSocket (cognitive 24) Sources/Mooziac/Managers/DiscordRPCManager.swift:305— DiscordRPCManager.drainSocket has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistFileCodec.decodeM3U (cognitive 24) Sources/Mooziac/Managers/PlaylistFileCodec.swift:121— PlaylistFileCodec.decodeM3U has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.resolve (cognitive 24) Sources/Mooziac/Managers/PlaylistManager.swift:706— PlaylistManager.resolve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5 (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.
NativeCapsuleToggleView.updateVisuals (cognitive 24) Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:52— NativeCapsuleToggleView.updateVisuals has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InteractiveWaveformProgressView.draw (cognitive 24) Sources/Mooziac/Views/Components/WaveformProgressView.swift:221— InteractiveWaveformProgressView.draw has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (7 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.isCurrentTrackInPlaylist (cognitive 23) Sources/Mooziac/Managers/PlaylistManager.swift:566— PlaylistManager.isCurrentTrackInPlaylist has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 17, if/else 4, ternaries 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.
YTMClient.fetchDirectStreamURL (cognitive 23) REDACTED:853— YTMClient.fetchDirectStreamURL has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 10, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CenteredMenuBarLyricsWindowController.handleStateUpdate (cognitive 23) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:151— CenteredMenuBarLyricsWindowController.handleStateUpdate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, 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.
DownloadManager.extractErrorMessage (cognitive 22) Sources/Mooziac/Managers/DownloadManager.swift:1046— DownloadManager.extractErrorMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, ternaries 1 (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.
PlaylistManager.playNextTrackInPlaylist (cognitive 22) Sources/Mooziac/Managers/PlaylistManager.swift:1130— PlaylistManager.playNextTrackInPlaylist has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UpdateManager.processReleasePayload (cognitive 22) Sources/Mooziac/Managers/UpdateManager.swift:113— UpdateManager.processReleasePayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.findFirstString (cognitive 22) REDACTED:499— YTMClient.findFirstString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemManager.panelDidMove (cognitive 22) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:201— StatusItemManager.panelDidMove has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlaylistLibraryView.applyFilter (cognitive 22) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:898— PlaylistLibraryView.applyFilter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, match/switch 1 (nesting depth added 5). 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.
DynamicIslandPlayerView.updateSettingsThemeHighlight (cognitive 22) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:368— DynamicIslandPlayerView.updateSettingsThemeHighlight has cognitive complexity 22 (threshold 15). Drivers by points: loops 7, if/else 5 (6 pts), ternaries 5, boolean chains 3, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeAudioPlayer.handleTrackDeleted (cognitive 21) Sources/Mooziac/Audio/NativeAudioPlayer.swift:101— NativeAudioPlayer.handleTrackDeleted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsManager.matchScore (cognitive 21) Sources/Mooziac/Managers/LyricsManager.swift:130— LyricsManager.matchScore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6 (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.
PlaylistManager.startLikedSongsPlayback (cognitive 21) Sources/Mooziac/Managers/PlaylistManager.swift:990— PlaylistManager.startLikedSongsPlayback has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (6 pts), ternaries 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VisualMatrixVideoGenerator.run (cognitive 21) Sources/Mooziac/Support/VisualMatrixVideoGenerator.swift:7— VisualMatrixVideoGenerator.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemManager.startEventMonitors (cognitive 21) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:599— StatusItemManager.startEventMonitors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GlassSearchField.performKeyEquivalent (cognitive 21) Sources/Mooziac/Views/Components/GlassSearchField.swift:262— GlassSearchField.performKeyEquivalent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DownloadRowCellView.configure (cognitive 21) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:658— DownloadRowCellView.configure has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7, boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlaylistLibraryView.reloadVisiblePlayingStates (cognitive 21) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:426— PlaylistLibraryView.reloadVisiblePlayingStates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryManager.fetchHistory (cognitive 20) Sources/Mooziac/Managers/HistoryManager.swift:87— HistoryManager.fetchHistory has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 4, if/else 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.
LocalDatabaseManager.recordHistoryItem (cognitive 20) Sources/Mooziac/Managers/LocalDatabaseManager.swift:1289— LocalDatabaseManager.recordHistoryItem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5 (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.
StatusItemManager.statusItemClicked (cognitive 20) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:339— StatusItemManager.statusItemClicked has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YouTubePlayerBridge.userContentController (cognitive 20) Sources/Mooziac/YouTube/Web/YouTubePlayerBridge.swift:632— YouTubePlayerBridge.userContentController has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppArtworkHelper.getCompressedDefaultArtwork (cognitive 19) Sources/Mooziac/Managers/AppArtworkHelper.swift:34— AppArtworkHelper.getCompressedDefaultArtwork has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalDatabaseManager.deleteTracks (cognitive 19) Sources/Mooziac/Managers/LocalDatabaseManager.swift:618— LocalDatabaseManager.deleteTracks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsManager.searchLRCLibFallback (cognitive 19) Sources/Mooziac/Managers/LyricsManager.swift:501— LyricsManager.searchLRCLibFallback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8 (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.
PlaylistManager.extractVideoID (cognitive 19) Sources/Mooziac/Managers/PlaylistManager.swift:1272— PlaylistManager.extractVideoID has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.extractLyricsBrowseId::search (cognitive 19) REDACTED:1031— YTMClient.extractLyricsBrowseId::search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.parsePlainLyrics::searchPlain (cognitive 19) REDACTED:1086— YTMClient.parsePlainLyrics::searchPlain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatusItemManager.positionCustomWindow (cognitive 19) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:273— StatusItemManager.positionCustomWindow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StatusItemManager.handleScrollEvent (cognitive 19) Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:706— StatusItemManager.handleScrollEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DownloadManager.executeDownloadTask (cognitive 18) Sources/Mooziac/Managers/DownloadManager.swift:447— DownloadManager.executeDownloadTask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalDatabaseManager.replacePlaylistItems (cognitive 18) Sources/Mooziac/Managers/LocalDatabaseManager.swift:1067— LocalDatabaseManager.replacePlaylistItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsManager.searchLRCLibTitleOnly (cognitive 18) Sources/Mooziac/Managers/LyricsManager.swift:542— LyricsManager.searchLRCLibTitleOnly has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistLibraryView.handleExportPlaylist (cognitive 18) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:329— PlaylistLibraryView.handleExportPlaylist has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (6 pts), boolean chains 5, if/else 3 (4 pts), error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.updateDownloadButtonState (cognitive 18) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:1149— DynamicIslandPlayerView.updateDownloadButtonState has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6, match/switch 1 (2 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DetailItemRowView.setupUI (cognitive 18) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:461— DetailItemRowView.setupUI has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (4 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GestureMappingManager.executeAction (cognitive 17) Sources/Mooziac/Input/GestureMappingManager.swift:77— GestureMappingManager.executeAction has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (7 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.planDownloads (cognitive 17) Sources/Mooziac/Managers/PlaylistManager.swift:787— PlaylistManager.planDownloads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlaylistManager.summaryForPlaylist (cognitive 17) Sources/Mooziac/Managers/PlaylistManager.swift:841— PlaylistManager.summaryForPlaylist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YTMClient.extractVideoId (cognitive 17) REDACTED:817— YTMClient.extractVideoId has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PlaylistLibraryView.reload (cognitive 17) Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:714— PlaylistLibraryView.reload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CenteredMenuBarLyricsWindowController.scheduleNextLyricsFrame (cognitive 17) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:215— CenteredMenuBarLyricsWindowController.scheduleNextLyricsFrame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MooziacHeaderBarView.updatePlaybackState (cognitive 17) Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:238— MooziacHeaderBarView.updatePlaybackState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DynamicIslandPlayerView.applyMountedRowState (cognitive 17) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:557— DynamicIslandPlayerView.applyMountedRowState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIslandPlayerView.renderPlaylistDetail (cognitive 17) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:769— DynamicIslandPlayerView.renderPlaylistDetail has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobalHotKeyManager.registerCarbonHotKeys (cognitive 16) Sources/Mooziac/Input/GlobalHotKeyManager.swift:20— GlobalHotKeyManager.registerCarbonHotKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 3). 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.
DownloadManager.queueTracks (cognitive 16) Sources/Mooziac/Managers/DownloadManager.swift:305— DownloadManager.queueTracks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DownloadManager.urlSession (cognitive 16) Sources/Mooziac/Managers/DownloadManager.swift:1282— DownloadManager.urlSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (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.
LyricsManager.bestPassingResult (cognitive 16) Sources/Mooziac/Managers/LyricsManager.swift:177— LyricsManager.bestPassingResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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.
NowPlayingManager.setupRemoteCommands (cognitive 16) Sources/Mooziac/Core/NowPlayingManager/NowPlayingManager.swift:391— NowPlayingManager.setupRemoteCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 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.
HistoryRowView.updatePlayingAppearance (cognitive 16) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:621— HistoryRowView.updatePlayingAppearance has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: PlaylistLibraryView.swift ↔ ArtworkTheme.swift Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1— `Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/ArtworkTheme.swift` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `d8955380` fix(theme): dynamic high-contrast adaptivity for Watery theme in Ligh…; `d6113a21` Implement Apple Control Center 3D curved meniscus rim and horizontal …; `0a4e166f` Remove Theme 4 (.native) completely; streamline to 4 distinct themes — run `git show` on any of them.
D4 · Code Duplication· Near-duplicate member family (5 members, 30 shared lines) · ×1
Near-duplicate member family (5 members, 30 shared lines) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:911— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:911-986 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:7-77 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:79-160 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:162-226 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:228-293 — These 5 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 29 shared lines) · ×1
Near-duplicate member family (4 members, 29 shared lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:13— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:13-106 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:128-203 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:216-280 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:282-354 — These 4 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 27 shared lines) · ×1
Near-duplicate member family (4 members, 27 shared lines) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:120— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:120-152 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:427-459 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:621-653 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:806-838 — These 4 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 25 shared lines) · ×1
Near-duplicate member family (4 members, 25 shared lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:389— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:389-503 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:658-711 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:867-959 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1114-1194 — These 4 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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.
Near-duplicate member pair (84 shared lines) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:53— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:53-249 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:113-360 — These two members are variants of one another: 84 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) Sources/Mooziac/Managers/LocalDatabaseManager.swift:778— Sources/Mooziac/Managers/LocalDatabaseManager.swift:778-788 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:806-816 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:985-997 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:999-1009 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1153-1164 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1238-1248 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1250-1261 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1263-1273 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1289-1356 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1436-1453 — These 10 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 10 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 10 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:7— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:7-327 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:317-386 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:388-473 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:502-555 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:7-77 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:79-160 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:162-226 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:228-293 — These 8 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 8 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 8 times.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) Sources/Mooziac/Managers/LyricsManager.swift:501— Sources/Mooziac/Managers/LyricsManager.swift:501-540 | Sources/Mooziac/Managers/LyricsManager.swift:542-576 — These two members are one piece of code written twice and then edited apart: 35 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 (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) Sources/Mooziac/Managers/PlaylistManager.swift:566— Sources/Mooziac/Managers/PlaylistManager.swift:566-596 | Sources/Mooziac/Managers/PlaylistManager.swift:598-637 — These two members are one piece of code written twice and then edited apart: 31 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:232— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:232-281 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:508-571 — These two members are one piece of code written twice and then edited apart: 50 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 (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) REDACTED:974— REDACTED:974-1028 | REDACTED:1107-1173 — These two members are one piece of code written twice and then edited apart: 55 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) · ×1
Edited copy of a member (32 corresponding lines) Sources/Mooziac/Managers/PlaylistManager.swift:374— Sources/Mooziac/Managers/PlaylistManager.swift:374-405 | Sources/Mooziac/Managers/PlaylistManager.swift:407-442 — 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 (3 members, 36+ corresponding lines) · ×1
Edited copies of one member (3 members, 36+ corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:465— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:465-500 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:975-1015 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1047-1086 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 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 (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:283— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:283-316 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:573-606 — 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 (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:73— Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift:73-105 | Sources/Mooziac/YouTube/Views/FloatingHUDWindowController.swift:35-71 — 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 (122 corresponding lines) · ×1
Edited copy of a member (122 corresponding lines) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:45— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:45-201 | Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:303-424 — These two members are one piece of code written twice and then edited apart: 122 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 (125 corresponding lines) · ×1
Edited copy of a member (125 corresponding lines) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:426— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:426-568 | Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:570-694 — These two members are one piece of code written twice and then edited apart: 125 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:288— Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:288-308 | Sources/Mooziac/Support/VisualMatrixVideoGenerator.swift:356-370 — 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 (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) Sources/Mooziac/Views/Components/GlassSearchField.swift:239— Sources/Mooziac/Views/Components/GlassSearchField.swift:239-260 | Sources/Mooziac/Views/Components/GlassSearchField.swift:296-317 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) Sources/Mooziac/Managers/DownloadManager.swift:1090— Sources/Mooziac/Managers/DownloadManager.swift:1090-1127 | Sources/Mooziac/Managers/DownloadManager.swift:1129-1165 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:365— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:365-384 | Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:394-416 — 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 (6 members, 11+ corresponding lines) · ×1
Edited copies of one member (6 members, 11+ corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:729— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:729-742 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:744-757 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:759-772 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:328-338 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:422-432 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:511-521 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) Sources/Mooziac/Core/MainViewController.swift:159— Sources/Mooziac/Core/MainViewController.swift:159-184 | Sources/Mooziac/Core/MainViewController.swift:186-211 — These two members are one piece of code written twice and then edited apart: 26 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 (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:800— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:800-847 | Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:871-916 — These two members are one piece of code written twice and then edited apart: 46 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, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) Sources/Mooziac/Managers/LocalDatabaseManager.swift:145— Sources/Mooziac/Managers/LocalDatabaseManager.swift:145-167 | Sources/Mooziac/Models/LikedSongRecord.swift:14-32 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:15-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) Sources/Mooziac/Managers/AppArtworkHelper.swift:89— Sources/Mooziac/Managers/AppArtworkHelper.swift:89-100 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:197-208 | Sources/Mooziac/Managers/LocalLibraryManager.swift:82-93 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:124-131 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:435— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:435-450 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:953-973 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1395-1414 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:418— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:418-433 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:1151-1165 | Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:902-914 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 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) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:844— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:844-854 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:948-958 — 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 copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) Sources/Mooziac/Managers/PlaylistManager.swift:125— Sources/Mooziac/Managers/PlaylistManager.swift:125-136 | Sources/Mooziac/Managers/PlaylistManager.swift:138-146 | Sources/Mooziac/Managers/PlaylistManager.swift:148-155 — 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 (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:415— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:415-420 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:493-499 — 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.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×1
Edited copies of one member (4 members, 14+ corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:74— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:74-87 | Sources/Mooziac/Views/Components/WaveformProgressView.swift:135-148 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:37-50 | Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:334-347 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 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, 43+ corresponding lines) · ×1
Edited copies of one member (3 members, 43+ corresponding lines) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:1009— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:1009-1065 | Sources/Mooziac/Core/NowPlayingManager/Queue.swift:437-479 | Sources/Mooziac/Core/NowPlayingManager/Queue.swift:481-532 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 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 (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:20— Sources/Mooziac/Views/Components/NativeCapsuleStepToggleView.swift:20-23 | Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift:22-25 — 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.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) Sources/Mooziac/Core/MainViewController.swift:27— Sources/Mooziac/Core/MainViewController.swift:27-29 | Sources/Mooziac/YouTube/Views/YouTubeDownloadSheetController.swift:70-73 — These two members are one piece of code written twice and then edited apart: 3 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, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:459— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:459-463 | Sources/Mooziac/Managers/UpdateManager.swift:394-398 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel.swift:826-830 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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.
Duplicated block (64 lines × 2) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:65— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:65-128 | Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:314-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:310` calls `play` and `Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:62` 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 (57 lines × 2) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:440— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:440-496 | Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:584-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:440` 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 (54 lines × 2) Sources/Mooziac/Core/NowPlayingManager/Queue.swift:7— Sources/Mooziac/Core/NowPlayingManager/Queue.swift:7-60 | Sources/Mooziac/Core/NowPlayingManager/Queue.swift:198-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/Queue.swift:7` 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 (52 lines × 2) Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:701— Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift:701-752 | Sources/Mooziac/YouTube/Core/MainVideoWindowController.swift:826-877 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/PlayerControls.swift: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. 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 (47 lines × 2) Sources/Mooziac/Web/YTMWebView.swift:976— Sources/Mooziac/Web/YTMWebView.swift:976-1022 | Sources/Mooziac/Web/YTMWebView.swift:1040-1086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Web/YTMWebView.swift:1040` 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 (24 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:261— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:261-284 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:539-562 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:749-772 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:997-1020 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:285— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:285-307 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:563-585 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:773-795 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1022-1044 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (23 lines × 2) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:679— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:679-701 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:54-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:481— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:481-499 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:941-958 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1176-1193 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:941` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `PlaylistItemRecord` in one and `HistoryRecord` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 3) Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:96— Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:96-115 | Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:130-149 | Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:164-183 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18 lines × 5) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:710— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:710-727 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:301-318 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:579-596 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:789-806 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1038-1055 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (18 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:123— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:123-140 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:430-447 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:624-641 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:809-826 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:466— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:466-483 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift:976-993 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1048-1065 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:466` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–18 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:653— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:653-670 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:554-570 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 3) REDACTED:896— REDACTED:896-912 | REDACTED:1001-1017 | REDACTED:1145-1161 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:896` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<DirectStreamResult, Error>) -> Void` in one and `@escaping (Result<[LRCLine], Error>) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1480— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1480-1496 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1500-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1480` 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 × 6) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:684— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:684-699 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:59-74 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:264-279 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:542-557 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:752-767 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1000-1015 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:496— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:496-510 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:692-706 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:874-888 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:89— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:89-102 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:186-199 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:263-276 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Appearance.swift:334-347 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–14 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:945— Sources/Mooziac/Managers/LocalDatabaseManager.swift:945-953 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:454-467 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:945` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:674— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:674-687 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:858-870 — both copies are in the same file, so extract the 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 (13 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:337— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:337-349 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:612-624 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:822-834 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:352` calls `addSubview` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:628` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–13 lines × 2) Sources/Mooziac/Audio/NativeAudioPlayer.swift:156— Sources/Mooziac/Audio/NativeAudioPlayer.swift:156-166 | Sources/Mooziac/Audio/NativeAudioPlayer.swift:179-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Audio/NativeAudioPlayer.swift:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:437— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:437-449 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:630-642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 3) REDACTED:130— REDACTED:130-140 | REDACTED:890-901 | REDACTED:995-1006 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<[String: Any], Error>) -> Void` in one and `@escaping (Result<DirectStreamResult, Error>) -> Void` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 3) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:440— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:440-451 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:633-644 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:779-790 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:440` 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–12 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:232— Sources/Mooziac/Managers/LocalDatabaseManager.swift:232-243 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:294-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:232` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 3) Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:189— Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:189-199 | Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:233-241 | Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:253-261 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Support/VisualMatrixSnapshotGenerator.swift:189` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `appearance` to `appMode.appearance) let fileF = "\(themeItem.name)_Drawer_Offline_Downloads_\(appMode.name).png" let pathF = themeDir.appendingPathComponent(fileF) if saveViewSnapshot(offlineView` in one and `NSAppearance?) -> (NSView` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 4) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:352— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:352-367 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:626-641 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:836-851 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1080-1095 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1096` calls `constraint` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:369` 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 (9–10 lines × 2) Sources/Mooziac/Managers/LocalDatabaseManager.swift:602— Sources/Mooziac/Managers/LocalDatabaseManager.swift:602-611 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:647-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:602` 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 (31 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:157— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:157-187 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:419-449 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:450` calls `firstIndex` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:188` 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 (9 lines × 6) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:709— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:709-717 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:83-91 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:300-308 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:578-586 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:788-796 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1037-1045 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (2–9 lines × 3) Sources/Mooziac/Managers/LyricsManager.swift:506— Sources/Mooziac/Managers/LyricsManager.swift:506-514 | Sources/Mooziac/Managers/LyricsManager.swift:546-554 | Sources/Mooziac/Managers/LyricsManager.swift:707-708 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LyricsManager.swift:506` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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, `Sources/Mooziac/Managers/LyricsManager.swift:514` calls `jsonObject` and `Sources/Mooziac/Managers/LyricsManager.swift:708` 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 (4–9 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:167— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:167-170 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:474-477 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:662-670 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:847-854 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:670` calls `rowPlayIconColor` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift:170` does not — after which the two agree again for 5 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 × 5) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:979— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:979-986 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:70-77 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:153-160 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:219-226 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:286-293 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:979` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 5) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:573— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:573-582 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:591-600 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:612-621 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:465-474 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:483-492 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:573` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 3) Sources/Mooziac/Managers/LocalDatabaseManager.swift:504— Sources/Mooziac/Managers/LocalDatabaseManager.swift:504-517 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:820-831 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:853-864 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–14 lines × 3) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1040— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1040-1053 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1059-1067 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1079-1087 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1040` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1090` calls `constraint` and `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift:1056` 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 (3–8 lines × 3) Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:263— Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:263-265 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:366-373 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:533-540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:366` 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 × 11) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:81— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:81-87 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:149-155 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:226-232 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:297-303 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:335-341 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:411-417 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:525-531 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:36-42 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:108-114 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:191-197 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:257-263 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 8) Sources/Mooziac/Managers/LocalDatabaseManager.swift:781— Sources/Mooziac/Managers/LocalDatabaseManager.swift:781-787 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:809-815 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1002-1008 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1156-1162 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1241-1247 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1266-1272 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1296-1302 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1307-1313 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Managers/LocalDatabaseManager.swift:790` calls `isLikedSong` and `Sources/Mooziac/Managers/LocalDatabaseManager.swift:1316` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 5) Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:503— Sources/Mooziac/Core/StatusItemManager/ContextMenu.swift:503-509 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:1022-1027 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:863-869 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:968-974 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:1002-1008 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 5) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:949— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:949-955 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:44-50 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:116-122 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:199-205 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:265-271 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6–7 lines × 4) Sources/Mooziac/Managers/LocalDatabaseManager.swift:506— Sources/Mooziac/Managers/LocalDatabaseManager.swift:506-512 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:821-826 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:854-859 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:396-401 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:506` 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–7 lines × 3) Sources/Mooziac/Input/KeyboardCommandHandler.swift:86— Sources/Mooziac/Input/KeyboardCommandHandler.swift:86-91 | Sources/Mooziac/Views/Components/WaveformProgressView.swift:348-353 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:837-843 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:931— Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:931-941 | Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:957-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:957` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:234— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:234-253 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:343-362 — before extracting anything, compare `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:363` calls `firstIndex` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:254` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:773— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:773-779 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:785-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift:785` 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 × 6) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:328— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:328-333 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:404-409 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:518-523 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:29-34 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:101-106 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:184-189 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:27` calls `SymbolConfiguration`, `NSImage`, `withSymbolConfiguration` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift:327` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:131— Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:131-136 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:143-148 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:209-214 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:276-281 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–6 lines × 3) Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:80— Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:80-89 | Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:118-123 | Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:156-159 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:92` calls `NSColor` and `Sources/Mooziac/Views/Windows/RatingPromptWindowController.swift:162` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 25) Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:923— Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:923-927 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:930-934 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:970-974 | Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:979-983 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:11-15 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:18-22 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:25-29 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:61-65 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:70-74 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:83-87 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:90-94 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:97-101 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:131-135 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:143-147 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:153-157 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:166-170 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:173-177 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:180-184 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:209-213 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:219-223 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:232-236 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:239-243 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:246-250 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:276-280 | Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift:286-290 — there are 25 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 25 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:976` calls `addItem`, `separator` and `Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:929` 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 (5 lines × 9) Sources/Mooziac/Managers/LocalDatabaseManager.swift:779— Sources/Mooziac/Managers/LocalDatabaseManager.swift:779-783 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:807-811 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:986-990 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1000-1004 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1154-1158 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1239-1243 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1251-1255 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1264-1268 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:1440-1444 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:779` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Managers/LocalDatabaseManager.swift:992` calls `sqlite3_bind_double`, `Date`, `sqlite3_bind_text` and `Sources/Mooziac/Managers/LocalDatabaseManager.swift:785` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) Sources/Mooziac/Managers/LocalDatabaseManager.swift:507— Sources/Mooziac/Managers/LocalDatabaseManager.swift:507-512 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:822-826 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:855-859 | Sources/Mooziac/Managers/LocalDatabaseManager.swift:946-950 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:397-401 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:460-464 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:507` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/Mooziac/Managers/LocalDatabaseManager.swift:513` calls `String`, `sqlite3_column_text` and `Sources/Mooziac/Managers/LocalDatabaseManager.swift:951` 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 (3–5 lines × 4) Sources/Mooziac/Managers/LocalDatabaseManager.swift:199— Sources/Mooziac/Managers/LocalDatabaseManager.swift:199-203 | Sources/Mooziac/Managers/LocalLibraryManager.swift:51-55 | Sources/Mooziac/Managers/LocalLibraryManager.swift:84-88 | Sources/Mooziac/YouTube/Database/YouTubeDatabaseManager.swift:124-126 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LocalDatabaseManager.swift:199` 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 × 3) Sources/Mooziac/Managers/LyricsManager.swift:479— Sources/Mooziac/Managers/LyricsManager.swift:479-483 | Sources/Mooziac/Managers/LyricsManager.swift:523-527 | Sources/Mooziac/Managers/LyricsManager.swift:562-565 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/LyricsManager.swift:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (3–5 lines × 6) Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:433— Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:433-437 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:439-441 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:686-690 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:692-694 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:912-915 | Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:1148-1151 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:910` calls `NSColor` and `Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift:431` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) Sources/Mooziac/Managers/PlaylistManager.swift:572— Sources/Mooziac/Managers/PlaylistManager.swift:572-576 | Sources/Mooziac/Managers/PlaylistManager.swift:590-594 | Sources/Mooziac/Managers/PlaylistManager.swift:605-609 | Sources/Mooziac/Managers/PlaylistManager.swift:624-628 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/Mooziac/Managers/PlaylistManager.swift:572` 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.
Swallowed exception (empty catch) Sources/Mooziac/Managers/DownloadManager.swift:986— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated predicate Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift:168— `!isDownloaded && !record.videoId.isEmpty` appears character-identically in 3 files — Sources/Mooziac/Views/Libraries/PlaylistLibraryView+ContextMenu.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView+TableView.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+ContextMenu.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Managers/HistoryManager.swift:94— `!state.artist.isEmpty && state.artist != "YouTube Music"` appears character-identically in 2 files — Sources/Mooziac/Managers/HistoryManager.swift, Sources/Mooziac/Managers/PlaylistManager.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Managers/DiscordRPCManager.swift:384— `!state.title.isEmpty && state.title != "Not Playing"` appears character-identically in 6 files — Sources/Mooziac/Managers/DiscordRPCManager.swift, Sources/Mooziac/Managers/HistoryManager.swift, Sources/Mooziac/Managers/PlaylistManager.swift, Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift:1067— `!title.isEmpty && title != "Not Playing"` appears character-identically in 3 files — Sources/Mooziac/Core/NowPlayingManager/ObserverBridge.swift, Sources/Mooziac/Managers/HistoryManager.swift, Sources/Mooziac/Managers/PlaylistManager.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:414— `$0.title.lowercased().contains(query) || $0.artist.lowercased().contains(query) || $0.album.lowercased().contains(query)` appears character-identically in 2 files — Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift:119— `PlayerDesign.current == .glassMode || (PlayerDesign.current == .liquidFluid && !SystemAppearanceHelper.isDarkSystemAppearance)` appears character-identically in 7 files — Sources/Mooziac/Views/Components/CircularProgressDownloadButton.swift, Sources/Mooziac/Views/Components/GlassSearchField.swift, Sources/Mooziac/Views/Components/NativeCapsuleToggleView.swift, Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:790— `PlayerDesign.current == .liquidFluid && SystemAppearanceHelper.isDarkSystemAppearance` appears character-identically in 4 files — Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Drawers.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/SettingsPanel+Rows.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Managers/DownloadManager.swift:265— `cleanA.isEmpty || track.artist.lowercased() == cleanA.lowercased() || track.cleanArtist.lowercased() == cleanA.lowercased()` appears character-identically in 2 files — Sources/Mooziac/Managers/DownloadManager.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Components/GlassSearchField.swift:199— `design == .glassMode || (design == .liquidFluid && !SystemAppearanceHelper.isDarkSystemAppearance)` appears character-identically in 3 files — Sources/Mooziac/Views/Components/GlassSearchField.swift, Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:839— `design == .liquidFluid && SystemAppearanceHelper.isDarkSystemAppearance` appears character-identically in 2 files — Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift:896— `event.keyCode == 51 || event.keyCode == 117` appears character-identically in 2 files — Sources/Mooziac/Views/Libraries/OfflineLibraryView.swift, Sources/Mooziac/Views/Libraries/PlaylistLibraryView+Cells.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Managers/DownloadManager.swift:266— `matchTitle && (cleanA.isEmpty || matchArtist)` appears character-identically in 2 files — Sources/Mooziac/Managers/DownloadManager.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift:621— `responder is NSText || responder is NSTextView || responder is NSTextField || responder is NSSearchField` appears character-identically in 2 files — Sources/Mooziac/Core/StatusItemManager/StatusItemManager.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Core/DisplayManager.swift:78— `screen.safeAreaInsets.top > 0 || screen.auxiliaryTopLeftArea != nil` appears character-identically in 2 files — Sources/Mooziac/Core/DisplayManager.swift, Sources/Mooziac/Views/Windows/CenteredMenuBarLyricsWindowController.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/Mooziac/Managers/DownloadManager.swift:264— `track.title.lowercased() == cleanT.lowercased() || track.cleanTitle.lowercased() == cleanT.lowercased()` appears character-identically in 2 files — Sources/Mooziac/Managers/DownloadManager.swift, Sources/Mooziac/Views/Player/DynamicIslandPlayerView/Core.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.
Fat interface: MooziacHeaderBarDelegate (18 requirements) Sources/Mooziac/YouTube/Views/MooziacHeaderBarView.swift:4— `MooziacHeaderBarDelegate` declares 18 requirements: `headerBarDidTapClose`, `headerBarDidTapQuit`, `headerBarDidTapMinimize`, `headerBarDidTapBack`, `headerBarDidTapForward`, `headerBarDidTapReload`, `headerBarDidTapCaptions`, `headerBarDidTapLike`, `headerBarDidTapPlaylists`, `headerBarDidTapHistory`, `headerBarDidTapDownload`, `headerBarDidTapSpeedPicker`, `headerBarDidTapBestPart`, `headerBarDidTapQualityPicker`, `headerBarDidTapShield`, `headerBarDidTapPiP`, `headerBarDidTapTheater`, `headerBarDidTapFullscreen`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
No ADRs found Package.swift:10— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Package.swift` makes this repository a deployable product (line 10).
D28 · Secrets (history)· Rotate the exposed credentials · ×1
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST REDACTED:11— 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 2 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.
Silent fallback default in catch Resources/Extensions/uBlockOriginLite/js/static-filtering-parser.js:2927— `normalizeHostnameValue` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 2 file(s) — `Sources/Mooziac/Managers/DownloadManager.swift`, `Sources/Mooziac/YouTube/Services/YouTubeDownloadService.swift` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Swift Package.swift/Package.resolved — not scanned yet).
0
—
Run 01a1e635-c127-7b45-930b-54a779ef311e · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 46 · Warnings: 607 · Recommendations: 22 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 21:14 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.