Public report of nomadkaraoke/karaoke-gen, published 17 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, 17 November 2026, 18:11 UTC · Survey ID cd_14d20ae07ffd4051beaf96b03d101c5d
nomadkaraoke/karaoke-gen
Measured 17 November 2026, 18:10 UTC, at code version 5bf17d5
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureRepoBuildError).
Test reliability is not measured: The JS/TS suite's lockfile was refused.
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 229,397 lines of product code in 16 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Production Readiness, 29.5
Findings by how serious they are
289 critical1977 serious273 minor
12 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
17 November 2026, 18:10 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.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
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 ▸
79of 79 dimensions measured by tools.
2506of 2539 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
79dimensions across 7 lenses, read from 229,397 lines of product code in 16 projects.
nomadkaraoke/karaoke-gen is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because three passwords or keys sit in the current code and it has packages under a licence on your banned list. It scores 41.2 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Production Readiness, at 29.5, is the weakest lens and counts most in the score. The best first steps are replacing the three exposed passwords or keys and switching the old ones off and replacing the ten packages under a banned licence, each worth about 10.1 points. Raising Production Readiness to 62 would lift the score to about 50.6.
105 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fifty-two known security holes in the packages the code depends on can be used by attackers, and thirty secrets can leak from the build pipeline. Pinning each tool to an exact version, updating the vulnerable packages and limiting each secret to its own step would close these risks. Passing outside input through environment variables would fix the seven pipeline steps that put outside input straight into a shell command, and the 14 pipeline steps that run downloads without checking them need each download checked against a known checksum first. The 23 controls that only work with a mouse need to work with the keyboard, or to become a real button.
The product code is 229,397 lines, about €320,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 Production Readiness rose from 29.5 to 62, the lowest score rated Strong, the score would rise from 41.2 to about 50.6.
Code composition: what the lines of code are
Product code 55%Tests 45%
Rebuild cost: about €320,000 · Estimate
Cost to rebuild
€110,000 to €530,000, for 1,766 to 5,604 hours of work, about 2.2 person-years for 1 to 5 engineers
Difficulty of the problem
Low, 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 41. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 229,397 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 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 10.1 points · Low effort · Secret Scanning
2
Resolve the 10 Banned license finding(s) in License Compliance.
Raises the score by about 10.1 points · Medium effort · License Compliance
3
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 2.4 points · Medium effort · Keyboard semantics
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 €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Production Readiness, at 29.5 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 3 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 10.1 points for low effort, because it clears the 3 Secret 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 5.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 185,501 lines over the last 90 days, which is about 752,310 lines a year. At that pace, the extra work comes to an estimated 120.9 to 725.3 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.
607 modules, with 524 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 567 more are left out to keep it readable.
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.
backend.eval.custom_lyrics uses backend.services.custom_lyrics.service, so a change to backend.services.custom_lyrics.service can break backend.eval.custom_lyrics, while a change to backend.eval.custom_lyrics can't break backend.services.custom_lyrics.service.
Position
Below the diagonal: backend.eval.custom_lyrics uses a module listed above it, which is the healthy direction.
backend.services.custom_lyrics uses backend.services.custom_lyrics.service, so a change to backend.services.custom_lyrics.service can break backend.services.custom_lyrics, while a change to backend.services.custom_lyrics can't break backend.services.custom_lyrics.service.
Position
Below the diagonal: backend.services.custom_lyrics uses a module listed above it, which is the healthy direction.
backend.services.firestore_service uses backend.models.job, so a change to backend.models.job can break backend.services.firestore_service, while a change to backend.services.firestore_service can't break backend.models.job.
Position
Below the diagonal: backend.services.firestore_service uses a module listed above it, which is the healthy direction.
backend.services.job_manager uses backend.models.job, so a change to backend.models.job can break backend.services.job_manager, while a change to backend.services.job_manager can't break backend.models.job.
Position
Below the diagonal: backend.services.job_manager uses a module listed above it, which is the healthy direction.
frontend.components uses frontend.app.error, so a change to frontend.app.error can break frontend.components, while a change to frontend.components can't break frontend.app.error.
Position
Below the diagonal: frontend.components uses a module listed above it, which is the healthy direction.
frontend.components.job uses frontend.app.error, so a change to frontend.app.error can break frontend.components.job, while a change to frontend.components.job can't break frontend.app.error.
Position
Below the diagonal: frontend.components.job uses a module listed above it, which is the healthy direction.
frontend.components.job uses frontend.components.job.steps.CustomizeStep, so a change to frontend.components.job.steps.CustomizeStep can break frontend.components.job, while a change to frontend.components.job can't break frontend.components.job.steps.CustomizeStep.
Position
Below the diagonal: frontend.components.job uses a module listed above it, which is the healthy direction.
frontend.components.job uses frontend.lib.types, so a change to frontend.lib.types can break frontend.components.job, while a change to frontend.components.job can't break frontend.lib.types.
Position
Below the diagonal: frontend.components.job uses a module listed above it, which is the healthy direction.
frontend.components.job.steps uses frontend.components.job.steps.CustomizeStep, so a change to frontend.components.job.steps.CustomizeStep can break frontend.components.job.steps, while a change to frontend.components.job.steps can't break frontend.components.job.steps.CustomizeStep.
Position
Below the diagonal: frontend.components.job.steps uses a module listed above it, which is the healthy direction.
frontend.components.lyrics-review uses frontend.lib.lyrics-review.types, so a change to frontend.lib.lyrics-review.types can break frontend.components.lyrics-review, while a change to frontend.components.lyrics-review can't break frontend.lib.lyrics-review.types.
Position
Below the diagonal: frontend.components.lyrics-review uses a module listed above it, which is the healthy direction.
frontend.components.lyrics-review.modals uses frontend.app.error, so a change to frontend.app.error can break frontend.components.lyrics-review.modals, while a change to frontend.components.lyrics-review.modals can't break frontend.app.error.
Position
Below the diagonal: frontend.components.lyrics-review.modals uses a module listed above it, which is the healthy direction.
frontend.components.lyrics-review.shared uses frontend.lib.lyrics-review.types, so a change to frontend.lib.lyrics-review.types can break frontend.components.lyrics-review.shared, while a change to frontend.components.lyrics-review.shared can't break frontend.lib.lyrics-review.types.
Position
Below the diagonal: frontend.components.lyrics-review.shared uses a module listed above it, which is the healthy direction.
frontend.hooks uses frontend.lib.api, so a change to frontend.lib.api can break frontend.hooks, while a change to frontend.hooks can't break frontend.lib.api.
Position
Below the diagonal: frontend.hooks uses a module listed above it, which is the healthy direction.
frontend.hooks uses frontend.lib.lyrics-review.types, so a change to frontend.lib.lyrics-review.types can break frontend.hooks, while a change to frontend.hooks can't break frontend.lib.lyrics-review.types.
Position
Below the diagonal: frontend.hooks uses a module listed above it, which is the healthy direction.
frontend.hooks uses frontend.lib.types, so a change to frontend.lib.types can break frontend.hooks, while a change to frontend.hooks can't break frontend.lib.types.
Position
Below the diagonal: frontend.hooks uses a module listed above it, which is the healthy direction.
frontend.lib uses frontend.components.job.steps.CustomizeStep, so a change to frontend.components.job.steps.CustomizeStep can break frontend.lib, while a change to frontend.lib can't break frontend.components.job.steps.CustomizeStep.
Position
Below the diagonal: frontend.lib uses a module listed above it, which is the healthy direction.
frontend.lib uses frontend.lib.api, so a change to frontend.lib.api can break frontend.lib, while a change to frontend.lib can't break frontend.lib.api.
Position
Below the diagonal: frontend.lib uses a module listed above it, which is the healthy direction.
frontend.lib uses frontend.lib.lyrics-review.types, so a change to frontend.lib.lyrics-review.types can break frontend.lib, while a change to frontend.lib can't break frontend.lib.lyrics-review.types.
Position
Below the diagonal: frontend.lib uses a module listed above it, which is the healthy direction.
frontend.lib uses frontend.lib.types, so a change to frontend.lib.types can break frontend.lib, while a change to frontend.lib can't break frontend.lib.types.
Position
Below the diagonal: frontend.lib uses a module listed above it, which is the healthy direction.
frontend.lib.lyrics-review.utils uses frontend.lib.lyrics-review.types, so a change to frontend.lib.lyrics-review.types can break frontend.lib.lyrics-review.utils, while a change to frontend.lib.lyrics-review.utils can't break frontend.lib.lyrics-review.types.
Position
Below the diagonal: frontend.lib.lyrics-review.utils uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in karaoke_gen.lyrics_transcriber.correction.agentic.handlers.base uses a type in karaoke_gen.lyrics_transcriber.correction.agentic.models.schemas.
karaoke_gen.lyrics_transcriber.correction.agentic.handlers.base uses karaoke_gen.lyrics_transcriber.correction.agentic.models.schemas, so a change to karaoke_gen.lyrics_transcriber.correction.agentic.models.schemas can break karaoke_gen.lyrics_transcriber.correction.agentic.handlers.base, while a change to karaoke_gen.lyrics_transcriber.correction.agentic.handlers.base can't break karaoke_gen.lyrics_transcriber.correction.agentic.models.schemas.
Position
Below the diagonal: karaoke_gen.lyrics_transcriber.correction.agentic.handlers.base uses a module listed above it, which is the healthy direction.
karaoke_gen.lyrics_transcriber.correction.handlers.base uses karaoke_gen.lyrics_transcriber.types, so a change to karaoke_gen.lyrics_transcriber.types can break karaoke_gen.lyrics_transcriber.correction.handlers.base, while a change to karaoke_gen.lyrics_transcriber.correction.handlers.base can't break karaoke_gen.lyrics_transcriber.types.
Position
Below the diagonal: karaoke_gen.lyrics_transcriber.correction.handlers.base uses a module listed above it, which is the healthy direction.
karaoke_gen.lyrics_transcriber.lyrics.base_lyrics_provider uses karaoke_gen.lyrics_transcriber.types, so a change to karaoke_gen.lyrics_transcriber.types can break karaoke_gen.lyrics_transcriber.lyrics.base_lyrics_provider, while a change to karaoke_gen.lyrics_transcriber.lyrics.base_lyrics_provider can't break karaoke_gen.lyrics_transcriber.types.
Position
Below the diagonal: karaoke_gen.lyrics_transcriber.lyrics.base_lyrics_provider uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.models.job, so a change to backend.models.job can break backend.api.routes, while a change to backend.api.routes can't break backend.models.job.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.models.song_request, so a change to backend.models.song_request can break backend.api.routes, while a change to backend.api.routes can't break backend.models.song_request.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.services.custom_lyrics.service, so a change to backend.services.custom_lyrics.service can break backend.api.routes, while a change to backend.api.routes can't break backend.services.custom_lyrics.service.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.services.storage_service, so a change to backend.services.storage_service can break backend.api.routes, while a change to backend.api.routes can't break backend.services.storage_service.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.services.user_service, so a change to backend.services.user_service can break backend.api.routes, while a change to backend.api.routes can't break backend.services.user_service.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.api.routes uses backend.services.job_manager, so a change to backend.services.job_manager can break backend.api.routes, while a change to backend.api.routes can't break backend.services.job_manager.
Position
Below the diagonal: backend.api.routes uses a module listed above it, which is the healthy direction.
backend.services uses backend.models.job, so a change to backend.models.job can break backend.services, while a change to backend.services can't break backend.models.job.
Position
Below the diagonal: backend.services uses a module listed above it, which is the healthy direction.
backend.services uses backend.models.song_request, so a change to backend.models.song_request can break backend.services, while a change to backend.services can't break backend.models.song_request.
Position
Below the diagonal: backend.services uses a module listed above it, which is the healthy direction.
backend.services uses backend.services.storage_service, so a change to backend.services.storage_service can break backend.services, while a change to backend.services can't break backend.services.storage_service.
Position
Below the diagonal: backend.services uses a module listed above it, which is the healthy direction.
backend.services uses backend.services.user_service, so a change to backend.services.user_service can break backend.services, while a change to backend.services can't break backend.services.user_service.
Position
Below the diagonal: backend.services uses a module listed above it, which is the healthy direction.
backend.services uses backend.services.job_manager, so a change to backend.services.job_manager can break backend.services, while a change to backend.services can't break backend.services.job_manager.
Position
Below the diagonal: backend.services uses a module listed above it, which is the healthy direction.
backend.services.fake_workers uses backend.services.storage_service, so a change to backend.services.storage_service can break backend.services.fake_workers, while a change to backend.services.fake_workers can't break backend.services.storage_service.
Position
Below the diagonal: backend.services.fake_workers uses a module listed above it, which is the healthy direction.
backend.services.fake_workers uses backend.services.job_manager, so a change to backend.services.job_manager can break backend.services.fake_workers, while a change to backend.services.fake_workers can't break backend.services.job_manager.
Position
Below the diagonal: backend.services.fake_workers uses a module listed above it, which is the healthy direction.
backend.workers uses backend.models.song_request, so a change to backend.models.song_request can break backend.workers, while a change to backend.workers can't break backend.models.song_request.
Position
Below the diagonal: backend.workers uses a module listed above it, which is the healthy direction.
backend.workers uses backend.services.storage_service, so a change to backend.services.storage_service can break backend.workers, while a change to backend.workers can't break backend.services.storage_service.
Position
Below the diagonal: backend.workers uses a module listed above it, which is the healthy direction.
backend.workers uses backend.services.job_manager, so a change to backend.services.job_manager can break backend.workers, while a change to backend.workers can't break backend.services.job_manager.
Position
Below the diagonal: backend.workers uses a module listed above it, which is the healthy direction.
scripts uses backend.services.storage_service, so a change to backend.services.storage_service can break scripts, while a change to scripts can't break backend.services.storage_service.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
scripts uses karaoke_gen.lyrics_transcriber.types, so a change to karaoke_gen.lyrics_transcriber.types can break scripts, while a change to scripts can't break karaoke_gen.lyrics_transcriber.types.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
scripts uses backend.services.job_manager, so a change to backend.services.job_manager can break scripts, while a change to scripts can't break backend.services.job_manager.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 45.6 · Weak · gated by D1, D2, R10, X4 ·
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
223
High / Critical
A03:2025 — Software Supply Chain Failures
85
High / Critical
A02:2025 — Security Misconfiguration
14
High / Critical
A01:2025 — Broken Access Control
9
Medium
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
Top priorities: Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED; Resolve the 10 Banned license finding(s) in License Compliance; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Resolve the 38 Skipped test finding(s) in Test Quality — start with stripe-webhook-security.spec.ts (4), credit-purchase-real.spec.ts (3), guided-flow.spec.ts (3).
Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
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 — 289
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 — 1977
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 — 273
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
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 79 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 79 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, 2506 of 2539 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2,180 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 545 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (4 contributor(s) across 2047 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 3 hold 0% 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 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. For npm the surface is what a published REDACTED's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 1822 sampled here came from .py files. This repository's .tsx source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The newest 200 of 2048 commits were scanned for secrets, back to commit 3607ccf74596; older commits were not. `gitleaks` TIMED OUT after 171.1s against a 170.9s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. The working tree WAS scanned in full, and every row of the scanned ranges is reported. Nothing about the unscanned commits is asserted by the absence of a result; the budget is ours to raise.
D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx`, `frontend/lib/lyrics-review/utils/editLog.ts`, `karaoke_gen/nextjs_frontend/_next/static/chunks/5364754c7c1840a6.js`, `karaoke_gen/nextjs_frontend/_next/static/chunks/a6dad97d9634a72d.js` 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.
AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 37 further occurrence(s) are not listed individually; the score already reflects all 77.
AC6 Visual & motion safety — 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. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. An image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository. (rule: registry). The renderer reported: docker build failed (exit 1) — -------------------- ERROR: failed to solve: us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to resolve source metadata for us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to do request: Head "https://us-central1-docker.pkg.dev/v2/nomadkaraoke/karaoke-repo/karaoke-backend-base/manifests/latest": Forbidden; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — -------------------- ERROR: failed to solve: us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to resolve source metadata for us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to do request: Head "https://us-central1-docker.pkg.dev/v2/nomadkaraoke/karaoke-repo/karaoke-backend-base/manifests/latest": Forbidden; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. 'sqlite3' is imported (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py: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.
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 (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py: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 (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py: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 this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — 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 this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 244 further occurrence(s) are not listed individually; the score already reflects all 284.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 150 further occurrence(s) are not listed individually; the score already reflects all 190.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 76 further occurrence(s) are not listed individually; the score already reflects all 116.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
X10 Duplicated predicate — 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. 45 further occurrence(s) are not listed individually; the score already reflects all 85.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 130 further occurrence(s) are not listed individually; the score already reflects all 170.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 3586 further occurrence(s) are not listed individually; the score already reflects all 3626.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
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").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
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.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
324 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was page.AdminJobsPageContent at 304. A further 1 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 segmentOperations.findAndReplace at 18 — 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: REDACTED (segmentOperations.findAndReplace at 18). 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.
+ 318 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 26 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with page.AdminJobsPageContent (cyclomatic 304), LyricsAnalyzer.LyricsAnalyzer (cyclomatic 276), remote_cli.main (cyclomatic 146). — 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 26 together lifts Cyclomatic Complexity from 2.0 to about 4.5/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.
+ 450 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 155 bodies over 30 down to 30 or less in Cognitive Complexity — start with page.AdminJobsPageContent (cognitive 352), LyricsAnalyzer.LyricsAnalyzer (cognitive 302), LyricsCorrector._process_corrections (cognitive 301). — 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 155 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.0 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
TooManyMethods: ASS · ×9karaoke_gen/lyrics_transcriber/output/ass/ass.py:23
What to do
Resolve the 102 FunctionTooLong finding(s) in God Classes — start with REDACTED (22), client.tsx (3), AudioSourceStep.tsx (3). — One of this dimension's main actionable groups (102 warning-level).
Resolve the 68 FileTooLong finding(s) in God Classes — start with REDACTED (11), service.py (2), client.tsx (2). — One of this dimension's main actionable groups (68 warning-level).
Resolve the 14 ClassTooLong finding(s) in God Classes — start with LyricsAnalyzer.tsx, AudioEditor.tsx, api.ts. — One of this dimension's main actionable groups (14 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
266 duplicated block group(s) detected. 5.5 % of the production lines (12,671 of 229,397) are in a reported copy. A further 158 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 25 of the 424 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .tsx (24% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 212 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with remote_cli.py (2), REDACTED, users.py. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 12 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with translate.py (2), jobs.py, audio_edit_session.py. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with remote_cli.py (2), audio_search.py, render_video_worker.py. — 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.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
2 production modules (npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.
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 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with flacfetch_client.py. — One of this dimension's main actionable groups (1 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.6 / 10Stronggated by 50 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
38 skipped, 12 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2180 tests. Measured on the JavaScript/TypeScript suite only — at least 545 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
Skipped test: impersonation banner shows target user email · ×38frontend/e2e/regression/impersonation.spec.ts:114
No assertions: skips — no fixtures found (run: node e2e/fixtures/fetch-search-fixtures.mjs) · ×12frontend/lib/__tests__/audio-search-confidence-fixtures.test.ts:67
Mock-dominated test: warns before unload only while an upload is running · ×9frontend/hooks/__tests__/useUploadTask.test.tsx:26
What to do
Resolve the 38 Skipped test finding(s) in Test Quality — start with stripe-webhook-security.spec.ts (4), credit-purchase-real.spec.ts (3), guided-flow.spec.ts (3). — One of this dimension's main actionable groups (38 warning-level).
Resolve the 12 No assertions finding(s) in Test Quality — start with take-screenshots.spec.ts (4), job-management.spec.ts (2), audio-search-confidence-fixtures.test.ts. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 9 Mock-dominated test finding(s) in Test Quality — start with AuthStatus.test.tsx (3), StalledDownloadNotice.test.tsx (3), useUploadTask.test.tsx. — One of this dimension's main actionable groups (9 recommendation-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
5 outdated, 0 yanked pinned Python distributions. 5 of 99 shipped distributions were graded against pypi.org (0 not published there, 94 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (REDACTED, uv.lock, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.
Outdated: google-auth-httplib2 · ×5
Detailed fixes: d12_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 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 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.
10 of 343 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 99 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (244 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 25 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
Banned license: mutagen · ×10
What to do
Resolve the 10 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (10 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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: frontend/components/lyrics-review/LyricsAnalyzer.tsx (20×276=5520); backend/api/routes/file_upload.py (19×89=1691); backend/api/routes/internal.py (25×67=1675) Repeated repair below the complexity floor: infrastructure/modules/storage.py (4 of 6 changes were fixes); backend/services/error_monitor/known_issues.py (4 of 5 changes were fixes); frontend/functions/[[path]].ts (3 of 5 changes were fixes)
Resolve the 80 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (6), REDACTED (3), client.tsx (2). — One of this dimension's main actionable groups (80 warning-level).
Resolve the 6 Repeated repair finding(s) in Churn × Complexity Hotspots — start with storage.py, known_issues.py, [[path]].ts. — One of this dimension's main actionable groups (6 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.
34 deducted task-comment markers across 229397 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.
Resolve the 17 TodoComment finding(s) in Explicit Debt — start with composer.py (5), impersonation.spec.ts (2), REDACTED (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 12 HackComment finding(s) in Explicit Debt — start with composer.py (8), pack.py (2), render.py (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 4 XxxComment finding(s) in Explicit Debt — start with composer.py (4). — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 58 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_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 pyproject.toml. — 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: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the namesfrontend/e2e/fixtures/mock-server.ts:104
What to do
Resolve the 73 redundant comment finding(s) in Comment Value — start with REDACTED (4), AudioEditor.test.tsx (4), LyricsAnalyzer.tsx (4). — One of this dimension's main actionable groups (73 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
3 of 16 build units (Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×3backend/pyproject.toml:1
What to do
Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with pyproject.toml (2), REDACTED. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability6.7 / 10Adequate✓ Tool-verified
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.
100 % of calls cross a namespace and 0 % go through an interface, but 34 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .tsx was not sampled for call sites, so this score covers part of the tree, not all of it.
Scattered collaborators
What to do
Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
gitleaks scanned the current working tree and the part of the history named below, and found no secrets. History coverage: The newest 200 of 2048 commits were scanned for secrets, back to commit 3607ccf74596; older commits were not. `gitleaks` TIMED OUT after 171.1s against a 170.9s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows.
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).
223 finding(s): 0 critical, 164 high, 38 medium, 21 low. 105 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 24 file(s) — `.specify/scripts/bash/common.sh`, `.specify/scripts/bash/create-new-feature.sh`, `frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx` (line 699), `frontend/components/job/__tests__/AudioSourceStep.test.tsx` (line 84, line 101, line 102, …), `frontend/components/lyrics-review/LyricsAnalyzer.tsx`, … (+19 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 7 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 19 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (7), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (19 issue-level).
Resolve the 14 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (14 issue-level).
No action in Static Analysis (SAST) — all 104 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 (104 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 44 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (23), REDACTED (20), REDACTED. — One of this dimension's main actionable groups (44 issue-level).
Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 2 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 7 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 6 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D32 · Data Compliance (PII/GDPR)3.9 / 10Weak✓ Tool-verified
What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.
Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using our own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.
9 finding(s): 0 critical, 0 high, 9 medium, 0 low. semgrep could not parse 4 file(s) — `frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx`, `frontend/lib/lyrics-review/utils/editLog.ts`, `karaoke_gen/nextjs_frontend/_next/static/chunks/5364754c7c1840a6.js`, `karaoke_gen/nextjs_frontend/_next/static/chunks/a6dad97d9634a72d.js` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
REDACTED
What to do
Resolve the 9 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (5), REDACTED, REDACTED. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d32_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 673 of the 920 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 5 Change coupling finding(s) in Change Coupling — start with admin.py (2), admin-sidebar.tsx, __main__.py. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 99 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives4.7 / 10Adequate✓ 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.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×6) — frontend/components/audio-editor/AudioEditor.tsx:308, frontend/components/instrumental-review/WaveformViewer.tsx:321, frontend/components/job/KaraokeBackgroundPreview.tsx:159, …
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — frontend/components/lyrics-review/PreviewVideoSection.tsx:580
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 & labels5.0 / 10Adequate✓ 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.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×5) — frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:660, frontend/app/[locale]/r/client.tsx:195, frontend/app/[locale]/requests/client.tsx:369, …
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). (×12) — frontend/app/[locale]/app/page.tsx:318, frontend/app/[locale]/app/page.tsx:357, frontend/app/[locale]/page.tsx:842, …
This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×6) — frontend/app/[locale]/page.tsx:741, REDACTED:191, REDACTED:201, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — REDACTED:878, frontend/components/audio-editor/AudioEditor.tsx:1419, frontend/components/job/steps/CustomizeStep.tsx:624, …
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×4) — REDACTED:1660, frontend/app/admin/payments/page.tsx:205, frontend/components/admin/refund-dialog.tsx:138, …
This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it. (×8) — REDACTED:2240, frontend/app/admin/payments/page.tsx:434, frontend/app/admin/payments/page.tsx:445, …
This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — frontend/components/lyrics-review/AudioPlayer.tsx:222
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.
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.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×5) — backend/templates/printables/website-referral-flyer-dark.html:2, backend/templates/printables/website-referral-flyer.html:2, frontend/app/global-error.tsx:28, …
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×2) — frontend/app/admin/page.tsx:177, infrastructure/monitoring/job-inspector.html:351
A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component. — frontend/app/global-error.tsx:28
A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — infrastructure/monitoring/job-inspector.html:448
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate. (×9) — karaoke_gen/nextjs_frontend/404.html:1, karaoke_gen/nextjs_frontend/404/index.html:1, karaoke_gen/nextjs_frontend/_not-found/index.html:1, …
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 interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — frontend/app/[locale]/account/delete/client.tsx:231
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — frontend/app/[locale]/requests/client.tsx:619
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — frontend/app/admin/edit-reviews/page.tsx:148, REDACTED:1227
This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — frontend/components/audio-editor/AudioEditor.tsx:1304
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×14) — frontend/components/auth/AuthStatus.tsx:100, frontend/components/job/ImageUploadField.tsx:116, frontend/components/job/TenantJobFlow.tsx:382, …
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×2) — frontend/components/instrumental-review/MuteRegionEditor.tsx:81, frontend/components/lyrics-review/EditFeedbackBar.tsx:106
The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <canvas> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — frontend/components/instrumental-review/WaveformViewer.tsx:321
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×4) — infrastructure/monitoring/job-inspector.html:352, infrastructure/monitoring/job-inspector.html:355, infrastructure/monitoring/job-inspector.html:358, …
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×4) — infrastructure/monitoring/job-inspector.html:368, infrastructure/monitoring/job-inspector.html:417, infrastructure/monitoring/job-inspector.html:475, …
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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.
`LyricsReviewApiClient` declares 19 required operations: `submitCorrections`, `submitAnnotations`, `submitEditLog`, `updateHandlers`, `addLyrics`, `searchLyrics`, `getAudioUrl`, `getVocalsAudioUrl`, `getVocalsPeaksUrl`, `generatePreviewVideo`, `getPreviewVideoStatus`, `getPreviewVideoUrl`, `getWaveformData`, `refreshInstrumentalUrls`, `completeReview`, `saveReviewSession`, `listReviewSessions`, `getReviewSession`, `deleteReviewSession`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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. — frontend/lib/api.ts:4274
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
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.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
backend/workers/README.md links to `../docs/01-reference/API-MANUAL-TESTING.md`, but `backend/docs/01-reference/API-MANUAL-TESTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — backend/workers/README.md:600
backend/workers/README.md links to `../docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md`, but `backend/docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — backend/workers/README.md:601
backend/workers/README.md links to `../docs/03-deployment/TESTING-BACKEND.md`, but `backend/docs/03-deployment/TESTING-BACKEND.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — backend/workers/README.md:602
backend/workers/README.md links to `../docs/03-deployment/INFRASTRUCTURE-AS-CODE.md`, but `backend/docs/03-deployment/INFRASTRUCTURE-AS-CODE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — backend/workers/README.md:603
What to do
Reconcile the README with reality: backend/workers/README.md links to `../docs/01-reference/API-MANUAL-TESTING.md`, but `backend/docs/01-reference/API-MANUAL-TESTING.md` does not exist; backend/workers/README.md links to `../docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md`, but `backend/docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md` does not exist; backend/workers/README.md links to `../docs/03-deployment/TESTING-BACKEND.md`, but `backend/docs/03-deployment/TESTING-BACKEND.md` does not exist; backend/workers/README.md links to `../docs/03-deployment/INFRASTRUCTURE-AS-CODE.md`, but `backend/docs/03-deployment/INFRASTRUCTURE-AS-CODE.md` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Only 10/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `frontend`, `infrastructure/aws`, `infrastructure/cloudflare`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.
`REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:34
What to do
Enable Dependabot/Renovate or a dependency-review gate.
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.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — infrastructure/cloudflare/scripts/build_import_list.py:43
`requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×4) — REDACTED:639, karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:258, REDACTED:72, …
`requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:93
`requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — karaoke_gen/pipeline/executors/remote.py:59
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
`health_check` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — REDACTED:1697
`process_audio_separation` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — backend/workers/audio_worker.py:139
`_submit_job` is async and calls requests.post — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — karaoke_gen/pipeline/executors/remote.py:145
`_monitor_job` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — karaoke_gen/pipeline/executors/remote.py:198
`async_main` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — karaoke_gen/utils/gen_cli.py:357
What to do
Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
Do you agree with this assessment?
R1 · Type Safety9.7 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
Do you agree with this assessment?
R10 · Code Duplication3.6 / 10Weak✓ Tool-verified
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
39 duplicated blocks under frontend/ have copies in at least two of the sibling directories app, components, hooks, lib — 15 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/components/ui/use-toast.ts:4
33 duplicated blocks under frontend/app/admin/ have copies in at least two of the sibling directories abuse, audio-edits, community-requests, community-reviews, edit-reviews, feedback (+7 more sibling(s) not listed) — 17 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/app/admin/audio-edits/page.tsx:212
32 duplicated blocks under frontend/components/ have copies in at least two of the sibling directories admin, audio-editor, audio-search, credits, feedback, instrumental-review (+3 more sibling(s) not listed) — 8 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 32 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 32 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 32 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/components/audio-editor/AudioEditor.tsx:76
frontend/app/admin/audio-edits/page.tsx:212 · frontend/app/admin/edit-reviews/page.tsx:357 — the two spans are one implementation copied and then locally edited — 1162 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/app/admin/audio-edits/page.tsx:212
frontend/components/audio-editor/AudioEditor.tsx:76 · frontend/components/instrumental-review/WaveformViewer.tsx:29 — the two spans are one implementation copied and then locally edited — 1136 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/audio-editor/AudioEditor.tsx:76
frontend/components/ui/context-menu.tsx:110 · frontend/components/ui/menubar.tsx:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/ui/context-menu.tsx:110
frontend/components/ui/item.tsx:8 · frontend/components/ui/sidebar.tsx:346 — the two spans are one implementation copied and then locally edited — 394 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/ui/item.tsx:8
frontend/components/ui/use-toast.ts:4 · frontend/hooks/use-toast.ts:4 — these 2 files are line-for-line copies of one another — 103 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — frontend/components/ui/use-toast.ts:4
frontend/components/ui/dropdown-menu.tsx:131 · frontend/components/ui/menubar.tsx:149 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/ui/dropdown-menu.tsx:131
frontend/components/ui/drawer.tsx:8 · frontend/components/ui/sheet.tsx:9 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/ui/drawer.tsx:8
frontend/public/sw.js:9 · karaoke_gen/nextjs_frontend/sw.js:9 — these 2 files are line-for-line copies of one another — 89 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — frontend/public/sw.js:9
frontend/components/job/steps/CustomizeStep.tsx:583 · frontend/components/job/steps/CustomizeStep.tsx:670 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/components/job/steps/CustomizeStep.tsx:583
frontend/app/admin/searches/page.tsx:87 · REDACTED:124 — the two spans are one implementation copied and then locally edited — 286 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/app/admin/searches/page.tsx:87
frontend/app/admin/referrals/page.tsx:288 · frontend/app/admin/referrals/page.tsx:628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/app/admin/referrals/page.tsx:288
frontend/components/job/KaraokeBackgroundPreview.tsx:50 · frontend/components/job/TitleCardPreview.tsx:151 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/job/KaraokeBackgroundPreview.tsx:50
frontend/components/auth/AuthDialog.tsx:86 · frontend/components/auth/AuthDialog.tsx:199 — the two spans are one implementation copied and then locally edited — 276 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/auth/AuthDialog.tsx:86
frontend/hooks/useManualSync.ts:252 · frontend/hooks/useManualSync.ts:429 — the two spans are one implementation copied and then locally edited — 354 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/hooks/useManualSync.ts:252
frontend/app/[locale]/order/success/page.tsx:12 · frontend/app/[locale]/payment/success/page.tsx:26 — the two spans are one implementation copied and then locally edited — 261 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/app/[locale]/order/success/page.tsx:12
frontend/app/admin/community-requests/page.tsx:32 · frontend/app/admin/community-reviews/page.tsx:19 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/app/admin/community-requests/page.tsx:32
REDACTED:2264 · REDACTED:391 — the two spans are one implementation copied and then locally edited — 278 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:2264
frontend/components/job/JobSubmission.tsx:416 · frontend/components/job/JobSubmission.tsx:515 · frontend/components/job/JobSubmission.tsx:660 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/job/JobSubmission.tsx:416
frontend/components/job/GuidedJobFlow.tsx:307 · frontend/components/job/TenantJobFlow.tsx:128 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — frontend/components/job/GuidedJobFlow.tsx:307
REDACTED:404 · REDACTED:466 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — REDACTED:404
frontend/components/ui/avatar.tsx:8 · frontend/components/ui/tabs.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/components/ui/avatar.tsx:8
frontend/lib/api.ts:3681 · frontend/lib/api.ts:3749 — the two spans are one implementation copied and then locally edited — 434 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/lib/api.ts:3681
frontend/hooks/use-audio-edit-autosave.ts:32 · frontend/hooks/use-review-session-autosave.ts:56 — the two spans are one implementation copied and then locally edited — 194 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/hooks/use-audio-edit-autosave.ts:32
frontend/test-brand-screenshots.mjs:27 · frontend/test-brand-screenshots.mjs:91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/test-brand-screenshots.mjs:27
frontend/components/job/EditTrackModal.tsx:80 · frontend/components/job/OutputLinks.tsx:559 — the two spans are one implementation copied and then locally edited — 186 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/components/job/EditTrackModal.tsx:80
frontend/lib/api/autoCorrect.ts:66 · frontend/lib/api/customLyrics.ts:64 — the two spans are one implementation copied and then locally edited — 193 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/lib/api/autoCorrect.ts:66
frontend/app/admin/payments/page.tsx:156 · frontend/app/admin/payments/page.tsx:720 — the two spans are one implementation copied and then locally edited — 205 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/app/admin/payments/page.tsx:156
frontend/app/admin/rate-limits/page.tsx:494 · frontend/app/admin/rate-limits/page.tsx:554 · frontend/app/admin/rate-limits/page.tsx:614 · frontend/app/admin/rate-limits/page.tsx:673 — 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. — frontend/app/admin/rate-limits/page.tsx:494
frontend/components/ui/context-menu.tsx:54 · frontend/components/ui/dropdown-menu.tsx:199 · frontend/components/ui/menubar.tsx:217 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/ui/context-menu.tsx:54
frontend/app/[locale]/auth/verify/page.tsx:286 · frontend/app/[locale]/auth/verify/page.tsx:318 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/app/[locale]/auth/verify/page.tsx:286
frontend/components/ui/carousel.tsx:174 · frontend/components/ui/carousel.tsx:204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/components/ui/carousel.tsx:174
REDACTED:1007 · REDACTED:1045 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1007
frontend/components/ui/empty.tsx:37 · frontend/components/ui/item.tsx:82 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/ui/empty.tsx:37
REDACTED:774 · REDACTED:525 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:774
frontend/components/ui/alert-dialog.tsx:89 · frontend/components/ui/drawer.tsx:90 · frontend/components/ui/sheet.tsx:96 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/ui/alert-dialog.tsx:89
frontend/app/admin/rate-limits/page.tsx:597 · frontend/app/admin/rate-limits/page.tsx:656 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/app/admin/rate-limits/page.tsx:597
frontend/components/job/steps/CustomizeStep.tsx:400 · frontend/components/job/steps/CustomizeStep.tsx:506 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/components/job/steps/CustomizeStep.tsx:400
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
AdminJobsPageContent has cyclomatic complexity 143 and cognitive complexity 177; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:139
(anonymous) has cyclomatic complexity 127 and cognitive complexity 262; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/e2e/production/happy-path-real-user.spec.ts:250
LyricsAnalyzer has cyclomatic complexity 102 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/LyricsAnalyzer.tsx:144
OutputLinks has cyclomatic complexity 97 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/OutputLinks.tsx:41
AudioEditor has cyclomatic complexity 70 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/audio-editor/AudioEditor.tsx:341
TenantThemeEditorDialog has cyclomatic complexity 57 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94
CustomizeStep has cyclomatic complexity 54 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/steps/CustomizeStep.tsx:295
AdminUserDetailPage has cyclomatic complexity 54 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:76
Header has cyclomatic complexity 46 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/Header.tsx:77
(anonymous) has cyclomatic complexity 43 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/e2e/production/demo-recording.spec.ts:99
AppPageContent has cyclomatic complexity 43 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/app/[locale]/app/page.tsx:50
JobSubmission has cyclomatic complexity 39 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/JobSubmission.tsx:24
RequestsBoardClient has cyclomatic complexity 39 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/app/[locale]/requests/client.tsx:62
LyricsReviewWrapper has cyclomatic complexity 38 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:342
EditModal has cyclomatic complexity 37 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/modals/EditModal.tsx:45
(anonymous) has cyclomatic complexity 37 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/shared/HighlightedText.tsx:162
Word has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/shared/Word.tsx:11
ReviewChangesModal has cyclomatic complexity 34 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/modals/ReviewChangesModal.tsx:76
(anonymous) has cyclomatic complexity 33 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/e2e/production/tenant-happy-path.spec.ts:79
BulkAlbumMode has cyclomatic complexity 33 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/bulk/BulkAlbumMode.tsx:208
AudioSourceStep has cyclomatic complexity 33 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/steps/AudioSourceStep.tsx:135
apiFetch has cyclomatic complexity 32 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/lib/api.ts:635
(anonymous) has cyclomatic complexity 32 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:283
handleKeyDown has cyclomatic complexity 31 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/lib/lyrics-review/utils/keyboardHandlers.ts:63
JobCard has cyclomatic complexity 30 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/JobCard.tsx:104
(anonymous) has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/e2e/production/full-user-journey.spec.ts:139
handleConfirm has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/GuidedJobFlow.tsx:177
getSearchConfidence has cyclomatic complexity 28 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/lib/audio-search-utils.ts:380
ReferralDashboard has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/referrals/ReferralDashboard.tsx:26
categorizeResult has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/lib/audio-search-utils.ts:63
InstrumentalSelector has cyclomatic complexity 27 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/instrumental-review/InstrumentalSelector.tsx:56
GuidancePanel has cyclomatic complexity 27 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/GuidancePanel.tsx:32
AdminTenantsPage has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/app/admin/tenants/page.tsx:126
UserEmailsCard has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/admin/user-emails-card.tsx:51
(anonymous) has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/TenantBulkFlow.tsx:629
FallbackSection has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/job/steps/AudioSourceStep.tsx:1248
SearchLyricsTab has cyclomatic complexity 26 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/components/lyrics-review/modals/SearchLyricsTab.tsx:21
uploadResumable has cyclomatic complexity 25 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/lib/resumable-upload.ts:249
attempt has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/e2e/helpers/self-healing/step-runner.ts:43
DeleteAccountClient has cyclomatic complexity 25 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/app/[locale]/account/delete/client.tsx:46
Do you agree with this assessment?
R3 · Large Files5.0 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
frontend/lib/api.ts has 4751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/lib/api.ts:1
REDACTED has 2274 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
frontend/components/lyrics-review/LyricsAnalyzer.tsx has 1917 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/LyricsAnalyzer.tsx:1
frontend/components/job/steps/AudioSourceStep.tsx has 1425 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/steps/AudioSourceStep.tsx:1
frontend/components/audio-editor/AudioEditor.tsx has 1316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/audio-editor/AudioEditor.tsx:1
REDACTED has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 891 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
frontend/app/[locale]/page.tsx has 849 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/[locale]/page.tsx:1
frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx has 832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:1
frontend/components/tenant-theme/TenantThemeEditorDialog.tsx has 795 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:1
frontend/components/instrumental-review/InstrumentalSelector.tsx has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/instrumental-review/InstrumentalSelector.tsx:1
frontend/app/admin/payments/page.tsx has 792 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/payments/page.tsx:1
frontend/app/admin/tenants/page.tsx has 766 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/tenants/page.tsx:1
frontend/components/job/steps/CustomizeStep.tsx has 749 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/steps/CustomizeStep.tsx:1
frontend/components/job/TenantBulkFlow.tsx has 738 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/TenantBulkFlow.tsx:1
frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx has 726 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:1
frontend/components/job/OutputLinks.tsx has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/OutputLinks.tsx:1
frontend/app/admin/rate-limits/page.tsx has 694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/rate-limits/page.tsx:1
frontend/app/[locale]/requests/client.tsx has 680 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/[locale]/requests/client.tsx:1
frontend/app/admin/referrals/page.tsx has 677 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/referrals/page.tsx:1
frontend/components/ui/sidebar.tsx has 672 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/ui/sidebar.tsx:1
frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx has 668 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:1
frontend/components/job/JobSubmission.tsx has 665 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/JobSubmission.tsx:1
frontend/app/admin/edit-reviews/page.tsx has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/edit-reviews/page.tsx:1
frontend/components/lyrics-review/PreviewVideoSection.tsx has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/PreviewVideoSection.tsx:1
REDACTED has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
frontend/app/admin/audio-edits/page.tsx has 578 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/admin/audio-edits/page.tsx:1
frontend/components/job/GuidedJobFlow.tsx has 568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/GuidedJobFlow.tsx:1
frontend/app/[locale]/app/page.tsx has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/app/[locale]/app/page.tsx:1
frontend/lib/lyrics-review/types.ts has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/lib/lyrics-review/types.ts:1
frontend/components/lyrics-review/shared/HighlightedText.tsx has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/shared/HighlightedText.tsx:1
frontend/components/lyrics-review/TimelineEditor.tsx has 542 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/TimelineEditor.tsx:1
frontend/components/job/bulk/BulkAlbumMode.tsx has 525 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/job/bulk/BulkAlbumMode.tsx:1
frontend/hooks/useManualSync.ts has 516 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/hooks/useManualSync.ts:1
frontend/components/lyrics-review/modals/EditModal.tsx has 514 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/modals/EditModal.tsx:1
frontend/components/referrals/ReferralDashboard.tsx has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/referrals/ReferralDashboard.tsx:1
frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx has 462 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx:1
frontend/lib/audio-search-utils.ts has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/lib/audio-search-utils.ts:1
frontend/lib/job-status.ts has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/lib/job-status.ts:1
frontend/components/audio-search/AudioSearchDialog.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/components/audio-search/AudioSearchDialog.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage6.6 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — REDACTED:1, REDACTED:1, REDACTED:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
59 outdated package(s); JS/npm CVEs scored in D30
Do you agree with this assessment?
R6 · Tooling6.7 / 10Strong✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✓ · typecheck ✗ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
`frontend` is TypeScript, but a type error in it cannot fail anything this repository runs: its Next.js config sets `typescript.ignoreBuildErrors: true`, so `next build` — the one step that would run the type checker — passes over type errors, and no script, config or CI step of the package runs `tsc` instead. Add a type check that can fail — a `typecheck` script running `tsc --noEmit` (or `vue-tsc`/`svelte-check`) that CI or the workspace pipeline runs, or a build step that checks before it bundles. — frontend/next.config.mjs:35
What to do
Add `tsc --noEmit` as REDACTED scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code6.9 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 165 application, 20 tooling and 236 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×37) — frontend/components/job/JobSubmission.tsx, frontend/components/ui/menubar.tsx, frontend/components/push-settings.tsx, …
no import path from any entry point (165 application, 20 tooling, 236 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (frontend/components/job/JobSubmission.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — frontend/components/ui/autocomplete-input.tsx
no import path from any entry point (165 application, 20 tooling, 236 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (frontend/lib/lyrics-review/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — frontend/lib/lyrics-review/validation.ts
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. — frontend/components/lyrics-review/modals/EditModal.tsx:11
Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×4) — REDACTED:36, REDACTED:65, REDACTED:70, …
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `_headers` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — frontend/public/_headers:1
`Server` is set explicitly here. The OWASP Secure Headers Project lists it among the response headers to REMOVE: it names the server, framework or tooling behind the application, which is exactly what an attacker looks up known exploits for. (No deduction on this card.) — karaoke_gen/nextjs_frontend/_next/static/chunks/5997132b61dec430.js:1
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Stop sending `Server`: delete the write, and suppress the framework's own copy where it has one (Kestrel `AddServerHeader = false`, Express `app.disable('x-powered-by')` / `helmet.hidePoweredBy()`, nginx `server_tokens off`, IIS `<requestFiltering removeServerHeader="true" />`).
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
This `async def` runs on the event loop's thread, and `time.sleep` blocks that thread: for the whole delay no other coroutine, request or callback on the loop makes progress — the Python form of blocking on a task. Use `await asyncio.sleep(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the loop with `await asyncio.to_thread(…)` (or `loop.run_in_executor(…)`). (×4) — karaoke_gen/utils/gen_cli.py:626, karaoke_gen/utils/gen_cli.py:739, karaoke_gen/utils/gen_cli.py:1213, …
The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. (×2) — backend/api/routes/rate_limits.py:339, REDACTED:3560
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.7 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`flatten_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 162 (`flatten_keys`) with a piece of `obj` — and nowhere in `flatten_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/scripts/translate.py:162
`merge_deep` is public and takes `base: dict` from its caller, and it calls itself at line 196 (`merge_deep`) with a piece of `base` — and nowhere in `merge_deep` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `merge_deep` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/scripts/translate.py:196
`count_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 230 (`count_keys`) with a piece of `obj` — and nowhere in `count_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `count_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/scripts/translate.py:230
`flatten_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 31 (`flatten_keys`) with a piece of `obj` — and nowhere in `flatten_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/scripts/validate-translations.py:31
`stableStringify` is exported and takes `value: unknown` from its caller, and it calls itself at line 67 (`stableStringify`) with a piece of `value` (and at line 71) — and nowhere in `stableStringify` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableStringify` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/components/tenant-theme/theme-utils.ts:67
`t` is public and takes `kwargs: Any` from its caller, and it calls itself at line 71 (`t`) with a piece of `kwargs` — and nowhere in `t` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `t` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/i18n.py:71
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 1/6 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`fetchVocalsPeaks` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — frontend/lib/audio-data.ts:103
`fetchAudioData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — frontend/lib/audio-data.ts:127
`reportClientError` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — frontend/lib/crash-reporter.ts:167
`fetchTenantConfig` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — frontend/lib/tenant.ts:188
`isStale` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — frontend/lib/version-check.ts:39
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 79 is called with an argument built by `json.dumps(response_json, indent = 2)` (line 79), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:79
`debug` at line 674 is called with an argument built by `"…".join(current_line)` (line 674), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdg.py:674
`debug` at line 680 is called with an argument built by `"…".join(current_line)` (line 680), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdg.py:680
`debug` at line 206 is called with an argument built by `"…".join(cmd)` (line 206), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/countdown_processor.py:206
`debug` at line 78 is called with an argument built by `[e.strip() for e in nvenc_encoders]` (line 78), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/video.py:78
`debug` at line 92 is called with an argument built by `"…".join(test_cmd)` (line 92), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/video.py:92
`debug` at line 516 is called with an argument built by `"…".join(cmd)` (line 516), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/video.py:516
`debug` at line 1496 is called with an argument built by `list(it.chain(* packets.values()))` (line 1496), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1496
`debug` at line 1690 is called with an argument built by `list(it.chain(* packets.values()))` (line 1690), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1690
`debug` at line 1808 is called with an argument built by `list(it.chain(* packets.values()))` (line 1808), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1808
`debug` at line 1873 is called with an argument built by `list(batched(image.getpalette(), 3))` (line 1873), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1873
`debug` at line 175 is called with an argument built by `"…".join(ngram)` (line 175), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:175
`debug` at line 188 is called with an argument built by `"…".join(ngram)` (line 188), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:188
`debug` at line 654 is called with an argument built by `"…".join(words)` (line 654), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — REDACTED:654
`debug` at line 726 is called with an argument built by `"…".join(w.text for w in gap_words)` (line 726), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — karaoke_gen/lyrics_transcriber/correction/corrector.py:726
`debug` at line 77 is called with an argument built by `list(data.keys())` (line 77), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — backend/services/firestore_service.py:77
`debug` at line 351 is called with an argument built by `"…".join(cmd)` (line 351), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — backend/services/local_preview_encoding_service.py:351
What to do
In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped7.5 / 10Strong✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
``document.documentElement.lang="${locale}";document.documentElement.dir="${['ar','he'].includes(locale)?'rtl':'ltr'}";`` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:36
`Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:84
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`useReviewSessionAutoSave` accepts `jobId` from the caller and keeps it in `jobId` on line 54, where only it can read the value — but nothing ever reads `jobId`. Setting `jobId` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `jobId` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `jobId` from the accepted options so callers stop setting a knob that does nothing. — frontend/hooks/use-review-session-autosave.ts:54
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
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.
`except Exception` 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. (×30) — karaoke_gen/audio_processor.py:46, karaoke_gen/utils/remote_cli.py:384, karaoke_gen/utils/remote_cli.py:595, …
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. (×9) — karaoke_gen/file_handler.py:185, REDACTED:732, REDACTED:784, …
`except` 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. — karaoke_gen/lyrics_transcriber/storage/dropbox.py:224
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info` at line 348 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:348
`info` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:353
`info` at line 364 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:364
`warning` at line 369 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:369
`warning` at line 372 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:372
`info` at line 374 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:374
`info` at line 400 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:400
`warning` at line 406 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:406
`info` at line 457 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:457
`info` at line 486 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:486
`info` at line 518 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:518
`info` at line 531 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:531
`warning` at line 574 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:574
`info` at line 613 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:613
`info` at line 621 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:621
`info` at line 626 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:626
`info` at line 643 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:643
`info` at line 657 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:657
`info` at line 738 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:738
`info` at line 752 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:752
`info` at line 926 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:926
`debug` at line 931 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:931
`info` at line 999 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:999
`info` at line 1056 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1056
`debug` at line 1077 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1077
`warning` at line 1081 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1081
`info` at line 1099 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1099
`info` at line 1141 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1141
`info` at line 1181 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1181
`info` at line 1204 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1204
`info` at line 1213 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1213
`info` at line 1291 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1291
`info` at line 1293 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1293
`info` at line 1384 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1384
`info` at line 1475 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1475
`debug` at line 1600 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1600
`info` at line 1658 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1658
`info` at line 1698 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1698
`info` at line 1751 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1751
`info` at line 1812 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — karaoke_gen/audio_fetcher.py:1812
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~1.1 `!` null assertions per 1k TypeScript source lines — 84 assertion(s) across the 76577 source line(s) of the 344 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: frontend/components/tenant-theme/TenantThemeEditorDialog.tsx (39), frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx (10), frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx (8). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 37 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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: this repository stores data through 'sqlite3' (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py:3) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration 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 its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'sqlite3' (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py:3) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). 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' (karaoke_gen/lyrics_transcriber/correction/agentic/feedback/retention.py:3) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration 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.
Not included — 44 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.
AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
AX1 Captive dependencies — Not applicable: this repository's JavaScript 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; this repository's Python 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; this repository's TypeScript 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.
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — -------------------- ERROR: failed to solve: us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to resolve source metadata for us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-base:latest: failed to do request: Head "https://us-central1-docker.pkg.dev/v2/nomadkaraoke/karaoke-repo/karaoke-backend-base/manifests/latest": Forbidden; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability NOT MEASURED: the JavaScript/TypeScript suite's dependency install refused the committed lockfile, so no test ever ran and flakiness could not be exercised — the dependency install for frontend/ refused the committed lockfile (ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json), so the suite never ran. It is excluded from the score rather than counted as a defect; a lockfile in sync with REDACTED is what lets the suite be re-run.
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.
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"]`.
D25 ADR Conformance — no ADRs to check
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for frontend/ refused the committed lockfile (ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (95 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
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
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 a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, 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.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 31% of this repository's production lines — python (159,391 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — X29 reached only 31% of this repository's production lines — python (159,391 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — 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.
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.
AC2 · Forms & labels· <button> with no accessible text · ×12
<button> with no accessible text frontend/app/[locale]/app/page.tsx:318— 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 frontend/app/[locale]/app/page.tsx:357— 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 frontend/app/[locale]/page.tsx:842— 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 frontend/app/[locale]/r/client.tsx:212— 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 frontend/components/audio-editor/AudioEditRestoreDialog.tsx:116— 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 frontend/components/audio-editor/AudioEditor.tsx:890— 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 frontend/components/audio-search/AudioSearchDialog.tsx:356— 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 frontend/components/auth-banner.tsx:96— 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 frontend/components/feedback/FeedbackDialog.tsx: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 frontend/components/instrumental-review/MuteRegionEditor.tsx:94— 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 frontend/components/job/steps/AudioSourceStep.tsx:947— 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 frontend/components/job/steps/AudioSourceStep.tsx:1049— 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).
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×12
Click handler on a non-interactive <div> frontend/app/admin/edit-reviews/page.tsx:148— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> frontend/components/job/ImageUploadField.tsx:116— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/job/TenantJobFlow.tsx:382— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/lyrics-review/AgenticCorrectionMetrics.tsx:150— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/lyrics-review/TimelineEditor.tsx:454— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/lyrics-review/TimelineEditor.tsx:461— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/lyrics-review/TimelineEditor.tsx:577— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> frontend/components/lyrics-review/WaveformSegmentRow.tsx:180— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> infrastructure/monitoring/job-inspector.html:368— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> infrastructure/monitoring/job-inspector.html:417— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> infrastructure/monitoring/job-inspector.html:475— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> infrastructure/monitoring/job-inspector.html:517— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Banned license: mutagen — `mutagen` 1.48.1 is published on PyPI under `GPL-2.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: pyinstaller — `pyinstaller` 6.22.3 is published on PyPI under `GPL-2.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: python-levenshtein — `python-levenshtein` 0.27.5 is published on PyPI under `GPL-2.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: syllables — `syllables` 1.1.5 is published on PyPI under `GPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: levenshtein — `levenshtein` 0.27.5 is published on PyPI under `GPL-2.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: text-unidecode — `text-unidecode` 1.3 is published on PyPI under `GPL-2.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: cmudict — `cmudict` 1.1.3 is published on PyPI under `GPL-3.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: dtw-python — `dtw-python` 1.9.0 is published on PyPI under `GPL-3.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
Banned license: rtfde — `rtfde` 0.1.2.2 is published on PyPI under `LGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: pcodedmp — `pcodedmp` 1.2.6 is published on PyPI under `GPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
AC2 · Forms & labels· <input> without a programmatic label · ×8
<input> without a programmatic label frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:660— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/app/[locale]/r/client.tsx:195— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/app/[locale]/requests/client.tsx:369— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/app/[locale]/requests/client.tsx:378— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/app/[locale]/requests/client.tsx:413— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/components/audio-editor/AudioEditor.tsx:1419— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label frontend/components/job/steps/CustomizeStep.tsx:624— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label frontend/components/job/steps/CustomizeStep.tsx:709— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <label> that labels no control · ×6
<label> that labels no control frontend/app/[locale]/page.tsx:741— This <label> has no htmlFor 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 htmlFor="<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 REDACTED:191— This <label> has no htmlFor 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 htmlFor="<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 REDACTED:201— This <label> has no htmlFor 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 htmlFor="<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 frontend/components/audio-search/AudioSearchDialog.tsx:197— This <label> has no htmlFor 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 htmlFor="<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 frontend/components/audio-search/AudioSearchDialog.tsx:208— This <label> has no htmlFor 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 htmlFor="<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 frontend/components/job/ImageUploadField.tsx:71— This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×5
Click handler on a non-interactive <span> frontend/components/auth/AuthStatus.tsx:100— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> frontend/components/lyrics-review/CorrectedWordWithActions.tsx:49— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> frontend/components/lyrics-review/TranscriptionView.tsx:345— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> frontend/components/lyrics-review/WaveformSegmentRow.tsx:119— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> frontend/components/lyrics-review/shared/Word.tsx:89— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <p> · ×2
Click handler on a non-interactive <p> REDACTED:1227— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <p> frontend/components/version-footer.tsx:138— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×2
Hover-only interaction on <div> frontend/components/instrumental-review/MuteRegionEditor.tsx:81— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> frontend/components/lyrics-review/EditFeedbackBar.tsx:106— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
D30 · Dependency Vulnerabilities· High vulnerability · ×2
REDACTED
REDACTED
AC2 · Forms & labels· <select> without a programmatic label · ×1
<select> without a programmatic label REDACTED:878— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure· Document without a <title> · ×1
Document without a <title> frontend/app/global-error.tsx:28— A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×1
Clickable element isn't keyboard-operable frontend/components/instrumental-review/WaveformViewer.tsx:321— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <canvas> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <canvas> · ×1
Click handler on a non-interactive <canvas> frontend/components/lyrics-review/BackingVocalsWaveform.tsx:136— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D11 · Test Reliability· Test suite cannot be installed from its own lockfile · ×1
Test suite cannot be installed from its own lockfile: frontend/ — The jest suite in frontend/ was never exercised because its dependency install refused the committed lockfile — the dependency install for frontend/ refused the committed lockfile (ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json), so the suite never ran. The suite is declared and committed but cannot be installed from what the repository ships, so neither this scan nor a new contributor can run it. The ask is the one the owner performs: run the install locally and commit the lockfile it writes.
Unlisted import 'nanoid' frontend/components/lyrics-review/modals/EditModal.tsx:11— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
FunctionTooLong: page.AdminJobsPageContent REDACTED:139— FunctionTooLong — AdminJobsPageContent runs 1857 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1757 over it, 18.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: LyricsAnalyzer.LyricsAnalyzer frontend/components/lyrics-review/LyricsAnalyzer.tsx:144— FunctionTooLong — LyricsAnalyzer runs 1348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1248 over it, 13.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AudioEditor.AudioEditor frontend/components/audio-editor/AudioEditor.tsx:341— FunctionTooLong — AudioEditor runs 897 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 797 over it, 8.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.ConsumerLandingPage frontend/app/[locale]/page.tsx:44— FunctionTooLong — ConsumerLandingPage runs 760 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 660 over it, 7.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.AdminUserDetailPage REDACTED:76— FunctionTooLong — AdminUserDetailPage runs 747 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 647 over it, 7.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.
FunctionTooLong: TenantThemeEditorDialog.TenantThemeEditorDialog frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94— FunctionTooLong — TenantThemeEditorDialog runs 625 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 525 over it, 6.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: LyricsSynchronizer.LyricsSynchronizer frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:55— FunctionTooLong — LyricsSynchronizer runs 615 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 515 over it, 6.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.ReferralsPage frontend/app/admin/referrals/page.tsx:37— FunctionTooLong — ReferralsPage runs 606 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 506 over it, 6.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.AdminRateLimitsPage frontend/app/admin/rate-limits/page.tsx:43— FunctionTooLong — AdminRateLimitsPage runs 593 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 493 over it, 5.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: OutputLinks.OutputLinks frontend/components/job/OutputLinks.tsx:41— FunctionTooLong — OutputLinks runs 585 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 485 over it, 5.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: InstrumentalSelector.InstrumentalSelector frontend/components/instrumental-review/InstrumentalSelector.tsx:56— FunctionTooLong — InstrumentalSelector runs 584 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 484 over it, 5.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.
FunctionTooLong: page.AdminTenantsPage frontend/app/admin/tenants/page.tsx:126— FunctionTooLong — AdminTenantsPage runs 576 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 476 over it, 5.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: JobSubmission.JobSubmission frontend/components/job/JobSubmission.tsx:24— FunctionTooLong — JobSubmission runs 568 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 468 over it, 5.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TenantBulkFlow.TenantBulkFlow frontend/components/job/TenantBulkFlow.tsx:91— FunctionTooLong — TenantBulkFlow runs 495 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 395 over it, 4.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.AdminUsersPage REDACTED:79— FunctionTooLong — AdminUsersPage runs 467 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 367 over it, 4.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TimelineCanvas.TimelineCanvas frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:107— FunctionTooLong — TimelineCanvas runs 457 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 357 over it, 4.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ReferralDashboard.ReferralDashboard frontend/components/referrals/ReferralDashboard.tsx:26— FunctionTooLong — ReferralDashboard runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: CustomizeStep.CustomizeStep frontend/components/job/steps/CustomizeStep.tsx:295— FunctionTooLong — CustomizeStep runs 430 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 330 over it, 4.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: client.RequestsBoardClient frontend/app/[locale]/requests/client.tsx:62— FunctionTooLong — RequestsBoardClient runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: GuidedJobFlow.GuidedJobFlow frontend/components/job/GuidedJobFlow.tsx:98— FunctionTooLong — GuidedJobFlow runs 425 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 325 over it, 4.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.AppPageContent frontend/app/[locale]/app/page.tsx:50— FunctionTooLong — AppPageContent runs 417 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 317 over it, 4.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.
FunctionTooLong: AudioSourceStep.AudioSourceStep frontend/components/job/steps/AudioSourceStep.tsx:135— FunctionTooLong — AudioSourceStep runs 411 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 311 over it, 4.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: EditModal.EditModal frontend/components/lyrics-review/modals/EditModal.tsx:45— FunctionTooLong — EditModal runs 397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 297 over it, 3.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: HighlightedText.HighlightedText frontend/components/lyrics-review/shared/HighlightedText.tsx:81— FunctionTooLong — HighlightedText runs 392 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ReplaceAllLyricsModal.ReplaceAllLyricsModal frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx:48— FunctionTooLong — ReplaceAllLyricsModal runs 382 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× 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.
Hotspot: frontend/components/lyrics-review/LyricsAnalyzer.tsx frontend/components/lyrics-review/LyricsAnalyzer.tsx:144— frontend/components/lyrics-review/LyricsAnalyzer.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 276 in LyricsAnalyzer.LyricsAnalyzer at line 144. 5 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/lyrics-review/LyricsAnalyzer.tsx`: 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: backend/api/routes/file_upload.py backend/api/routes/file_upload.py:487— backend/api/routes/file_upload.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in file_upload.upload_and_create_job at line 487. 8 of those changes were fix/bug commits, and the other 11 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/file_upload.py`: 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: backend/api/routes/internal.py backend/api/routes/internal.py:1185— backend/api/routes/internal.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in internal._recover_stuck_jobs_sync at line 1185. 11 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/internal.py`: 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: backend/api/routes/jobs.py backend/api/routes/jobs.py:2094— backend/api/routes/jobs.py changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in jobs.retry_job at line 2094. 13 of those changes were fix/bug commits, and the other 19 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/jobs.py`: 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: REDACTED REDACTED:139— REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 304 in page.AdminJobsPageContent at line 139. 1 of those changes was a fix/bug commit, 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- REDACTED`: 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: frontend/lib/api.ts frontend/lib/api.ts:635— frontend/lib/api.ts changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in api.apiFetch at line 635. 11 of those changes were fix/bug commits, and the other 41 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/lib/api.ts`: 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: backend/workers/video_worker.py backend/workers/video_worker.py:230— backend/workers/video_worker.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in video_worker.generate_video_orchestrated at line 230. 15 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/workers/video_worker.py`: 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: frontend/components/lyrics-review/PreviewVideoSection.tsx frontend/components/lyrics-review/PreviewVideoSection.tsx:85— frontend/components/lyrics-review/PreviewVideoSection.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in PreviewVideoSection.PreviewVideoSection at line 85. 3 of those changes were fix/bug commits, 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/lyrics-review/PreviewVideoSection.tsx`: 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: REDACTED REDACTED:811— REDACTED changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in review.get_correction_data at line 811. 21 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- REDACTED`: 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: backend/api/routes/users.py backend/api/routes/users.py:1703— backend/api/routes/users.py changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in users.stripe_webhook at line 1703. 7 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/users.py`: 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: backend/workers/render_video_worker.py backend/workers/render_video_worker.py:93— backend/workers/render_video_worker.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in render_video_worker.process_render_video at line 93. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/workers/render_video_worker.py`: 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: frontend/components/job/OutputLinks.tsx frontend/components/job/OutputLinks.tsx:41— frontend/components/job/OutputLinks.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in OutputLinks.OutputLinks at line 41. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/job/OutputLinks.tsx`: 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: frontend/components/tenant-theme/TenantThemeEditorDialog.tsx frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94— frontend/components/tenant-theme/TenantThemeEditorDialog.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 145 in TenantThemeEditorDialog.TenantThemeEditorDialog at line 94. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/tenant-theme/TenantThemeEditorDialog.tsx`: 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: frontend/components/lyrics-review/TimelineEditor.tsx frontend/components/lyrics-review/TimelineEditor.tsx:64— frontend/components/lyrics-review/TimelineEditor.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in TimelineEditor.TimelineEditor at line 64. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/lyrics-review/TimelineEditor.tsx`: 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: backend/api/routes/admin.py backend/api/routes/admin.py:933— backend/api/routes/admin.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in admin.update_job at line 933. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/admin.py`: 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: frontend/components/lyrics-review/modals/ReviewChangesModal.tsx frontend/components/lyrics-review/modals/ReviewChangesModal.tsx:76— frontend/components/lyrics-review/modals/ReviewChangesModal.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in ReviewChangesModal.ReviewChangesModal at line 76. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/lyrics-review/modals/ReviewChangesModal.tsx`: 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: backend/services/job_manager.py backend/services/job_manager.py:693— backend/services/job_manager.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in JobManager._transition_to_state_unlocked at line 693. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/services/job_manager.py`: 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: backend/api/routes/audio_search.py backend/api/routes/audio_search.py:685— backend/api/routes/audio_search.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in audio_search.search_audio at line 685. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/audio_search.py`: 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: backend/workers/audio_worker.py backend/workers/audio_worker.py:139— backend/workers/audio_worker.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in audio_worker.process_audio_separation at line 139. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/workers/audio_worker.py`: 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: REDACTED REDACTED:1079— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in main.run_encoding at line 1079. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- REDACTED`: 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: backend/workers/video_worker_orchestrator.py backend/workers/video_worker_orchestrator.py:825— backend/workers/video_worker_orchestrator.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in VideoWorkerOrchestrator._upload_to_youtube at line 825. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/workers/video_worker_orchestrator.py`: 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: frontend/app/[locale]/requests/client.tsx frontend/app/[locale]/requests/client.tsx:62— frontend/app/[locale]/requests/client.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in client.RequestsBoardClient at line 62. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/app/[locale]/requests/client.tsx`: 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: REDACTED REDACTED:87— REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in executor.maybe_auto_complete_review at line 87. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- REDACTED`: 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: frontend/components/lyrics-review/modals/EditModal.tsx frontend/components/lyrics-review/modals/EditModal.tsx:45— frontend/components/lyrics-review/modals/EditModal.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in EditModal.EditModal 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/lyrics-review/modals/EditModal.tsx`: 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: frontend/components/job/bulk/BulkAlbumMode.tsx frontend/components/job/bulk/BulkAlbumMode.tsx:208— frontend/components/job/bulk/BulkAlbumMode.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in BulkAlbumMode.BulkAlbumMode at line 208. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/components/job/bulk/BulkAlbumMode.tsx`: 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.
FileTooLong: lib/api.ts frontend/lib/api.ts— FileTooLong — 3187 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2687 over it, 6.37× 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: routes/admin.py backend/api/routes/admin.py— FileTooLong — 2942 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2442 over it, 5.88× 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: utils/remote_cli.py karaoke_gen/utils/remote_cli.py— FileTooLong — 2316 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1816 over it, 4.63× 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 — 2203 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1703 over it, 4.41× 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: routes/jobs.py backend/api/routes/jobs.py— FileTooLong — 2139 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1639 over it, 4.28× 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 — 1996 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: AdminJobsPageContent (139-2394). The bar is 500 significant lines; this is 1496 over it, 3.99× 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: routes/file_upload.py backend/api/routes/file_upload.py— FileTooLong — 1838 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1338 over it, 3.68× 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 — 1545 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1045 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lyrics-review/LyricsAnalyzer.tsx frontend/components/lyrics-review/LyricsAnalyzer.tsx— FileTooLong — 1475 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: LyricsAnalyzer (144-2076). The bar is 500 significant lines; this is 975 over it, 2.95× 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: cdgmaker/composer.py karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py— FileTooLong — 1433 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 933 over it, 2.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ass/ass.py karaoke_gen/lyrics_transcriber/output/ass/ass.py— FileTooLong — 1411 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 911 over it, 2.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1401 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 901 over it, 2.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: workers/video_worker.py backend/workers/video_worker.py— FileTooLong — 1286 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 786 over it, 2.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: routes/users.py backend/api/routes/users.py— FileTooLong — 1197 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 697 over it, 2.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: steps/AudioSourceStep.tsx frontend/components/job/steps/AudioSourceStep.tsx— FileTooLong — 1190 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 690 over it, 2.38× 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: audio-editor/AudioEditor.tsx frontend/components/audio-editor/AudioEditor.tsx— FileTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: AudioEditor (341-1458). The bar is 500 significant lines; this is 653 over it, 2.31× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: routes/internal.py backend/api/routes/internal.py— FileTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 650 over it, 2.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: REDACTED REDACTED— FileTooLong — 1059 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 559 over it, 2.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: routes/audio_search.py backend/api/routes/audio_search.py— FileTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 537 over it, 2.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/job_manager.py backend/services/job_manager.py— FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 496 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: karaoke_gen/audio_fetcher.py karaoke_gen/audio_fetcher.py— FileTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 454 over it, 1.91× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 454 over it, 1.91× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 451 over it, 1.90× 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: utils/gen_cli.py karaoke_gen/utils/gen_cli.py— FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 392 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/user_service.py backend/services/user_service.py— FileTooLong — 882 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 382 over it, 1.76× 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.
+ 43 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/[locale]/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/admin/payments/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/sidebar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/job/JobSubmission.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/admin/edit-reviews/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/admin/audio-edits/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/[locale]/app/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/referrals/ReferralDashboard.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/admin/searches/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/admin/feedback/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/hooks/use-notifications.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/menubar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/push-settings.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/context-menu.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/field.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/carousel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/app/[locale]/r/client.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/autocomplete-input.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/components/ui/calendar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Swallowed exception (caught, then discarded) karaoke_gen/audio_processor.py:46— `except Exception` 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) karaoke_gen/utils/remote_cli.py:384— `except Exception` 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) karaoke_gen/utils/remote_cli.py:595— `except Exception` 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) karaoke_gen/utils/remote_cli.py:644— `except Exception` 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) karaoke_gen/utils/remote_cli.py:867— `except Exception` 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) karaoke_gen/utils/remote_cli.py:915— `except Exception` 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) karaoke_gen/utils/remote_cli.py:946— `except Exception` 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) karaoke_gen/utils/remote_cli.py:977— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1048— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1061— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1072— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1087— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1098— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1122— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1170— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1185— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1307— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1314— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1371— `except Exception` 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) karaoke_gen/utils/remote_cli.py:1386— `except Exception` 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) karaoke_gen/lyrics_transcriber/storage/dropbox.py:224— `except` 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) REDACTED:40— `except Exception` 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) REDACTED:48— `except Exception` 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) REDACTED:54— `except Exception` 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) REDACTED:60— `except Exception` 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.
+ 6 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×19
TodoComment scripts/setup-vocalstar-tenant.py:243— # TODO: Create favicon — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/cdg.py:12— # TODO Find out how to store proper parity bytes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:457— # TODO Make more values in these set-draw-times functions into named — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1062— # TODO Improve this code for waiting to start instrumentals! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1311— # TODO Add option for borders in instrumentals — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1538— # TODO Make it so the intro screen is not hardcoded — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1723— # TODO Make it so the outro screen is not hardcoded — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:270— # is visible in logs without paging. TODO: the Musixmatch RapidAPI endpoint — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:172— # TODO: Re-enable this once we figure out why the resulting MP4s are 10x larger than when encoded with x264... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment infrastructure/__main__.py:154— # TODO: Deny policy creation fails via Pulumi (v2beta API 404 / IAM permissions issue). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment frontend/e2e/regression/impersonation.spec.ts:109— // TODO: Test skipped - impersonation banner requires in-memory zustand state — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment frontend/e2e/regression/impersonation.spec.ts:121— // TODO: Test skipped - requires full impersonation flow simulation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment frontend/e2e/regression/job-management.spec.ts:229— // TODO: Fix this test - needs to properly expand job card and verify download UI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment backend/workers/screens_worker.py:885— # TODO: Implement padding application — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:2151— # TODO(i18n): translate subject/body once duration-confirm keys are added to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:2430— # TODO(i18n): translate subject/body once duration-confirm keys are added to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment backend/scripts/generate_state_diagram.py:253— # TODO: Implement auto-update of ARCHITECTURE.md — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
AC3 · Page structure· Page without a main landmark · ×14
Page without a main landmark backend/templates/printables/website-referral-flyer-dark.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 backend/templates/printables/website-referral-flyer.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 frontend/app/global-error.tsx:28— 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 frontend/components/referrals/FlyerExport.ts:96— 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 infrastructure/monitoring/job-inspector.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 karaoke_gen/nextjs_frontend/404.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/404/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/_not-found/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/app/jobs/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/app/jobs/local/instrumental/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/app/jobs/local/review/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/auth/verify/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/order/success/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
Page without a main landmark karaoke_gen/nextjs_frontend/payment/success/index.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. Note: this file is React server-rendered output, not hand-authored markup — an edit here is overwritten by the next build. Make the change in the component that renders it (for react-email, the `.tsx` whose Tailwind classes or inline styles produce the values above) and regenerate.
ClassTooLong: LyricsAnalyzer frontend/components/lyrics-review/LyricsAnalyzer.tsx:1— ClassTooLong — 1348 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 948 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AudioEditor frontend/components/audio-editor/AudioEditor.tsx:1— ClassTooLong — 897 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 497 over it, 2.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: api frontend/lib/api.ts:1— ClassTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 489 over it, 2.22× 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: TenantThemeEditorDialog frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:1— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 225 over it, 1.56× 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: LyricsSynchronizer frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:1— ClassTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 215 over it, 1.54× 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: OutputLinks frontend/components/job/OutputLinks.tsx:1— ClassTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 185 over it, 1.46× 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: InstrumentalSelector frontend/components/instrumental-review/InstrumentalSelector.tsx:1— ClassTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 184 over it, 1.46× 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: JobSubmission frontend/components/job/JobSubmission.tsx:1— ClassTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 168 over it, 1.42× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TenantBulkFlow frontend/components/job/TenantBulkFlow.tsx:1— ClassTooLong — 495 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 95 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TimelineCanvas frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:1— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 57 over it, 1.14× 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: ReferralDashboard frontend/components/referrals/ReferralDashboard.tsx:1— ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 31 over it, 1.08× 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: CustomizeStep frontend/components/job/steps/CustomizeStep.tsx:1— ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 30 over it, 1.08× 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: GuidedJobFlow frontend/components/job/GuidedJobFlow.tsx:1— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 25 over it, 1.06× 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: AudioSourceStep frontend/components/job/steps/AudioSourceStep.tsx:1— ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 11 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 (10 lines × 2) REDACTED:3273— REDACTED:3273-3282 | REDACTED:3323-3332 — both copies are in the same file, so extract the 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) backend/api/routes/users.py:2115— backend/api/routes/users.py:2115-2124 | backend/api/routes/users.py:2207-2216 — both copies are in the same file, so extract the 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) backend/services/tenant_admin_service.py:478— backend/services/tenant_admin_service.py:478-487 | backend/services/tenant_admin_service.py:641-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) backend/services/user_service.py:789— backend/services/user_service.py:789-798 | backend/services/user_service.py:803-812 — both copies are in the same file, so extract the 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) backend/workers/audio_download_worker.py:626— backend/workers/audio_download_worker.py:626-635 | backend/workers/audio_download_worker.py:664-673 — both copies are in the same file, so extract the 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 `backend/workers/audio_download_worker.py:626` 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 × 2) backend/workers/audio_worker.py:450— backend/workers/audio_worker.py:450-459 | backend/workers/audio_worker.py:462-471 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) backend/workers/video_worker_orchestrator.py:605— backend/workers/video_worker_orchestrator.py:605-614 | backend/workers/video_worker_orchestrator.py:636-645 — both copies are in the same file, so extract the 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 `backend/workers/video_worker_orchestrator.py:636` 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) infrastructure/modules/cloud_run.py:273— infrastructure/modules/cloud_run.py:273-282 | infrastructure/modules/cloud_run.py:921-930 — both copies are in the same file, so extract the 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 `infrastructure/modules/cloud_run.py:273` 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 × 2) REDACTED:1869— REDACTED:1869-1878 | REDACTED:244-253 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1868` calls `warning` and `REDACTED:243` 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 (10 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:48— karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:48-57 | karaoke_gen/lyrics_transcriber/correction/handlers/syllables_match.py:57-67 — 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 (10 lines × 2) karaoke_gen/utils/remote_cli.py:940— karaoke_gen/utils/remote_cli.py:940-949 | karaoke_gen/utils/remote_cli.py:971-980 — both copies are in the same file, so extract the 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 `karaoke_gen/utils/remote_cli.py:940` 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) karaoke_gen/utils/remote_cli.py:2581— karaoke_gen/utils/remote_cli.py:2581-2590 | karaoke_gen/utils/remote_cli.py:2645-2654 — both copies are in the same file, so extract the 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, `karaoke_gen/utils/remote_cli.py:2578` calls `error` and `karaoke_gen/utils/remote_cli.py:2643` 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 (10 lines × 2) infrastructure/functions/divebar_lookup/main.py:738— infrastructure/functions/divebar_lookup/main.py:738-747 | infrastructure/functions/divebar_lookup/main.py:749-758 — both copies are in the same file, so extract the 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.
AC2 · Forms & labels· <Select> field component without a label · ×12
<Select> field component without a label REDACTED:1660— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label REDACTED:2240— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/app/admin/payments/page.tsx:205— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/app/admin/payments/page.tsx:434— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/app/admin/payments/page.tsx:445— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/app/admin/payments/page.tsx:734— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/app/admin/payments/page.tsx:748— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/app/admin/searches/page.tsx:259— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label REDACTED:321— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label REDACTED:332— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/components/admin/refund-dialog.tsx:138— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/components/job/bulk/BulkAlbumMode.tsx:388— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
No assertions: skips — no fixtures found (run: node e2e/fixtures/fetch-search-fixtures.mjs) frontend/lib/__tests__/audio-search-confidence-fixtures.test.ts:67— 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.
No assertions: expired admin_token redirects to landing page frontend/e2e/regression/admin-token-auth.spec.ts:93— 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.
No assertions: non-admin cannot access admin users page frontend/e2e/regression/impersonation.spec.ts:276— 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.
No assertions: refresh button fetches updated jobs frontend/e2e/regression/job-management.spec.ts:147— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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.
No assertions: delete job button works frontend/e2e/regression/job-management.spec.ts:352— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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.
No assertions: text/timeline toggle exists frontend/e2e/regression/lyrics-review.spec.ts:535— 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.
No assertions: capture homepage frontend/e2e/regression/take-screenshots.spec.ts:25— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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.
No assertions: capture lyrics review UI frontend/e2e/regression/take-screenshots.spec.ts:44— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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.
No assertions: capture instrumental review UI frontend/e2e/regression/take-screenshots.spec.ts:61— 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.
No assertions: capture email templates frontend/e2e/regression/take-screenshots.spec.ts:78— 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.
No assertions: Add Reference Lyrics via API frontend/e2e/production/lyrics-review-only.spec.ts:240— 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.
No assertions: no fixtures to review frontend/e2e/fixtures/review-fixtures.spec.ts:291— 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.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1453— # HACK To properly draw and layer everything, I need to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1855— # HACK The RGB values of the colors that show up in CDG — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1975— # HACK If I position each line at its proper Y position, it — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2100— # HACK If I don't specify "utf-8-sig" as the encoding, the — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2142— # HACK This ensures the last video frame isn't some CDG — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2151— # HACK The libx264 codec requires the video dimensions — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2178— # HACK This effectively removes the video padding that was — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2235— # HACK: This is what's known in the biz as a "monkey-patch". Don't — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:283— # HACK Assuming the palette is in RGB, there should be one palette — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:386— # HACK If the only color is 0 (and we're not drawing over a — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/render.py:104— # HACK I don't know exactly why, but sometimes a few pixels are cut — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment karaoke_gen/lyrics_transcriber/output/cdgmaker/render.py:253— # HACK For whatever reason, the presence or absence of certain — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
Duplicated block (9 lines × 2) backend/api/routes/jobs.py:1836— backend/api/routes/jobs.py:1836-1844 | backend/api/routes/jobs.py:1937-1945 — both copies are in the same file, so extract the 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) backend/models/audio_edit_session.py:95— backend/models/audio_edit_session.py:95-103 | backend/models/review_session.py:93-101 — 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 `backend/models/audio_edit_session.py:95` 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, `backend/models/audio_edit_session.py:106` calls `get` and `backend/models/review_session.py:104` 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) backend/services/gdrive_service.py:541— backend/services/gdrive_service.py:541-549 | backend/services/gdrive_service.py:559-567 — both copies are in the same file, so extract the 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) backend/workers/karaokehunt_conversion.py:309— backend/workers/karaokehunt_conversion.py:309-317 | backend/workers/karaokehunt_conversion.py:330-338 — both copies are in the same file, so extract the 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 (9 lines × 2) backend/workers/lyrics_worker.py:591— backend/workers/lyrics_worker.py:591-599 | backend/workers/lyrics_worker.py:602-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. 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 × 2) frontend/scripts/translate.py:157— frontend/scripts/translate.py:157-165 | frontend/scripts/validate-translations.py:26-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 × 2) frontend/scripts/translate.py:475— frontend/scripts/translate.py:475-483 | frontend/scripts/translate.py:498-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 `frontend/scripts/translate.py:498` 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) REDACTED:293— REDACTED:293-301 | REDACTED:347-355 — both copies are in the same file, so extract the 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) REDACTED:84— REDACTED:84-92 | REDACTED:36-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) karaoke_gen/lyrics_transcriber/types.py:132— karaoke_gen/lyrics_transcriber/types.py:132-140 | scripts/review_test_fixtures.py:146-154 — 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 `karaoke_gen/lyrics_transcriber/types.py:132` 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) karaoke_gen/lyrics_transcriber/core/controller.py:158— karaoke_gen/lyrics_transcriber/core/controller.py:158-166 | karaoke_gen/lyrics_transcriber/output/cdg.py:85-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) scripts/analyze_reference_relevance.py:347— scripts/analyze_reference_relevance.py:347-355 | scripts/review_reference_relevance.py:1118-1126 — 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 `scripts/analyze_reference_relevance.py:347` 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) backend/api/routes/audio_search.py:1172— backend/api/routes/audio_search.py:1172-1180 | backend/api/routes/audio_search.py:1291-1298 — both copies are in the same file, so extract the 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) backend/workers/render_video_worker.py:826— backend/workers/render_video_worker.py:826-833 | backend/workers/render_video_worker.py:839-846 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) karaoke_gen/audio_processor.py:401— karaoke_gen/audio_processor.py:401-408 | karaoke_gen/audio_processor.py:468-475 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/output/segment_resizer.py:798— karaoke_gen/lyrics_transcriber/output/segment_resizer.py:798-805 | karaoke_gen/lyrics_transcriber/output/segment_resizer.py:808-815 — both copies are in the same file, so extract the 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) REDACTED:297— REDACTED:297-304 | REDACTED:319-326 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/storage/dropbox.py:91— karaoke_gen/lyrics_transcriber/storage/dropbox.py:91-98 | karaoke_gen/lyrics_transcriber/storage/dropbox.py:106-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) karaoke_gen/utils/remote_cli.py:2021— karaoke_gen/utils/remote_cli.py:2021-2028 | karaoke_gen/utils/remote_cli.py:2041-2048 — both copies are in the same file, so extract the 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, `karaoke_gen/utils/remote_cli.py:2051` calls `lower`, `_extract_cdg_files` and `karaoke_gen/utils/remote_cli.py:2029` 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 × 2) karaoke_gen/utils/remote_cli.py:3023— karaoke_gen/utils/remote_cli.py:3023-3030 | karaoke_gen/utils/remote_cli.py:3104-3111 — both copies are in the same file, so extract the 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) REDACTED:313— REDACTED:313-320 | REDACTED:1272-1279 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/lyrics/genius.py:223— karaoke_gen/lyrics_transcriber/lyrics/genius.py:223-230 | karaoke_gen/lyrics_transcriber/lyrics/spotify.py:143-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) scripts/analyze_reference_relevance.py:138— scripts/analyze_reference_relevance.py:138-145 | scripts/review_reference_relevance.py:111-118 — 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) scripts/karaokehunt_outreach/phase2_execute.py:158— scripts/karaokehunt_outreach/phase2_execute.py:158-167 | scripts/karaokehunt_outreach/phase_batch_generate.py:103-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 `scripts/karaokehunt_outreach/phase2_execute.py:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) backend/api/routes/kjbox.py:239— backend/api/routes/kjbox.py:239-250 | backend/api/routes/login_code.py:241-253 — 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 `backend/api/routes/kjbox.py:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) backend/services/catalog_proxy_service.py:62— backend/services/catalog_proxy_service.py:62-73 | backend/services/catalog_proxy_service.py:94-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) backend/services/custom_lyrics/service.py:332— backend/services/custom_lyrics/service.py:332-343 | backend/services/custom_lyrics/validator.py:40-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) backend/workers/video_worker.py:725— backend/workers/video_worker.py:725-736 | backend/workers/video_worker.py:739-750 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) karaoke_gen/audio_fetcher.py:994— karaoke_gen/audio_fetcher.py:994-1005 | karaoke_gen/audio_fetcher.py:1653-1664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) karaoke_gen/audio_processor.py:383— karaoke_gen/audio_processor.py:383-394 | karaoke_gen/audio_processor.py:453-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) REDACTED:1893— REDACTED:1893-1904 | REDACTED:264-275 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1892` calls `error` and `REDACTED:263` 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) karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:117— karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:117-128 | karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:312-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) REDACTED:504— REDACTED:504-515 | REDACTED:520-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) karaoke_gen/audio_processor.py:557— karaoke_gen/audio_processor.py:557-568 | karaoke_gen/audio_processor.py:620-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `karaoke_gen/audio_processor.py:571` calls `lower` and `karaoke_gen/audio_processor.py:634` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) backend/api/routes/admin.py:2026— backend/api/routes/admin.py:2026-2036 | backend/api/routes/admin.py:2091-2101 — both copies are in the same file, so extract the 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 × 2) backend/api/routes/internal.py:1868— backend/api/routes/internal.py:1868-1878 | backend/api/routes/users.py:1801-1811 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) backend/api/routes/users.py:1872— backend/api/routes/users.py:1872-1883 | backend/api/routes/users.py:1905-1915 — both copies are in the same file, so extract the 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 × 2) backend/services/credit_evaluation_service.py:113— backend/services/credit_evaluation_service.py:113-123 | backend/services/credit_evaluation_service.py:128-138 — both copies are in the same file, so extract the 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 `backend/services/credit_evaluation_service.py:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) backend/services/flacfetch_client.py:819— backend/services/flacfetch_client.py:819-829 | backend/services/flacfetch_client.py:850-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. Read the line range as the matched WINDOW rather than a finished unit: at `backend/services/flacfetch_client.py:819` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) backend/workers/community_daily_pick.py:293— backend/workers/community_daily_pick.py:293-303 | backend/workers/karaokehunt_conversion.py:393-403 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:232— karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:232-242 | karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:313-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) karaoke_gen/utils/remote_cli.py:3032— karaoke_gen/utils/remote_cli.py:3032-3042 | karaoke_gen/utils/remote_cli.py:3148-3158 — both copies are in the same file, so extract the 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, `karaoke_gen/utils/remote_cli.py:3030` calls `info` and `karaoke_gen/utils/remote_cli.py:3146` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) backend/api/routes/admin.py:1782— backend/api/routes/admin.py:1782-1792 | backend/api/routes/jobs.py:390-400 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) REDACTED:1796— REDACTED:1796-1808 | REDACTED:110-120 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
TooManyMethods: ASS karaoke_gen/lyrics_transcriber/output/ass/ass.py:23— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: KaraokeFinalise REDACTED:26— 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: JobManager backend/services/job_manager.py:204— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReviewServer REDACTED:67— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: UserService backend/services/user_service.py:67— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× 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: FirestoreService backend/services/firestore_service.py:45— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EmailService REDACTED:466— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SongRequestService backend/services/song_request_service.py:105— 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: AnchorSequenceFinder REDACTED:25— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.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.
Duplicated block (16 lines × 2) backend/api/routes/auth.py:222— backend/api/routes/auth.py:222-237 | backend/api/routes/auth.py:280-295 — both copies are in the same file, so extract the 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 `backend/api/routes/auth.py:222` 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 (16 lines × 2) backend/services/flacfetch_client.py:259— backend/services/flacfetch_client.py:259-274 | backend/services/flacfetch_client.py:326-341 — both copies are in the same file, so extract the 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 `backend/services/flacfetch_client.py:259` 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 (16 lines × 2) backend/services/match_judge/ai.py:152— backend/services/match_judge/ai.py:152-167 | backend/services/parse_titles/ai.py:126-141 — 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 `backend/services/match_judge/ai.py:152` 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) backend/services/nomad_master_mirror.py:124— backend/services/nomad_master_mirror.py:124-139 | backend/services/nomad_master_mirror.py:159-174 — both copies are in the same file, so extract the 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 `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 (16 lines × 2) backend/workers/video_worker.py:277— backend/workers/video_worker.py:277-292 | backend/workers/video_worker.py:948-963 — both copies are in the same file, so extract the 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 (16 lines × 2) backend/workers/video_worker.py:336— backend/workers/video_worker.py:336-351 | backend/workers/video_worker.py:1001-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/workers/video_worker.py:1019` calls `info` and `backend/workers/video_worker.py:354` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) karaoke_gen/lyrics_transcriber/correction/agentic/workflows/consensus_workflow.py:7— karaoke_gen/lyrics_transcriber/correction/agentic/workflows/consensus_workflow.py:7-22 | karaoke_gen/lyrics_transcriber/correction/agentic/workflows/feedback_workflow.py:7-22 — 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 (16 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:98— karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:98-113 | karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:98-113 — before extracting anything, compare `karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py` and `karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) karaoke_gen/lyrics_transcriber/output/video.py:233— karaoke_gen/lyrics_transcriber/output/video.py:233-248 | karaoke_gen/lyrics_transcriber/output/video.py:313-328 — both copies are in the same file, so extract the 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.
Swallowed exception (empty catch) karaoke_gen/file_handler.py:185— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:732— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:784— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:1368— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:1411— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:1425— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) karaoke_gen/lyrics_transcriber/output/video.py:246— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) karaoke_gen/lyrics_transcriber/output/video.py:326— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) karaoke_gen/lyrics_transcriber/correction/agentic/providers/config.py:88— 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (4 members, 50+ identical tokens) backend/api/routes/file_upload.py:542— backend/api/routes/file_upload.py:542-1016 | backend/api/routes/file_upload.py:1278-1553 | backend/api/routes/file_upload.py:2008-2300 | backend/api/routes/file_upload.py:2350-2578 — 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) REDACTED:1416— REDACTED:1416-1543 | REDACTED:1761-1870 | REDACTED:1879-2017 | REDACTED:2026-2243 — 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) REDACTED:1663— REDACTED:1663-1710 | REDACTED:2476-2516 | REDACTED:2526-2553 | REDACTED:2563-2587 — 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) backend/services/email_validation_service.py:523— backend/services/email_validation_service.py:523-553 | backend/services/email_validation_service.py:602-632 | backend/services/email_validation_service.py:673-703 | backend/services/email_validation_service.py:744-774 — 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) backend/workers/audio_worker.py:140— backend/workers/audio_worker.py:140-495 | backend/workers/screens_worker.py:72-340 | backend/workers/video_worker.py:231-603 | backend/workers/video_worker.py:915-1315 — 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) backend/workers/lyrics_worker.py:197— backend/workers/lyrics_worker.py:197-626 | backend/workers/screens_worker.py:72-340 | backend/workers/video_worker.py:231-603 | backend/workers/video_worker.py:915-1315 — 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) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1242— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1242-1325 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1330-1480 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1888-1932 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1989-2068 — 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 (22 corresponding lines) · ×7
Edited copy of a member (22 corresponding lines) karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:83— karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:83-105 | karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:124-145 — 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.
Edited copy of a member (22 corresponding lines) backend/services/match_judge/ai.py:150— backend/services/match_judge/ai.py:150-173 | backend/services/parse_titles/ai.py:126-147 — 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.
Edited copy of a member (22 corresponding lines) backend/services/match_judge/free_text.py:346— backend/services/match_judge/free_text.py:346-367 | backend/services/tenant_bulk/analyze.py:503-528 — 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.
Edited copy of a member (22 corresponding lines) backend/services/push_notification_service.py:235— backend/services/push_notification_service.py:235-256 | backend/services/push_notification_service.py:443-475 — 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.
Edited copy of a member (22 corresponding lines) REDACTED:222— REDACTED:222-243 | REDACTED:437-461 — 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.
Edited copy of a member (22 corresponding lines) backend/api/routes/internal.py:702— backend/api/routes/internal.py:702-728 | backend/api/routes/internal.py:739-760 — 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.
Edited copy of a member (22 corresponding lines) infrastructure/functions/backup_to_aws/firestore_export.py:10— infrastructure/functions/backup_to_aws/firestore_export.py:10-33 | infrastructure/functions/backup_to_aws/firestore_export.py:37-58 — 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 (10 corresponding lines) · ×7
Edited copy of a member (10 corresponding lines) REDACTED:1945— REDACTED:1945-1955 | REDACTED:2022-2032 — 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) karaoke_gen/lyrics_transcriber/output/ass/event.py:70— karaoke_gen/lyrics_transcriber/output/ass/event.py:70-82 | karaoke_gen/lyrics_transcriber/output/ass/event.py:85-94 — 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) REDACTED:847— REDACTED:847-860 | REDACTED:863-872 — 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) backend/services/auto_approval/lyrics_diff.py:109— backend/services/auto_approval/lyrics_diff.py:109-124 | backend/services/auto_correct/deterministic.py:151-160 — 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) karaoke_gen/lyrics_transcriber/storage/dropbox.py:182— karaoke_gen/lyrics_transcriber/storage/dropbox.py:182-191 | karaoke_gen/lyrics_transcriber/storage/dropbox.py:194-203 — 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) REDACTED:93— REDACTED:93-104 | karaoke_gen/config.py:74-83 — 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) backend/services/tracing.py:360— backend/services/tracing.py:360-369 | karaoke_gen/lyrics_transcriber/utils/tracing.py:200-214 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×7
Edited copy of a member (5 corresponding lines) backend/services/tenant_admin_service.py:123— backend/services/tenant_admin_service.py:123-127 | backend/services/tenant_admin_service.py:131-137 — 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) backend/services/auto_correct/service.py:86— backend/services/auto_correct/service.py:86-98 | backend/services/lyrics_translation.py:129-133 — 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) backend/services/quick_version/renderer.py:373— backend/services/quick_version/renderer.py:373-377 | karaoke_gen/portrait/renderer.py:54-59 — 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) REDACTED:104— REDACTED:104-108 | REDACTED:53-57 — 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) REDACTED:206— REDACTED:206-215 | REDACTED:75-79 — 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) scripts/karaokehunt_outreach/phase1_analyze.py:132— scripts/karaokehunt_outreach/phase1_analyze.py:132-136 | scripts/karaokehunt_outreach/phase1b_audio_search.py: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) scripts/backfill_gdrive_uploads.py:59— scripts/backfill_gdrive_uploads.py:59-63 | scripts/fetch_job_logs.py:26-32 — 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 (17 lines × 2) backend/api/routes/file_upload.py:1425— backend/api/routes/file_upload.py:1425-1441 | backend/api/routes/file_upload.py:2170-2186 — both copies are in the same file, so extract the 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 (17 lines × 2) backend/api/routes/file_upload.py:2187— backend/api/routes/file_upload.py:2187-2203 | backend/api/routes/file_upload.py:2508-2524 — both copies are in the same file, so extract the 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 `backend/api/routes/file_upload.py:2187` 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 (17 lines × 2) backend/api/routes/users.py:405— backend/api/routes/users.py:405-423 | backend/api/routes/users.py:884-900 — both copies are in the same file, so extract the 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 `backend/api/routes/users.py:405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) backend/services/visibility_change_service.py:358— backend/services/visibility_change_service.py:358-374 | backend/services/visibility_change_service.py:443-459 — both copies are in the same file, so extract the 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 (17 lines × 2) REDACTED:131— REDACTED:131-147 | REDACTED:387-403 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:124` calls `Exception` and `REDACTED:386` 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 (17 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:57— karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:57-73 | karaoke_gen/lyrics_transcriber/correction/handlers/word_count_match.py:52-68 — 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 `karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:57` 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 lines × 2) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1430— karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1430-1446 | karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1670-1686 — both copies are in the same file, so extract the 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) backend/api/routes/audio_search.py:869— backend/api/routes/audio_search.py:869-876 | backend/api/routes/file_upload.py:2852-2858 — 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 `backend/api/routes/audio_search.py:869` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) backend/api/routes/kjbox.py:277— backend/api/routes/kjbox.py:277-283 | backend/api/routes/login_code.py:282-288 — 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) backend/api/routes/tenant_admin.py:274— backend/api/routes/tenant_admin.py:274-280 | backend/api/routes/tenant_admin.py:361-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/api/routes/tenant_admin.py:273` calls `HTTPException` and `backend/api/routes/tenant_admin.py:360` 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) REDACTED:330— REDACTED:330-336 | REDACTED:340-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:327` calls `join`, `exists`, `FileResponse` and `REDACTED:339` 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) karaoke_gen/utils/remote_cli.py:2397— karaoke_gen/utils/remote_cli.py:2397-2403 | karaoke_gen/utils/remote_cli.py:2407-2413 — both copies are in the same file, so extract the 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 `karaoke_gen/utils/remote_cli.py:2397` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) backend/services/job_manager.py:195— backend/services/job_manager.py:195-201 | backend/services/job_notification_service.py:36-42 — 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 (7 lines × 2) scripts/karaokehunt_outreach/phase1b_audio_search.py:429— scripts/karaokehunt_outreach/phase1b_audio_search.py:429-437 | scripts/karaokehunt_outreach/phase_batch_generate.py:103-109 — 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 `scripts/karaokehunt_outreach/phase1b_audio_search.py:429` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) REDACTED:374— REDACTED:374-379 | infrastructure/functions/gdrive_validator/main.py:475-480 — 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) backend/services/gdrive_service.py:565— backend/services/gdrive_service.py:565-570 | scripts/cleanup_test_job_gdrive.py:177-182 — 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 `backend/services/gdrive_service.py:565` 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) backend/services/visibility_change_service.py:423— backend/services/visibility_change_service.py:423-428 | backend/services/visibility_change_service.py:512-517 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:126— karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:126-132 | karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:129-134 — before extracting anything, compare `karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py` and `karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 `karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:126` 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 (6 lines × 2) REDACTED:49— REDACTED:49-63 | REDACTED:148-153 — 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) backend/services/admin_rerender_service.py:85— backend/services/admin_rerender_service.py:85-95 | backend/services/regenerate_service.py:75-80 — 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) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1632— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1632-1637 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1643-1648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Outbound HTTP without resilience infrastructure/cloudflare/scripts/build_import_list.py:43— `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:639— `requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:258— `requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:72— `requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:93— `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:103— `requests.post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience karaoke_gen/pipeline/executors/remote.py:59— `requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC1 · Text alternatives· <canvas> without a text alternative · ×6
<canvas> without a text alternative frontend/components/audio-editor/AudioEditor.tsx:308— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative frontend/components/instrumental-review/WaveformViewer.tsx:321— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative frontend/components/job/KaraokeBackgroundPreview.tsx:159— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative frontend/components/job/TitleCardPreview.tsx:243— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative frontend/components/lyrics-review/BackingVocalsWaveform.tsx:136— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:745— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
Repeated repair: infrastructure/modules/storage.py infrastructure/modules/storage.py:14— infrastructure/modules/storage.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is storage.create_bucket at line 14), 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(storage): keep user-uploaded inputs forever; uploads/ expires after 180d not 7d (v0.268.2) (#1137)”; “fix(infra): make karaoke-gen storage bucket private; CORS any origin (#1070)”; “fix(tenant): theme/tenant edits take effect immediately; no orphan jobs on bad theme (#1069)”; “fix(infra): allow GET/HEAD CORS on storage bucket for vocals waveform (#932)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- infrastructure/modules/storage.py`: 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: backend/services/error_monitor/known_issues.py backend/services/error_monitor/known_issues.py:185— backend/services/error_monitor/known_issues.py changed 5 times in last 90 days and 4 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 known_issues.should_ignore at line 185), 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(error-monitor): ignore runner-manager's other Cloud Run abort wording (#1252)”; “fix(alerts): start-review 409, per-cause crash patterns, one alert per job failure (v0.290.1) (#1243)”; “fix(api): event-loop stalls — visibility redistribution off-loop, route warmup, watchdog/Cloud Trace noise (0.286.2) (#1230)”; “fix: alert noise + loop stalls + kn-data-sync OOM from #alerts triage (v0.282.1) (#1210)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/services/error_monitor/known_issues.py`: 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: frontend/functions/[[path]].ts frontend/functions/[[path]].ts:22— frontend/functions/[[path]].ts 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 9 (its worst body is [[path]].extractTenantFromHost at line 22), 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(tenant): no Nomad logo flash on tenant portals (v0.273.4) (#1161)”; “fix: edge tenant config fetch threw 'Illegal invocation' (v0.268.7) (#1142)”; “fix: tenant portal edge config stampede spawned cold API instances (v0.268.6) (#1141)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- frontend/functions/[[path]].ts`: 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: backend/services/youtube_download_service.py backend/services/youtube_download_service.py:339— backend/services/youtube_download_service.py 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 9 (its worst body is YouTubeDownloadService._download_remote_url at line 339), 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(url-jobs): retry a YouTube bot block, then point to Audio Search (v0.290.1) (#1244)”; “fix: provide-url YouTube downloads failing with 'No audio source selection found' (v0.285.1) (#1224)”; “fix(fallbacks): T8 — fail loud cleanups (docstrings, download errors, admin-token signal) (#805)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/services/youtube_download_service.py`: 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: backend/api/routes/client_errors.py backend/api/routes/client_errors.py:66— backend/api/routes/client_errors.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is client_errors.report_client_error at line 66), 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(alerts): start-review 409, per-cause crash patterns, one alert per job failure (v0.290.1) (#1243)”; “fix: user-instrumental renders for any audio format + crash-report diagnostics (v0.243.1) (#1060)”; “fix(frontend): stop reporting opaque cross-origin "Script error." (v0.238.6) (#1050)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/api/routes/client_errors.py`: 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: backend/services/auto_approval/pre_apply.py backend/services/auto_approval/pre_apply.py:33— backend/services/auto_approval/pre_apply.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is pre_apply.ensure_and_pre_apply at line 33), 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(backend): stop API event-loop freezes + identify users in degradation telemetry (v0.264.0) (#1120)”; “fix(review): restore per-suggestion undo for server-pre-applied AI corrections (#981)”; “Pre-apply AI corrections on review load too (C2 completeness) — fixes the ~4s flicker on pre-existing jobs (#959)”. 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-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 22:24:47 -05:00' --until='2026-11-11 22:24:47 -05:00' --full-history --no-merges -- backend/services/auto_approval/pre_apply.py`: 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· Edited copy of a member (12 corresponding lines) · ×6
Edited copy of a member (12 corresponding lines) backend/services/user_service.py:789— backend/services/user_service.py:789-800 | backend/services/user_service.py:803-814 — 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) backend/services/encoding_worker_manager.py:456— backend/services/encoding_worker_manager.py:456-485 | backend/services/encoding_worker_manager.py:488-499 — 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) backend/services/flacfetch_client.py:277— backend/services/flacfetch_client.py:277-297 | backend/services/flacfetch_client.py:346-357 — 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) backend/api/routes/internal.py:1523— backend/api/routes/internal.py:1523-1534 | backend/api/routes/internal.py:1552-1571 — 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) backend/services/tracing.py:345— backend/services/tracing.py:345-356 | karaoke_gen/lyrics_transcriber/utils/tracing.py:181-196 — 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) scripts/fetch_job_logs.py:36— scripts/fetch_job_logs.py:36-47 | scripts/fetch_job_logs.py:51-63 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) backend/api/routes/file_upload.py:1481— backend/api/routes/file_upload.py:1481-1493 | backend/api/routes/file_upload.py:2207-2219 — both copies are in the same file, so extract the 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 × 2) backend/api/routes/tenant_admin.py:131— backend/api/routes/tenant_admin.py:131-143 | backend/api/routes/tenant_admin.py:156-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) REDACTED:624— REDACTED:624-636 | REDACTED:1261-1274 — both copies are in the same file, so extract the 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 × 2) karaoke_gen/lyrics_transcriber/correction/agentic/handlers/background_vocals.py:55— karaoke_gen/lyrics_transcriber/correction/agentic/handlers/background_vocals.py:55-67 | karaoke_gen/lyrics_transcriber/correction/agentic/handlers/extra_words.py:61-73 — 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 `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 (13 lines × 2) karaoke_gen/pipeline/stages/separation.py:108— karaoke_gen/pipeline/stages/separation.py:108-120 | karaoke_gen/pipeline/stages/separation.py:172-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) karaoke_gen/utils/remote_cli.py:3186— karaoke_gen/utils/remote_cli.py:3186-3198 | karaoke_gen/utils/remote_cli.py:3217-3229 — both copies are in the same file, so extract the 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, `karaoke_gen/utils/remote_cli.py:3230` calls `getattr` and `karaoke_gen/utils/remote_cli.py:3199` 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 × 2) REDACTED:1862— REDACTED:1862-1867 | REDACTED:2010-2014 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1153— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1153-1157 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1171-1175 — both copies are in the same file, so extract the 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) REDACTED:204— REDACTED:204-210 | scripts/review_test_fixtures.py:301-305 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:201` calls `_discover_locales` and `scripts/review_test_fixtures.py:299` 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) REDACTED:459— REDACTED:459-463 | REDACTED:903-907 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/correction/corrector.py:462— karaoke_gen/lyrics_transcriber/correction/corrector.py:462-466 | karaoke_gen/lyrics_transcriber/correction/corrector.py:483-487 — both copies are in the same file, so extract the 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) karaoke_gen/lyrics_transcriber/types.py:338— karaoke_gen/lyrics_transcriber/types.py:338-342 | karaoke_gen/lyrics_transcriber/types.py:493-497 — both copies are in the same file, so extract the 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 `karaoke_gen/lyrics_transcriber/types.py:338` 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×6
Recursive walk over a caller-supplied document has no depth cap frontend/scripts/translate.py:162— `flatten_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 162 (`flatten_keys`) with a piece of `obj` — and nowhere in `flatten_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap frontend/scripts/translate.py:196— `merge_deep` is public and takes `base: dict` from its caller, and it calls itself at line 196 (`merge_deep`) with a piece of `base` — and nowhere in `merge_deep` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `merge_deep` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap frontend/scripts/translate.py:230— `count_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 230 (`count_keys`) with a piece of `obj` — and nowhere in `count_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `count_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap frontend/scripts/validate-translations.py:31— `flatten_keys` is public and takes `obj: dict` from its caller, and it calls itself at line 31 (`flatten_keys`) with a piece of `obj` — and nowhere in `flatten_keys` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap frontend/components/tenant-theme/theme-utils.ts:67— `stableStringify` is exported and takes `value: unknown` from its caller, and it calls itself at line 67 (`stableStringify`) with a piece of `value` (and at line 71) — and nowhere in `stableStringify` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stableStringify` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap backend/i18n.py:71— `t` is public and takes `kwargs: Any` from its caller, and it calls itself at line 71 (`t`) with a piece of `kwargs` — and nowhere in `t` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `t` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Change coupling: admin-sidebar.tsx ↔ api.ts frontend/components/admin/admin-sidebar.tsx:1— `frontend/components/admin/admin-sidebar.tsx` and `frontend/lib/api.ts` change together 100% of the time (11 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `36b331f3` feat(requests-board): admin history view + fix community publish tran…; `af36975d` Admin create/manage tenants: album batch via tenant bulk flow + full …; `1154adc1` feat(admin): add referral links management page (#670) — run `git show` on any of them.
Change coupling: admin.py ↔ admin-sidebar.tsx backend/api/routes/admin.py:1— `backend/api/routes/admin.py` and `frontend/components/admin/admin-sidebar.tsx` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `36b331f3` feat(requests-board): admin history view + fix community publish tran…; `c9e43403` feat: admin feedback visibility — page + email notification (#581); `6c120b70` feat: audio edits admin dashboard + reset-to-audio-edit button (#521) — run `git show` on any of them.
Change coupling: __main__.py ↔ REDACTED infrastructure/__main__.py:1— `infrastructure/__main__.py` and `infrastructure/functions/runner_manager/main.py` 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither 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 `b4e7a830` refactor(runner-manager): drop legacy fixed-pool dispatcher code (~37…; `bf5c9abd` feat(runners): ephemeral GHA runner dispatcher behind RUNNER_MODE fla…; `d0efa972` infra: only start GPU runners for gpu-labeled jobs (#541) — run `git show` on any of them.
Change coupling: users.py ↔ auth.ts backend/api/routes/users.py:1— `backend/api/routes/users.py` and `frontend/lib/auth.ts` change together 56% of the time (9 of the 16 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `ff9b7164` feat: first-touch UTM/referrer signup attribution + UTM on YouTube de…; `607c52be` feat(referral): embed referral code in magic link for cross-device at…; `1cd747f1` fix(referral): compute and display referral discount status for users… — run `git show` on any of them.
Change coupling: admin.py ↔ REDACTED backend/api/routes/admin.py:1— `backend/api/routes/admin.py` and `frontend/app/admin/layout.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `d91c2c2b` feat: Stripe admin dashboard with revenue analytics and payment manag…; `2d687064` feat(admin): improve job detail page and fix Files tab (#317); `80b8d9c5` feat(admin): Add toggle to hide/show test data in admin dashboard (#239) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×5
Edited copy of a member (14 corresponding lines) REDACTED:364— REDACTED:364-377 | karaoke_gen/lyrics_transcriber/output/video.py:19-48 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) karaoke_gen/file_handler.py:32— karaoke_gen/file_handler.py:32-45 | karaoke_gen/file_handler.py:48-78 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) REDACTED:290— REDACTED:290-307 | REDACTED:746-759 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) backend/services/local_encoded_outputs.py:44— backend/services/local_encoded_outputs.py:44-57 | backend/services/local_encoded_outputs.py:61-74 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) backend/services/encoding_worker_manager.py:737— backend/services/encoding_worker_manager.py:737-754 | backend/services/encoding_worker_manager.py:757-770 — These two members are one piece of code written twice and then edited apart: 14 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) · ×5
Edited copy of a member (9 corresponding lines) backend/services/firestore_service.py:944— backend/services/firestore_service.py:944-960 | backend/services/firestore_service.py:1145-1153 — 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) backend/services/storage_retention.py:147— backend/services/storage_retention.py:147-155 | backend/workers/community_handoff.py:40-48 — 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) backend/services/storage_service.py:70— backend/services/storage_service.py:70-78 | backend/services/storage_service.py:87-103 — 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) karaoke_gen/lyrics_transcriber/output/ass/style.py:67— karaoke_gen/lyrics_transcriber/output/ass/style.py:67-75 | karaoke_gen/lyrics_transcriber/output/ass/style.py:78-86 — 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) backend/services/firestore_service.py:824— backend/services/firestore_service.py:824-832 | backend/services/firestore_service.py:839-860 — 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.
Sync-over-async blocking REDACTED:1697— `health_check` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking backend/workers/audio_worker.py:139— `process_audio_separation` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking karaoke_gen/pipeline/executors/remote.py:145— `_submit_job` is async and calls requests.post — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking karaoke_gen/pipeline/executors/remote.py:198— `_monitor_job` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking karaoke_gen/utils/gen_cli.py:357— `async_main` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
X2 · Cancellation propagation· Async function without AbortSignal · ×5
Async function without AbortSignal: fetchVocalsPeaks frontend/lib/audio-data.ts:103— `fetchVocalsPeaks` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchAudioData frontend/lib/audio-data.ts:127— `fetchAudioData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: reportClientError frontend/lib/crash-reporter.ts:167— `reportClientError` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchTenantConfig frontend/lib/tenant.ts:188— `fetchTenantConfig` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: isStale frontend/lib/version-check.ts:39— `isStale` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
AC4 · Keyboard semantics· Anchor without href · ×4
Anchor without href infrastructure/monitoring/job-inspector.html:352— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href infrastructure/monitoring/job-inspector.html:355— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href infrastructure/monitoring/job-inspector.html:358— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href infrastructure/monitoring/job-inspector.html:361— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
XxxComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:814— # XXX If there is an instrumental section immediately after the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1093— # XXX This is hardcoded. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2051— # XXX This is hardcoded. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:2018— # XXX This is hardcoded, so as to not have the line's — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (5 members, 50+ identical tokens) backend/api/routes/internal.py:152— backend/api/routes/internal.py:152-187 | backend/api/routes/internal.py:236-269 | backend/api/routes/internal.py:321-373 | backend/api/routes/internal.py:383-414 | backend/api/routes/internal.py:424-459 — 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) REDACTED:3110— REDACTED:3110-3231 | REDACTED:3239-3282 | REDACTED:3290-3332 | REDACTED:3341-3432 | REDACTED:3462-3567 — 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) backend/workers/audio_download_worker.py:687— backend/workers/audio_download_worker.py:687-732 | backend/workers/audio_worker.py:780-833 | backend/workers/lyrics_worker.py:995-1047 | backend/workers/render_video_worker.py:990-1033 | backend/workers/video_worker.py:2038-2089 — 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) infrastructure/modules/cloud_run.py:121— infrastructure/modules/cloud_run.py:121-282 | infrastructure/modules/cloud_run.py:449-584 | infrastructure/modules/cloud_run.py:592-685 | infrastructure/modules/cloud_run.py:693-729 | infrastructure/modules/cloud_run.py:737-930 — 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 (26 corresponding lines) · ×4
Edited copy of a member (26 corresponding lines) backend/models/audio_edit_session.py:84— backend/models/audio_edit_session.py:84-110 | backend/models/review_session.py:82-107 — 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.
Edited copy of a member (26 corresponding lines) REDACTED:368— REDACTED:368-393 | REDACTED:486-523 — 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.
Edited copy of a member (26 corresponding lines) backend/services/nomad_master_mirror.py:114— backend/services/nomad_master_mirror.py:114-139 | backend/services/nomad_master_mirror.py:142-174 — 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.
Edited copy of a member (26 corresponding lines) backend/services/push_notification_service.py:310— backend/services/push_notification_service.py:310-335 | backend/services/push_notification_service.py:338-365 — 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 (18 corresponding lines) · ×4
Edited copy of a member (18 corresponding lines) backend/api/routes/tenant_admin.py:126— backend/api/routes/tenant_admin.py:126-143 | backend/api/routes/tenant_admin.py:151-168 — 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) backend/services/firestore_service.py:136— backend/services/firestore_service.py:136-154 | backend/services/firestore_service.py:157-174 — 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:2794— REDACTED:2794-2812 | REDACTED:2927-2944 — 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) karaoke_gen/style_loader.py:390— karaoke_gen/style_loader.py:390-407 | scripts/benchmark_encoding.py:476-502 — 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 (13 corresponding lines) · ×4
Edited copy of a member (13 corresponding lines) karaoke_gen/lyrics_transcriber/storage/dropbox.py:85— karaoke_gen/lyrics_transcriber/storage/dropbox.py:85-98 | karaoke_gen/lyrics_transcriber/storage/dropbox.py:101-113 — 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) karaoke_gen/lyrics_transcriber/output/subtitles.py:246— karaoke_gen/lyrics_transcriber/output/subtitles.py:246-259 | karaoke_gen/lyrics_transcriber/output/subtitles.py:262-274 — 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) REDACTED:111— REDACTED:111-123 | REDACTED:60-72 — 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) backend/services/job_access.py:26— backend/services/job_access.py:26-38 | backend/services/job_manager.py:214-230 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) backend/services/job_notification_service.py:291— backend/services/job_notification_service.py:291-312 | backend/services/job_notification_service.py:321-339 — 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) backend/services/youtube_quota_service.py:265— backend/services/youtube_quota_service.py:265-285 | backend/services/youtube_quota_service.py:288-306 — 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) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1060— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1060-1078 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1082-1100 — 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) backend/services/template_service.py:135— backend/services/template_service.py:135-156 | backend/services/template_service.py:583-601 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×4
Edited copy of a member (16 corresponding lines) karaoke_gen/utils/remote_cli.py:935— karaoke_gen/utils/remote_cli.py:935-951 | karaoke_gen/utils/remote_cli.py:967-982 — 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) infrastructure/functions/divebar_lookup/main.py:676— infrastructure/functions/divebar_lookup/main.py:676-714 | infrastructure/functions/divebar_mirror/main.py:70-85 — 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) backend/services/worker_service.py:636— backend/services/worker_service.py:636-651 | backend/services/worker_service.py:870-892 — 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) scripts/analyze_reference_relevance.py:93— scripts/analyze_reference_relevance.py:93-116 | scripts/review_reference_relevance.py:76-91 — 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, 12+ corresponding lines) · ×4
Edited copies of one member (3 members, 12+ corresponding lines) karaoke_gen/lyrics_transcriber/output/generator.py:297— karaoke_gen/lyrics_transcriber/output/generator.py:297-308 | karaoke_gen/lyrics_transcriber/output/plain_text.py:27-49 | karaoke_gen/lyrics_transcriber/output/plain_text.py:52-72 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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, 12+ corresponding lines) REDACTED:112— REDACTED:112-128 | REDACTED:133-144 | REDACTED:149-160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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, 12+ corresponding lines) backend/services/template_service.py:159— backend/services/template_service.py:159-171 | backend/services/template_service.py:174-185 | backend/services/template_service.py:188-199 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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, 12+ corresponding lines) backend/services/audio_search_service.py:227— backend/services/audio_search_service.py:227-247 | backend/services/bulk_album_search.py:88-105 | scripts/karaokehunt_outreach/phase1b_audio_search.py:224-235 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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 (20 lines × 2) backend/services/stripe_service.py:504— backend/services/stripe_service.py:504-523 | backend/services/stripe_service.py:526-545 — both copies are in the same file, so extract the 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 (20 lines × 2) karaoke_gen/lyrics_transcriber/correction/agentic/handlers/ambiguous.py:24— karaoke_gen/lyrics_transcriber/correction/agentic/handlers/ambiguous.py:24-43 | karaoke_gen/lyrics_transcriber/correction/agentic/handlers/repeated_section.py:24-43 — 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 (20 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:143— karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:143-162 | karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:142-161 — before extracting anything, compare `karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py` and `karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 `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 (20 lines × 2) REDACTED:1360— REDACTED:1360-1379 | REDACTED:1489-1508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) backend/api/routes/file_upload.py:772— backend/api/routes/file_upload.py:772-786 | backend/api/routes/file_upload.py:1445-1459 — both copies are in the same file, so extract the 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 `backend/api/routes/file_upload.py:772` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) backend/workers/audio_worker.py:181— backend/workers/audio_worker.py:181-195 | backend/workers/lyrics_worker.py:255-269 — 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 (15 lines × 2) karaoke_gen/audio_fetcher.py:743— karaoke_gen/audio_fetcher.py:743-757 | karaoke_gen/audio_fetcher.py:1742-1756 — both copies are in the same file, so extract the 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 `karaoke_gen/audio_fetcher.py:743` 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 (15 lines × 2) frontend/scripts/translate.py:450— frontend/scripts/translate.py:450-464 | frontend/scripts/translate.py:534-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `frontend/scripts/translate.py:531` calls `upload` and `frontend/scripts/translate.py:447` 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.
Blocking `time.sleep` inside an `async def` karaoke_gen/utils/gen_cli.py:626— This `async def` runs on the event loop's thread, and `time.sleep` blocks that thread: for the whole delay no other coroutine, request or callback on the loop makes progress — the Python form of blocking on a task. Use `await asyncio.sleep(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the loop with `await asyncio.to_thread(…)` (or `loop.run_in_executor(…)`).
Blocking `time.sleep` inside an `async def` karaoke_gen/utils/gen_cli.py:739— This `async def` runs on the event loop's thread, and `time.sleep` blocks that thread: for the whole delay no other coroutine, request or callback on the loop makes progress — the Python form of blocking on a task. Use `await asyncio.sleep(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the loop with `await asyncio.to_thread(…)` (or `loop.run_in_executor(…)`).
Blocking `time.sleep` inside an `async def` karaoke_gen/utils/gen_cli.py:1213— This `async def` runs on the event loop's thread, and `time.sleep` blocks that thread: for the whole delay no other coroutine, request or callback on the loop makes progress — the Python form of blocking on a task. Use `await asyncio.sleep(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the loop with `await asyncio.to_thread(…)` (or `loop.run_in_executor(…)`).
Blocking `time.sleep` inside an `async def` backend/workers/audio_worker.py:344— This `async def` runs on the event loop's thread, and `time.sleep` blocks that thread: for the whole delay no other coroutine, request or callback on the loop makes progress — the Python form of blocking on a task. Use `await asyncio.sleep(…)`, which suspends only this coroutine. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the loop with `await asyncio.to_thread(…)` (or `loop.run_in_executor(…)`).
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×3
Modal dialog does not manage focus frontend/app/[locale]/account/delete/client.tsx:231— This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus frontend/app/[locale]/requests/client.tsx:619— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus frontend/components/audio-editor/AudioEditor.tsx:1304— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×3
Edited copy of a member (45 corresponding lines) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:25— karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:25-69 | karaoke_gen/lyrics_transcriber/correction/handlers/syllables_match.py:34-82 — These two members are one piece of code written twice and then edited apart: 45 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 (45 corresponding lines) backend/services/worker_service.py:419— backend/services/worker_service.py:419-463 | backend/services/worker_service.py:795-867 — These two members are one piece of code written twice and then edited apart: 45 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 (45 corresponding lines) infrastructure/functions/divebar_lookup/main.py:85— infrastructure/functions/divebar_lookup/main.py:85-172 | infrastructure/functions/divebar_lookup/main.py:248-292 — These two members are one piece of code written twice and then edited apart: 45 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) · ×3
Edited copy of a member (32 corresponding lines) backend/services/dropbox_service.py:191— backend/services/dropbox_service.py:191-232 | REDACTED:603-634 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) karaoke_gen/lyrics_transcriber/output/ass/config.py:114— karaoke_gen/lyrics_transcriber/output/ass/config.py:114-145 | karaoke_gen/lyrics_transcriber/output/ass/config.py:148-179 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) backend/services/metrics.py:330— backend/services/metrics.py:330-362 | backend/services/metrics.py:366-397 — 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 copy of a member (27 corresponding lines) · ×3
Edited copy of a member (27 corresponding lines) backend/services/catalog_proxy_service.py:47— backend/services/catalog_proxy_service.py:47-73 | backend/services/catalog_proxy_service.py:77-105 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) REDACTED:1380— REDACTED:1380-1406 | REDACTED:1411-1449 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) backend/services/credential_manager.py:483— backend/services/credential_manager.py:483-509 | backend/services/credential_manager.py:516-542 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×3
Edited copy of a member (37 corresponding lines) karaoke_gen/lyrics_transcriber/lyrics/genius.py:233— karaoke_gen/lyrics_transcriber/lyrics/genius.py:233-274 | karaoke_gen/lyrics_transcriber/lyrics/genius.py:277-313 — 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.
Edited copy of a member (37 corresponding lines) backend/services/flacfetch_client.py:231— backend/services/flacfetch_client.py:231-274 | backend/services/flacfetch_client.py:305-341 — 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.
Edited copy of a member (37 corresponding lines) karaoke_gen/lyrics_transcriber/correction/agentic/observability/langfuse_integration.py:126— karaoke_gen/lyrics_transcriber/correction/agentic/observability/langfuse_integration.py:126-170 | karaoke_gen/lyrics_transcriber/correction/agentic/prompts/langfuse_prompts.py:149-185 — 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 (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) REDACTED:1056— REDACTED:1056-1082 | REDACTED:1085-1101 — 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) backend/services/job_manager.py:1138— backend/services/job_manager.py:1138-1154 | backend/services/job_manager.py:1380-1401 — 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) scripts/analyze_reference_relevance.py:46— scripts/analyze_reference_relevance.py:46-75 | scripts/review_reference_relevance.py:50-66 — 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 (11 corresponding lines) · ×3
Edited copy of a member (11 corresponding lines) backend/services/conversion_emails.py:39— backend/services/conversion_emails.py:39-49 | backend/services/login_code_store.py:50-60 — 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.
Edited copy of a member (11 corresponding lines) backend/services/admin_rerender_service.py:491— backend/services/admin_rerender_service.py:491-502 | backend/services/regenerate_service.py:340-350 — 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.
Edited copy of a member (11 corresponding lines) infrastructure/modules/artifact_registry.py:81— infrastructure/modules/artifact_registry.py:81-97 | infrastructure/modules/gpu_artifact_registry.py:20-30 — 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.
Duplicated block (18 lines × 2) REDACTED:226— REDACTED:226-243 | REDACTED:444-461 — both copies are in the same file, so extract the 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 (18 lines × 2) backend/services/flacfetch_client.py:410— backend/services/flacfetch_client.py:410-427 | backend/services/flacfetch_client.py:495-512 — both copies are in the same file, so extract the 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 `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 (18 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:25— karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:25-42 | karaoke_gen/lyrics_transcriber/correction/handlers/syllables_match.py:34-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) infrastructure/modules/divebar_lookup.py:176— infrastructure/modules/divebar_lookup.py:176-192 | infrastructure/modules/divebar_mirror.py:203-219 | infrastructure/modules/kn_data_sync.py:190-206 — before extracting anything, compare `infrastructure/modules/divebar_lookup.py` and `infrastructure/modules/divebar_mirror.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) infrastructure/modules/divebar_lookup.py:204— infrastructure/modules/divebar_lookup.py:204-220 | infrastructure/modules/kn_data_sync.py:221-237 | infrastructure/modules/kn_data_sync.py:250-266 — before extracting anything, compare `infrastructure/modules/divebar_lookup.py` and `infrastructure/modules/kn_data_sync.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 152 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 `infrastructure/modules/divebar_lookup.py:204` 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 (17 lines × 3) karaoke_gen/utils/gen_cli.py:563— karaoke_gen/utils/gen_cli.py:563-579 | karaoke_gen/utils/gen_cli.py:676-692 | karaoke_gen/utils/gen_cli.py:1143-1159 — 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 `karaoke_gen/utils/gen_cli.py:563` 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) backend/api/routes/admin.py:2342— backend/api/routes/admin.py:2342-2355 | backend/api/routes/admin.py:2678-2690 — both copies are in the same file, so extract the 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–14 lines × 2) backend/services/encoding_service.py:700— backend/services/encoding_service.py:700-713 | backend/services/encoding_service.py:1228-1240 — both copies are in the same file, so extract the 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 `backend/services/encoding_service.py:700` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:89— karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:89-102 | karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:130-142 — both copies are in the same file, so extract the 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 × 3) backend/services/audio_search_service.py:651— backend/services/audio_search_service.py:651-659 | backend/services/audio_search_service.py:742-750 | backend/services/youtube_download_service.py:301-309 — 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 `backend/services/audio_search_service.py:651` 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 × 3) REDACTED:852— REDACTED:852-860 | REDACTED:1899-1907 | REDACTED:270-278 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) REDACTED:1363— REDACTED:1363-1371 | REDACTED:1401-1409 | REDACTED:1492-1500 — 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.
TimelineEditor.TimelineEditor::handleMouseMove (cyclomatic 18) frontend/components/lyrics-review/TimelineEditor.tsx:229— TimelineEditor.TimelineEditor::handleMouseMove 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. This shape REPEATS in the file: one other method here (TimelineEditor.TimelineEditor::autoExtendStep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TimelineEditor.TimelineEditor::autoExtendStep (cyclomatic 16) frontend/components/lyrics-review/TimelineEditor.tsx:315— TimelineEditor.TimelineEditor::autoExtendStep has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TimelineEditor.TimelineEditor::handleMouseMove) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TimelineEditor.TimelineEditor::handleMouseMove (cognitive 24) frontend/components/lyrics-review/TimelineEditor.tsx:229— TimelineEditor.TimelineEditor::handleMouseMove has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TimelineEditor.TimelineEditor::autoExtendStep) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TimelineEditor.TimelineEditor::autoExtendStep (cognitive 23) frontend/components/lyrics-review/TimelineEditor.tsx:315— TimelineEditor.TimelineEditor::autoExtendStep has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TimelineEditor.TimelineEditor::handleMouseMove) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
gemini_client.is_quota_or_billing_error (cognitive 16) backend/services/gemini_client.py:103— gemini_client.is_quota_or_billing_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gemini_client.is_quota_or_billing_error (cognitive 16) frontend/scripts/gemini_client.py:113— gemini_client.is_quota_or_billing_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×2
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) backend/api/routes/users.py:2017— backend/api/routes/users.py:2017-2048 | backend/api/routes/users.py:2058-2225 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) karaoke_gen/lyrics_transcriber/correction/agentic/observability/langfuse_integration.py:174— karaoke_gen/lyrics_transcriber/correction/agentic/observability/langfuse_integration.py:174-208 | karaoke_gen/lyrics_transcriber/correction/agentic/prompts/langfuse_prompts.py:188-212 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×2
Edited copy of a member (63 corresponding lines) backend/services/packaging_service.py:282— backend/services/packaging_service.py:282-345 | REDACTED:1053-1115 — These two members are one piece of code written twice and then edited apart: 63 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 (63 corresponding lines) scripts/karaokehunt_outreach/phase1_analyze.py:140— scripts/karaokehunt_outreach/phase1_analyze.py:140-202 | scripts/karaokehunt_outreach/phase1b_audio_search.py:338-415 — These two members are one piece of code written twice and then edited apart: 63 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 (51 corresponding lines) · ×2
Edited copy of a member (51 corresponding lines) REDACTED:190— REDACTED:190-263 | REDACTED:433-483 — These two members are one piece of code written twice and then edited apart: 51 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 (51 corresponding lines) infrastructure/modules/cloud_run.py:289— infrastructure/modules/cloud_run.py:289-384 | infrastructure/modules/cloud_run.py:391-441 — These two members are one piece of code written twice and then edited apart: 51 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 (60 corresponding lines) · ×2
Edited copy of a member (60 corresponding lines) backend/services/youtube_download_service.py:278— backend/services/youtube_download_service.py:278-337 | backend/services/youtube_download_service.py:346-406 — These two members are one piece of code written twice and then edited apart: 60 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 (60 corresponding lines) karaoke_gen/audio_fetcher.py:767— karaoke_gen/audio_fetcher.py:767-826 | karaoke_gen/audio_fetcher.py:829-898 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) REDACTED:1350— REDACTED:1350-1379 | REDACTED:1478-1508 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) backend/services/nltk_preloader.py:21— backend/services/nltk_preloader.py:21-59 | backend/services/nltk_preloader.py:77-106 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) backend/services/audio_search_service.py:84— backend/services/audio_search_service.py:84-114 | scripts/karaokehunt_outreach/phase1b_audio_search.py:138-166 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) backend/api/routes/auth.py:204— backend/api/routes/auth.py:204-237 | backend/api/routes/auth.py:267-295 — These two members are one piece of code written twice and then edited apart: 29 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) · ×2
Edited copy of a member (50 corresponding lines) backend/services/encoding_service.py:718— backend/services/encoding_service.py:718-767 | backend/services/encoding_service.py:1044-1101 — 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.
Edited copy of a member (50 corresponding lines) backend/services/encoding_service.py:983— backend/services/encoding_service.py:983-1032 | backend/services/encoding_service.py:1248-1300 — 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 (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) karaoke_gen/lyrics_transcriber/output/subtitles.py:277— karaoke_gen/lyrics_transcriber/output/subtitles.py:277-291 | karaoke_gen/lyrics_transcriber/output/subtitles.py:320-341 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) backend/middleware/audit_logging.py:109— backend/middleware/audit_logging.py:109-124 | backend/utils/request_helpers.py:9-23 — 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 (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) REDACTED:189— REDACTED:189-210 | scripts/review_test_fixtures.py:288-308 — 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) backend/services/error_monitor/monitor.py:376— backend/services/error_monitor/monitor.py:376-400 | infrastructure/functions/backup_to_aws/discord_alert.py:38-58 — 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 copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) backend/services/flacfetch_client.py:404— backend/services/flacfetch_client.py:404-427 | backend/services/flacfetch_client.py:485-512 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) backend/services/job_manager.py:1210— backend/services/job_manager.py:1210-1233 | backend/services/job_manager.py:1236-1261 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) backend/services/gdrive_service.py:412— backend/services/gdrive_service.py:412-443 | backend/services/gdrive_service.py:448-475 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) backend/services/flacfetch_client.py:367— backend/services/flacfetch_client.py:367-394 | backend/services/flacfetch_client.py:439-473 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) REDACTED:291— REDACTED:291-306 | REDACTED:516-521 — 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.
Edited copy of a member (6 corresponding lines) scripts/karaokehunt_outreach/phase2_execute.py:104— scripts/karaokehunt_outreach/phase2_execute.py:104-110 | scripts/karaokehunt_outreach/phase_batch_generate.py:61-66 — 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 copy of a member (3 corresponding lines) · ×2
Edited copy of a member (3 corresponding lines) backend/services/admin_rerender_service.py:78— backend/services/admin_rerender_service.py:78-81 | backend/services/regenerate_service.py:69-71 — 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.
Edited copy of a member (3 corresponding lines) REDACTED:66— REDACTED:66-78 | REDACTED:95-97 — 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.
Duplicated block (25–28 lines × 2) REDACTED:2526— REDACTED:2526-2553 | REDACTED:2563-2587 — both copies are in the same file, so extract the 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 (25–28 lines × 2) backend/services/user_service.py:688— backend/services/user_service.py:688-715 | backend/services/user_service.py:723-747 — both copies are in the same file, so extract the 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 (26 lines × 3) backend/services/email_validation_service.py:639— backend/services/email_validation_service.py:639-664 | backend/services/email_validation_service.py:710-735 | backend/services/email_validation_service.py:781-806 — 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 (26 lines × 3) backend/workers/audio_worker.py:780— backend/workers/audio_worker.py:780-816 | backend/workers/render_video_worker.py:990-1015 | backend/workers/video_worker.py:2038-2072 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) REDACTED:1455— REDACTED:1455-1478 | REDACTED:1633-1656 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `EncodePreviewRequest` in one and `EncodeRequest` 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 (24 lines × 2) karaoke_gen/lyrics_transcriber/output/cdg.py:131— karaoke_gen/lyrics_transcriber/output/cdg.py:131-154 | karaoke_gen/lyrics_transcriber/output/cdg.py:829-852 — both copies are in the same file, so extract the 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 (23 lines × 2) backend/api/routes/file_upload.py:1768— backend/api/routes/file_upload.py:1768-1791 | backend/api/routes/file_upload.py:2777-2799 — both copies are in the same file, so extract the 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 (23 lines × 2) scripts/compare_local_vs_remote.py:190— scripts/compare_local_vs_remote.py:190-212 | scripts/compare_local_vs_remote.py:214-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) backend/api/routes/audio_search.py:510— backend/api/routes/audio_search.py:510-530 | backend/api/routes/audio_search.py:548-568 — both copies are in the same file, so extract the 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 `backend/api/routes/audio_search.py:510` 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 (21 lines × 2) karaoke_gen/lyrics_transcriber/output/ass/config.py:125— karaoke_gen/lyrics_transcriber/output/ass/config.py:125-145 | karaoke_gen/lyrics_transcriber/output/ass/config.py:159-179 — both copies are in the same file, so extract the 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 (19–21 lines × 2) backend/workers/render_video_worker.py:402— backend/workers/render_video_worker.py:402-420 | backend/workers/render_video_worker.py:723-743 — both copies are in the same file, so extract the 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–21 lines × 2) REDACTED:56— REDACTED:56-76 | karaoke_gen/karaoke_gen.py:87-105 — 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 `REDACTED:56` 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 (17–20 lines × 2) backend/api/routes/admin.py:3576— backend/api/routes/admin.py:3576-3595 | backend/api/routes/admin.py:3796-3812 — both copies are in the same file, so extract the 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 (17–20 lines × 2) scripts/karaokehunt_outreach/phase1_analyze.py:279— scripts/karaokehunt_outreach/phase1_analyze.py:279-295 | scripts/karaokehunt_outreach/phase1b_audio_search.py:574-593 — 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 `scripts/karaokehunt_outreach/phase1b_audio_search.py:574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 2) karaoke_gen/lyrics_transcriber/correction/agentic/handlers/no_error.py:24— karaoke_gen/lyrics_transcriber/correction/agentic/handlers/no_error.py:24-41 | karaoke_gen/lyrics_transcriber/correction/agentic/handlers/punctuation.py:24-43 — 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 (18–20 lines × 2) karaoke_gen/lyrics_transcriber/lyrics/genius.py:55— karaoke_gen/lyrics_transcriber/lyrics/genius.py:55-74 | karaoke_gen/lyrics_transcriber/lyrics/spotify.py:72-89 — 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) backend/services/audio_search_service.py:119— backend/services/audio_search_service.py:119-137 | scripts/karaokehunt_outreach/phase1b_audio_search.py:170-188 — 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 (19 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:136— karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:136-154 | karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:67-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (16–17 lines × 2) karaoke_gen/lyrics_transcriber/correction/corrector.py:697— karaoke_gen/lyrics_transcriber/correction/corrector.py:697-712 | karaoke_gen/lyrics_transcriber/correction/corrector.py:759-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `karaoke_gen/lyrics_transcriber/correction/corrector.py:697` 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 (16–17 lines × 2) scripts/analyze_reference_relevance.py:100— scripts/analyze_reference_relevance.py:100-116 | scripts/review_reference_relevance.py:76-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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 (14–16 lines × 2) backend/api/routes/audio_search.py:362— backend/api/routes/audio_search.py:362-375 | backend/api/routes/audio_search.py:1120-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. 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 (14–16 lines × 2) backend/services/audio_analysis_service.py:134— backend/services/audio_analysis_service.py:134-147 | backend/services/audio_analysis_service.py:508-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 `backend/services/audio_analysis_service.py:134` 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 × 3) backend/services/encoding_service.py:677— backend/services/encoding_service.py:677-691 | backend/services/encoding_service.py:1082-1096 | backend/services/encoding_service.py:1200-1214 — 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 (15 lines × 3) backend/services/match_judge/ai.py:159— backend/services/match_judge/ai.py:159-173 | backend/services/match_judge/free_text.py:353-367 | backend/services/parse_titles/ai.py:133-147 — 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 `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 (14 lines × 3) infrastructure/modules/backup.py:127— infrastructure/modules/backup.py:127-140 | infrastructure/modules/divebar_lookup.py:62-75 | infrastructure/modules/divebar_mirror.py:104-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/backup.py:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) karaoke_gen/utils/remote_cli.py:379— karaoke_gen/utils/remote_cli.py:379-392 | karaoke_gen/utils/remote_cli.py:590-603 | karaoke_gen/utils/remote_cli.py:862-875 — 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 × 2) backend/services/audio_search_service.py:101— backend/services/audio_search_service.py:101-114 | scripts/karaokehunt_outreach/phase1b_audio_search.py:153-166 — 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 (14 lines × 2) backend/services/auto_correct/service.py:684— backend/services/auto_correct/service.py:684-697 | backend/services/auto_correct/service.py:745-758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) backend/services/visibility_change_service.py:394— backend/services/visibility_change_service.py:394-405 | backend/services/visibility_change_service.py:478-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) REDACTED:395— REDACTED:395-407 | REDACTED:1618-1629 — both copies are in the same file, so extract the 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:395` 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) backend/api/routes/file_upload.py:772— backend/api/routes/file_upload.py:772-782 | backend/api/routes/file_upload.py:1445-1455 | backend/api/routes/file_upload.py:2189-2199 | backend/api/routes/file_upload.py:2510-2520 — 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 `backend/api/routes/file_upload.py:772` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) infrastructure/modules/monitoring.py:87— infrastructure/modules/monitoring.py:87-120 | infrastructure/modules/monitoring.py:124-157 | infrastructure/modules/monitoring.py:161-194 | infrastructure/modules/monitoring.py:317-327 — 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 `infrastructure/modules/monitoring.py:87` 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–10 lines × 2) karaoke_gen/audio_processor.py:228— karaoke_gen/audio_processor.py:228-236 | karaoke_gen/audio_processor.py:239-248 — both copies are in the same file, so extract the 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–10 lines × 2) karaoke_gen/lyrics_transcriber/lyrics/genius.py:320— karaoke_gen/lyrics_transcriber/lyrics/genius.py:320-329 | karaoke_gen/lyrics_transcriber/lyrics/musixmatch.py:81-89 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `karaoke_gen/lyrics_transcriber/lyrics/genius.py:317` calls `debug` and `karaoke_gen/lyrics_transcriber/lyrics/musixmatch.py:79` 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 × 4) backend/workers/lyrics_worker.py:604— backend/workers/lyrics_worker.py:604-612 | backend/workers/screens_worker.py:321-329 | backend/workers/video_worker.py:577-585 | backend/workers/video_worker.py:1289-1297 — 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. 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, `backend/workers/lyrics_worker.py:603` calls `error` and `backend/workers/video_worker.py:576` 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 × 4) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1242— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1242-1250 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1335-1344 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1893-1902 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1994-2003 — 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–9 lines × 2) backend/services/stripe_service.py:202— backend/services/stripe_service.py:202-209 | backend/services/stripe_service.py:303-311 — both copies are in the same file, so extract the 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 `backend/services/stripe_service.py:303` 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 (8–9 lines × 2) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:65— karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:65-72 | karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:117-125 — both copies are in the same file, so extract the 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–8 lines × 2) karaoke_gen/utils/remote_cli.py:2863— karaoke_gen/utils/remote_cli.py:2863-2870 | karaoke_gen/utils/remote_cli.py:3164-3170 — both copies are in the same file, so extract the 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–8 lines × 2) scripts/review_test_fixtures.py:87— scripts/review_test_fixtures.py:87-94 | scripts/review_test_fixtures.py:129-135 — both copies are in the same file, so extract the 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 `scripts/review_test_fixtures.py:87` 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) karaoke_gen/utils/remote_cli.py:2556— karaoke_gen/utils/remote_cli.py:2556-2562 | karaoke_gen/utils/remote_cli.py:2705-2711 | karaoke_gen/utils/remote_cli.py:2786-2792 | karaoke_gen/utils/remote_cli.py:3072-3078 — 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) karaoke_gen/utils/remote_cli.py:2555— karaoke_gen/utils/remote_cli.py:2555-2561 | karaoke_gen/utils/remote_cli.py:2704-2710 | karaoke_gen/utils/remote_cli.py:2739-2745 | karaoke_gen/utils/remote_cli.py:2785-2791 — 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, `karaoke_gen/utils/remote_cli.py:2738` calls `get` and `karaoke_gen/utils/remote_cli.py:2554` 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 × 4) backend/api/routes/jobs.py:319— backend/api/routes/jobs.py:319-325 | backend/api/routes/jobs.py:1778-1784 | backend/api/routes/jobs.py:2520-2524 | backend/api/routes/jobs.py:3340-3346 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) backend/workers/audio_worker.py:213— backend/workers/audio_worker.py:213-220 | backend/workers/screens_worker.py:139-144 | backend/workers/video_worker.py:328-332 | backend/workers/video_worker.py:990-997 — 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.
R10 · Code Duplication· Duplicated block with local edits (35 matched lines × 2 locations) · ×2
Duplicated block with local edits (35 matched lines × 2 locations) frontend/components/job/EditTrackModal.tsx:80— frontend/components/job/EditTrackModal.tsx:80 · frontend/components/job/OutputLinks.tsx:559 — the two spans are one implementation copied and then locally edited — 186 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (35 matched lines × 2 locations) frontend/lib/api/autoCorrect.ts:66— frontend/lib/api/autoCorrect.ts:66 · frontend/lib/api/customLyrics.ts:64 — the two spans are one implementation copied and then locally edited — 193 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (29 lines × 2 locations) frontend/app/[locale]/auth/verify/page.tsx:286— frontend/app/[locale]/auth/verify/page.tsx:286 · frontend/app/[locale]/auth/verify/page.tsx:318 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (29 lines × 2 locations) frontend/components/ui/carousel.tsx:174— frontend/components/ui/carousel.tsx:174 · frontend/components/ui/carousel.tsx:204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2 locations) REDACTED:1007— REDACTED:1007 · REDACTED:1045 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (27 lines × 2 locations) frontend/components/ui/empty.tsx:37— frontend/components/ui/empty.tsx:37 · frontend/components/ui/item.tsx:82 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (24 lines × 2 locations) frontend/app/admin/rate-limits/page.tsx:597— frontend/app/admin/rate-limits/page.tsx:597 · frontend/app/admin/rate-limits/page.tsx:656 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (24 lines × 2 locations) frontend/components/job/steps/CustomizeStep.tsx:400— frontend/components/job/steps/CustomizeStep.tsx:400 · frontend/components/job/steps/CustomizeStep.tsx:506 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Dead file (~135 LoC) frontend/components/ui/drawer.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~135 LoC) frontend/lib/lyrics-review/validation.ts— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (frontend/lib/lyrics-review/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~77 LoC) frontend/components/ui/input-otp.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~77 LoC) frontend/lib/jobs.ts— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped REDACTED:36— ``document.documentElement.lang="${locale}";document.documentElement.dir="${['ar','he'].includes(locale)?'rtl':'ltr'}";`` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped REDACTED:84— `Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC1 · Text alternatives· <video> without a captions track · ×1
<video> without a captions track frontend/components/lyrics-review/PreviewVideoSection.tsx:580— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC2 · Forms & labels· <Slider> field component without a label · ×1
<Slider> field component without a label frontend/components/lyrics-review/AudioPlayer.tsx:222— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Heading level jumps from h1 to h4 · ×1
Heading level jumps from h1 to h4 frontend/app/admin/page.tsx:177— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×1
Heading level jumps from h1 to h3 infrastructure/monitoring/job-inspector.html:351— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure· Data table has no header cells · ×1
Data table has no header cells infrastructure/monitoring/job-inspector.html:448— A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
page.AdminJobsPageContent (cyclomatic 304) REDACTED:139— page.AdminJobsPageContent has cyclomatic complexity 304 (threshold 15). Of this number, 143 points are the body's own statements and 161 belong to 47 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LyricsAnalyzer.LyricsAnalyzer (cyclomatic 276) frontend/components/lyrics-review/LyricsAnalyzer.tsx:144— LyricsAnalyzer.LyricsAnalyzer has cyclomatic complexity 276 (threshold 15). Of this number, 87 points are the body's own statements and 189 belong to 74 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
remote_cli.main (cyclomatic 146) karaoke_gen/utils/remote_cli.py:2491— remote_cli.main has cyclomatic complexity 146 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TenantThemeEditorDialog.TenantThemeEditorDialog (cyclomatic 145) frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94— TenantThemeEditorDialog.TenantThemeEditorDialog has cyclomatic complexity 145 (threshold 15). Of this number, 55 points are the body's own statements and 90 belong to 35 function items inside it that branch. 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.
AudioEditor.AudioEditor (cyclomatic 136) frontend/components/audio-editor/AudioEditor.tsx:341— AudioEditor.AudioEditor has cyclomatic complexity 136 (threshold 15). Of this number, 63 points are the body's own statements and 73 belong to 28 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gen_cli.async_main (cyclomatic 125) karaoke_gen/utils/gen_cli.py:357— gen_cli.async_main has cyclomatic complexity 125 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LyricsSynchronizer.LyricsSynchronizer (cyclomatic 125) frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:55— LyricsSynchronizer.LyricsSynchronizer has cyclomatic complexity 125 (threshold 15). Most of this is not in the body itself: 8 of the 125 points are its own statements and the rest belongs to 40 function literals inside it that branch (lines 559, 677, 604, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
InstrumentalSelector.InstrumentalSelector (cyclomatic 121) frontend/components/instrumental-review/InstrumentalSelector.tsx:56— InstrumentalSelector.InstrumentalSelector has cyclomatic complexity 121 (threshold 15). Of this number, 24 points are the body's own statements and 97 belong to 26 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OutputLinks.OutputLinks (cyclomatic 121) frontend/components/job/OutputLinks.tsx:41— OutputLinks.OutputLinks has cyclomatic complexity 121 (threshold 15). Of this number, 97 points are the body's own statements and 24 belong to 10 function literals inside it that branch. 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.
page.AdminUserDetailPage (cyclomatic 108) REDACTED:76— page.AdminUserDetailPage has cyclomatic complexity 108 (threshold 15). Of this number, 56 points are the body's own statements and 52 belong to 17 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KaraokePrep.prep_single_track (cyclomatic 105) karaoke_gen/karaoke_gen.py:363— KaraokePrep.prep_single_track has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PreviewVideoSection.PreviewVideoSection (cyclomatic 103) frontend/components/lyrics-review/PreviewVideoSection.tsx:85— PreviewVideoSection.PreviewVideoSection has cyclomatic complexity 103 (threshold 15). Of this number, 21 points are the body's own statements and 82 belong to 22 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page.AdminTenantsPage (cyclomatic 94) frontend/app/admin/tenants/page.tsx:126— page.AdminTenantsPage has cyclomatic complexity 94 (threshold 15). Of this number, 26 points are the body's own statements and 68 belong to 16 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TimelineCanvas.TimelineCanvas (cyclomatic 90) frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:107— TimelineCanvas.TimelineCanvas has cyclomatic complexity 90 (threshold 15). Most of this is not in the body itself: 1 of the 90 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 283, 600, 536, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
file_upload.upload_and_create_job (cyclomatic 89) backend/api/routes/file_upload.py:487— file_upload.upload_and_create_job has cyclomatic complexity 89 (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.
LyricsCorrector._process_corrections (cyclomatic 88) karaoke_gen/lyrics_transcriber/correction/corrector.py:270— LyricsCorrector._process_corrections has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AudioSearchDialog.AudioSearchDialog (cyclomatic 86) frontend/components/audio-search/AudioSearchDialog.tsx:34— AudioSearchDialog.AudioSearchDialog has cyclomatic complexity 86 (threshold 15). Of this number, 26 points are the body's own statements and 60 belong to 17 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
client.RequestsBoardClient (cyclomatic 83) frontend/app/[locale]/requests/client.tsx:62— client.RequestsBoardClient has cyclomatic complexity 83 (threshold 15). Of this number, 39 points are the body's own statements and 44 belong to 17 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JobSubmission.JobSubmission (cyclomatic 83) frontend/components/job/JobSubmission.tsx:24— JobSubmission.JobSubmission has cyclomatic complexity 83 (threshold 15). Of this number, 39 points are the body's own statements and 44 belong to 13 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page.AppPageContent (cyclomatic 77) frontend/app/[locale]/app/page.tsx:50— page.AppPageContent has cyclomatic complexity 77 (threshold 15). Of this number, 43 points are the body's own statements and 34 belong to 16 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditModal.EditModal (cyclomatic 77) frontend/components/lyrics-review/modals/EditModal.tsx:45— EditModal.EditModal has cyclomatic complexity 77 (threshold 15). Of this number, 34 points are the body's own statements and 43 belong to 20 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AudioSourceStep.AudioSourceStep (cyclomatic 76) frontend/components/job/steps/AudioSourceStep.tsx:135— AudioSourceStep.AudioSourceStep has cyclomatic complexity 76 (threshold 15). Of this number, 33 points are the body's own statements and 43 belong to 15 function items inside it that branch. 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.
BulkAlbumMode.BulkAlbumMode (cyclomatic 75) frontend/components/job/bulk/BulkAlbumMode.tsx:208— BulkAlbumMode.BulkAlbumMode has cyclomatic complexity 75 (threshold 15). Of this number, 32 points are the body's own statements and 43 belong to 14 function items inside it that branch. 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.
CustomizeStep.CustomizeStep (cyclomatic 70) frontend/components/job/steps/CustomizeStep.tsx:295— CustomizeStep.CustomizeStep has cyclomatic complexity 70 (threshold 15). Of this number, 54 points are the body's own statements and 16 belong to 10 function items inside it that branch. 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.
render_video_worker.process_render_video (cyclomatic 68) backend/workers/render_video_worker.py:93— render_video_worker.process_render_video has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
internal._recover_stuck_jobs_sync (cyclomatic 67) backend/api/routes/internal.py:1185— internal._recover_stuck_jobs_sync has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.AdminUsersPage (cyclomatic 58) REDACTED:79— page.AdminUsersPage has cyclomatic complexity 58 (threshold 15). Of this number, 18 points are the body's own statements and 40 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.AdminRateLimitsPage (cyclomatic 57) frontend/app/admin/rate-limits/page.tsx:43— page.AdminRateLimitsPage has cyclomatic complexity 57 (threshold 15). Of this number, 23 points are the body's own statements and 34 belong to 19 function items inside it that branch. 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.
TranscriptionView.TranscriptionView (cyclomatic 57) frontend/components/lyrics-review/TranscriptionView.tsx:36— TranscriptionView.TranscriptionView has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 5 of the 57 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 283, a function literal at line 131, a function literal at line 244, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page.ReferralsPage (cyclomatic 54) frontend/app/admin/referrals/page.tsx:37— page.ReferralsPage has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 15 of the 54 points are its own statements and the rest belongs to 13 function items inside it that branch (handleEdit, handleCreate, a function literal at line 503, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ErrorMonitor._run_monitor_cycle (cyclomatic 52) backend/services/error_monitor/monitor.py:417— ErrorMonitor._run_monitor_cycle has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JobMonitor.download_outputs (cyclomatic 52) karaoke_gen/utils/remote_cli.py:1947— JobMonitor.download_outputs has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stale_review_processor.process_stale_reviews_sync (cyclomatic 51) backend/workers/stale_review_processor.py:51— stale_review_processor.process_stale_reviews_sync has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.VerifyMagicLinkContent (cyclomatic 51) frontend/app/[locale]/auth/verify/page.tsx:16— page.VerifyMagicLinkContent has cyclomatic complexity 51 (threshold 15). Of this number, 24 points are the body's own statements and 27 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
jobs.retry_job (cyclomatic 50) backend/api/routes/jobs.py:2094— jobs.retry_job has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tenant_theme_service.sanitize_style_params (cyclomatic 50) backend/services/tenant_theme_service.py:165— tenant_theme_service.sanitize_style_params has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KaraokeComposer._compose_lyric (cyclomatic 50) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:935— KaraokeComposer._compose_lyric has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteKaraokeClient.submit_finalise_only_job (cyclomatic 50) karaoke_gen/utils/remote_cli.py:676— RemoteKaraokeClient.submit_finalise_only_job has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
file_upload.mark_finalise_uploads_complete (cyclomatic 46) backend/api/routes/file_upload.py:2582— file_upload.mark_finalise_uploads_complete has cyclomatic complexity 46 (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.
page.ConsumerLandingPage (cyclomatic 46) frontend/app/[locale]/page.tsx:44— page.ConsumerLandingPage has cyclomatic complexity 46 (threshold 15). Of this number, 23 points are the body's own statements and 23 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Header.Header (cyclomatic 46) frontend/components/lyrics-review/Header.tsx:77— Header.Header has cyclomatic complexity 46 (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.
video_worker.generate_video_orchestrated (cyclomatic 45) backend/workers/video_worker.py:230— video_worker.generate_video_orchestrated has cyclomatic complexity 45 (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.
RemoteKaraokeClient.submit_job (cyclomatic 45) karaoke_gen/utils/remote_cli.py:404— RemoteKaraokeClient.submit_job has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
user-emails-card.UserEmailsCard (cyclomatic 45) frontend/components/admin/user-emails-card.tsx:51— user-emails-card.UserEmailsCard has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body's own statements and 19 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audio_search.search_audio (cyclomatic 44) backend/api/routes/audio_search.py:685— audio_search.search_audio has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
executor.maybe_auto_complete_review (cyclomatic 43) REDACTED:87— executor.maybe_auto_complete_review has cyclomatic complexity 43 (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.
ReviewChangesModal.ReviewChangesModal (cyclomatic 43) frontend/components/lyrics-review/modals/ReviewChangesModal.tsx:76— ReviewChangesModal.ReviewChangesModal has cyclomatic complexity 43 (threshold 15). Of this number, 31 points are the body's own statements and 12 belong to 6 function items inside it that branch. 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.
ReferralDashboard.ReferralDashboard (cyclomatic 43) frontend/components/referrals/ReferralDashboard.tsx:26— ReferralDashboard.ReferralDashboard has cyclomatic complexity 43 (threshold 15). Of this number, 28 points are the body's own statements and 15 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
admin.restart_job (cyclomatic 42) backend/api/routes/admin.py:2593— admin.restart_job 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.
file_upload.create_job_from_url (cyclomatic 41) backend/api/routes/file_upload.py:2002— file_upload.create_job_from_url has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StorageRetentionService.run (cyclomatic 41) backend/services/storage_retention.py:530— StorageRetentionService.run has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JobCard.JobCard (cyclomatic 41) frontend/components/job/JobCard.tsx:104— JobCard.JobCard has cyclomatic complexity 41 (threshold 15). Of this number, 29 points are the body's own statements and 12 belong to one function item inside it that branches. 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.
SessionRestoreDialog.SessionRestoreDialog (cyclomatic 41) frontend/components/lyrics-review/SessionRestoreDialog.tsx:94— SessionRestoreDialog.SessionRestoreDialog has cyclomatic complexity 41 (threshold 15). Of this number, 17 points are the body's own statements and 24 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audio_worker.process_audio_separation (cyclomatic 40) backend/workers/audio_worker.py:139— audio_worker.process_audio_separation has cyclomatic complexity 40 (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.
lyrics_worker.process_lyrics_transcription (cyclomatic 40) backend/workers/lyrics_worker.py:196— lyrics_worker.process_lyrics_transcription has cyclomatic complexity 40 (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.
video_worker.generate_video_legacy (cyclomatic 39) backend/workers/video_worker.py:914— video_worker.generate_video_legacy has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AudioProcessor.process_audio_separation (cyclomatic 39) karaoke_gen/audio_processor.py:256— AudioProcessor.process_audio_separation has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
client.LyricsReviewWrapper (cyclomatic 39) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:342— client.LyricsReviewWrapper has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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.
HighlightedText.HighlightedText::shouldWordFlash (cyclomatic 39) frontend/components/lyrics-review/shared/HighlightedText.tsx:160— HighlightedText.HighlightedText::shouldWordFlash has cyclomatic complexity 39 (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.
file_upload.create_job_with_upload_urls (cyclomatic 38) backend/api/routes/file_upload.py:1273— file_upload.create_job_with_upload_urls has cyclomatic complexity 38 (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.
jobs.edit_completed_track (cyclomatic 38) backend/api/routes/jobs.py:298— jobs.edit_completed_track has cyclomatic complexity 38 (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.
users.stripe_webhook (cyclomatic 38) backend/api/routes/users.py:1703— users.stripe_webhook has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.AdminSearchesPage (cyclomatic 38) frontend/app/admin/searches/page.tsx:60— page.AdminSearchesPage has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 9 function items inside it that branch (getStatusVariant, a function literal at line 303, a function literal at line 80, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CustomLyricsMode.CustomLyricsMode (cyclomatic 38) frontend/components/lyrics-review/modals/CustomLyricsMode.tsx:49— CustomLyricsMode.CustomLyricsMode has cyclomatic complexity 38 (threshold 15). Of this number, 20 points are the body's own statements and 18 belong to 6 function literals inside it that branch. 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.
file_upload.mark_uploads_complete (cyclomatic 37) backend/api/routes/file_upload.py:1557— file_upload.mark_uploads_complete has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tenant_admin_service.create_tenant (cyclomatic 37) backend/services/tenant_admin_service.py:272— tenant_admin_service.create_tenant has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BuyCreditsDialog.BuyCreditsDialog (cyclomatic 37) frontend/components/credits/BuyCreditsDialog.tsx:22— BuyCreditsDialog.BuyCreditsDialog has cyclomatic complexity 37 (threshold 15). Of this number, 21 points are the body's own statements and 16 belong to 8 function items inside it that branch. 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.
translate.translate_locale (cyclomatic 36) frontend/scripts/translate.py:343— translate.translate_locale 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.
Word.WordComponent (cyclomatic 36) frontend/components/lyrics-review/shared/Word.tsx:11— Word.WordComponent 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.
main.run_encoding (cyclomatic 35) REDACTED:1079— main.run_encoding has cyclomatic complexity 35 (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.
client.DeleteAccountClient (cyclomatic 35) frontend/app/[locale]/account/delete/client.tsx:46— client.DeleteAccountClient has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GuidancePanel.GuidancePanel (cyclomatic 35) frontend/components/lyrics-review/GuidancePanel.tsx:32— GuidancePanel.GuidancePanel has cyclomatic complexity 35 (threshold 15). Of this number, 28 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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.
file_upload.create_finalise_only_job (cyclomatic 34) backend/api/routes/file_upload.py:2345— file_upload.create_finalise_only_job has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
jobs.list_jobs (cyclomatic 34) backend/api/routes/jobs.py:667— jobs.list_jobs has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
youtube_comment_bot_worker.run_comment_bot_sync (cyclomatic 34) backend/workers/youtube_comment_bot_worker.py:116— youtube_comment_bot_worker.run_comment_bot_sync has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ASS.write_srt (cyclomatic 34) karaoke_gen/lyrics_transcriber/output/ass/ass.py:504— ASS.write_srt has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gen_cli.run_combined_review (cyclomatic 34) karaoke_gen/utils/gen_cli.py:149— gen_cli.run_combined_review has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
client.JobRouterClient (cyclomatic 34) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:48— client.JobRouterClient has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 94, 51, 56, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WaveformViewer.WaveformViewer (cyclomatic 34) frontend/components/instrumental-review/WaveformViewer.tsx:54— WaveformViewer.WaveformViewer has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 73, a function literal at line 232, handleMouseDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
version-footer.VersionFooter (cyclomatic 34) frontend/components/version-footer.tsx:7— version-footer.VersionFooter has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 7 function items inside it that branch (renderEncodingWorkerStatus, renderFlacfetchStatus, renderAudioSeparatorStatus, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
EncodingService.wait_for_completion (cyclomatic 33) backend/services/encoding_service.py:769— EncodingService.wait_for_completion 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.
build_import_list.main (cyclomatic 33) infrastructure/cloudflare/scripts/build_import_list.py:69— build_import_list.main 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.
page.AudioEditsPage (cyclomatic 33) frontend/app/admin/audio-edits/page.tsx:211— page.AudioEditsPage has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body's own statements and 16 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
admin.update_job (cyclomatic 32) backend/api/routes/admin.py:933— admin.update_job has cyclomatic complexity 32 (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.
jobs._run_distribution_cleanup (cyclomatic 32) backend/api/routes/jobs.py:2601— jobs._run_distribution_cleanup has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
jobs._create_job_from_search_sync (cyclomatic 32) backend/api/routes/jobs.py:2873— jobs._create_job_from_search_sync has cyclomatic complexity 32 (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.
song_request_service._cast_vote_txn (cyclomatic 32) backend/services/song_request_service.py:653— song_request_service._cast_vote_txn has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SoundAlikeHandler._codes_match (cyclomatic 32) karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:163— SoundAlikeHandler._codes_match has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FindReplaceModal.FindReplaceModal (cyclomatic 32) frontend/components/lyrics-review/modals/FindReplaceModal.tsx:35— FindReplaceModal.FindReplaceModal has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 69, handleKeyDown, a function literal at line 60, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
admin._compute_admin_stats_overview (cyclomatic 31) backend/api/routes/admin.py:191— admin._compute_admin_stats_overview has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InstrumentalSelectorEmbedded.InstrumentalSelectorEmbedded (cyclomatic 31) frontend/components/instrumental-review/InstrumentalSelectorEmbedded.tsx:45— InstrumentalSelectorEmbedded.InstrumentalSelectorEmbedded has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 128, 66, 60, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SearchLyricsTab.SearchLyricsTab (cyclomatic 31) frontend/components/lyrics-review/modals/SearchLyricsTab.tsx:21— SearchLyricsTab.SearchLyricsTab has cyclomatic complexity 31 (threshold 15). Of this number, 25 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
chart.ChartTooltipContent (cyclomatic 31) REDACTED:107— chart.ChartTooltipContent has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 182, 131). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
keyboardHandlers.setupKeyboardHandlers.handleKeyDown (cyclomatic 31) frontend/lib/lyrics-review/utils/keyboardHandlers.ts:63— keyboardHandlers.setupKeyboardHandlers.handleKeyDown has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resumable-upload.uploadResumable (cyclomatic 31) frontend/lib/resumable-upload.ts:249— resumable-upload.uploadResumable has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
review._reconstruct_post_ai_segments (cyclomatic 30) REDACTED:679— review._reconstruct_post_ai_segments 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.
AudioProcessor._process_audio_separation_remote (cyclomatic 30) karaoke_gen/audio_processor.py:507— AudioProcessor._process_audio_separation_remote 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.
AnchorSequenceFinder._find_anchors_impl (cyclomatic 30) REDACTED:396— AnchorSequenceFinder._find_anchors_impl 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.
page.EditReviewsPage (cyclomatic 30) frontend/app/admin/edit-reviews/page.tsx:353— page.EditReviewsPage has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audio-search-utils.getSearchConfidence (cyclomatic 30) frontend/lib/audio-search-utils.ts:380— audio-search-utils.getSearchConfidence has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
RemoteKaraokeClient.search_audio (cyclomatic 29) karaoke_gen/utils/remote_cli.py:1190— RemoteKaraokeClient.search_audio has cyclomatic complexity 29 (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.
AudioSourceStep.FallbackSection (cyclomatic 29) frontend/components/job/steps/AudioSourceStep.tsx:1248— AudioSourceStep.FallbackSection has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutoCorrectPanel.AutoCorrectPanel (cyclomatic 29) frontend/components/lyrics-review/AutoCorrectPanel.tsx:55— AutoCorrectPanel.AutoCorrectPanel has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to 3 function literals inside it that branch. 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.
push-settings.PushSettings (cyclomatic 29) frontend/components/push-settings.tsx:14— push-settings.PushSettings has cyclomatic complexity 29 (threshold 15). Of this number, 15 points are the body's own statements and 14 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ops_alerts.notify_job_failed (cyclomatic 28) backend/services/ops_alerts.py:277— ops_alerts.notify_job_failed has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ASS.loop (cyclomatic 28) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1755— ASS.loop 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.
TenantJobFlow.TenantJobFlow (cyclomatic 28) frontend/components/job/TenantJobFlow.tsx:30— TenantJobFlow.TenantJobFlow has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StorageRetentionService.purge_orphans (cyclomatic 27) backend/services/storage_retention.py:884— StorageRetentionService.purge_orphans 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.
StripeAdminService.store_payment (cyclomatic 27) backend/services/stripe_admin_service.py:60— StripeAdminService.store_payment 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.
audio_download_worker.process_audio_download (cyclomatic 27) backend/workers/audio_download_worker.py:208— audio_download_worker.process_audio_download 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.
video_worker._handle_native_distribution (cyclomatic 27) backend/workers/video_worker.py:1343— video_worker._handle_native_distribution 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.
GuidedJobFlow.GuidedJobFlow::handleConfirm (cyclomatic 27) frontend/components/job/GuidedJobFlow.tsx:177— GuidedJobFlow.GuidedJobFlow::handleConfirm 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. This shape REPEATS in the file: one other method here (GuidedJobFlow.GuidedJobFlow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AudioPlayer.AudioPlayer (cyclomatic 27) frontend/components/lyrics-review/AudioPlayer.tsx:35— AudioPlayer.AudioPlayer has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 89, handlePlayPause, handleSeek, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useWordClick.useWordClick.handleWordClick (cyclomatic 27) frontend/components/lyrics-review/shared/useWordClick.ts:35— useWordClick.useWordClick.handleWordClick 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.
ReplaceAllLyricsModal.ReplaceAllLyricsModal (cyclomatic 27) frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx:48— ReplaceAllLyricsModal.ReplaceAllLyricsModal has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 10 function literals inside it that branch. 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.
conversion_emails.process_conversion_emails (cyclomatic 26) backend/services/conversion_emails.py:110— conversion_emails.process_conversion_emails has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PackagingService.create_cdg_package (cyclomatic 26) backend/services/packaging_service.py:51— PackagingService.create_cdg_package 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.
VisibilityChangeService._delete_distributed_outputs (cyclomatic 26) backend/services/visibility_change_service.py:436— VisibilityChangeService._delete_distributed_outputs 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.
audio_worker.upload_separation_results (cyclomatic 26) backend/workers/audio_worker.py:595— audio_worker.upload_separation_results 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.
ASS.tidy (cyclomatic 26) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1135— ASS.tidy 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.
KaraokeComposer._compose_instrumental (cyclomatic 26) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1299— KaraokeComposer._compose_instrumental has cyclomatic complexity 26 (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.
metadata.parse_track_metadata (cyclomatic 26) karaoke_gen/metadata.py:58— metadata.parse_track_metadata has cyclomatic complexity 26 (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.
JobMonitor.monitor (cyclomatic 26) karaoke_gen/utils/remote_cli.py:2308— JobMonitor.monitor 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.
api.apiFetch (cyclomatic 26) frontend/lib/api.ts:635— api.apiFetch has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
review.get_correction_data (cyclomatic 25) REDACTED:811— review.get_correction_data has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
users._handle_made_for_you_order (cyclomatic 25) backend/api/routes/users.py:1335— users._handle_made_for_you_order 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.
audio_search_service._categorize_result (cyclomatic 25) backend/services/audio_search_service.py:83— audio_search_service._categorize_result has cyclomatic complexity 25 (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.
main.run_render_video (cyclomatic 25) REDACTED:443— main.run_render_video has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
job_health_service.check_job_consistency (cyclomatic 25) backend/services/job_health_service.py:67— job_health_service.check_job_consistency has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tenant_admin_service.update_tenant (cyclomatic 25) backend/services/tenant_admin_service.py:581— tenant_admin_service.update_tenant has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
timing_sanitizer._fill_segment_bounds (cyclomatic 25) backend/services/timing_sanitizer.py:26— timing_sanitizer._fill_segment_bounds has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
translate.async_main (cyclomatic 25) frontend/scripts/translate.py:551— translate.async_main 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.
main.divebar_lookup (cyclomatic 25) infrastructure/functions/divebar_lookup/main.py:718— main.divebar_lookup has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KaraokeFinalise.execute_optional_features (cyclomatic 25) REDACTED:1523— KaraokeFinalise.execute_optional_features has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LyricsProcessor.transcribe_lyrics (cyclomatic 25) karaoke_gen/lyrics_processor.py:256— LyricsProcessor.transcribe_lyrics 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.
CrashReport.CrashReport (cyclomatic 25) frontend/components/CrashReport.tsx:37— CrashReport.CrashReport has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (send, a function literal at line 57, a function literal at line 47, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SyncControls.SyncControls (cyclomatic 25) frontend/components/lyrics-review/synchronizer/SyncControls.tsx:51— SyncControls.SyncControls has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
admin.delete_job_outputs (cyclomatic 24) backend/api/routes/admin.py:1682— admin.delete_job_outputs has cyclomatic complexity 24 (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.
audio_search.select_audio_source (cyclomatic 24) backend/api/routes/audio_search.py:1537— audio_search.select_audio_source has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AuthService.validate_token_full (cyclomatic 24) backend/services/auth_service.py:248— AuthService.validate_token_full has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lyrics_diff.compute_lyrics_diff (cyclomatic 24) backend/services/auto_approval/lyrics_diff.py:133— lyrics_diff.compute_lyrics_diff has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
deterministic._gap_readings (cyclomatic 24) backend/services/auto_correct/deterministic.py:110— deterministic._gap_readings has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deterministic.leading_connective_suggestions (cyclomatic 24) backend/services/auto_correct/deterministic.py:199— deterministic.leading_connective_suggestions has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocalEncodingService.encode_all_formats (cyclomatic 24) REDACTED:497— LocalEncodingService.encode_all_formats has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
theme_preview_service.resolve_assets (cyclomatic 24) REDACTED:204— theme_preview_service.resolve_assets has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
video_worker.redistribute_video (cyclomatic 24) backend/workers/video_worker.py:690— video_worker.redistribute_video has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
youtube_description_backfill_worker.run_backfill_sync (cyclomatic 24) backend/workers/youtube_description_backfill_worker.py:57— youtube_description_backfill_worker.run_backfill_sync has cyclomatic complexity 24 (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.
LyricsTranscriber.__init__ (cyclomatic 24) karaoke_gen/lyrics_transcriber/core/controller.py:62— LyricsTranscriber.__init__ has cyclomatic complexity 24 (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.
RemoteKaraokeClient.submit_job_from_url (cyclomatic 24) karaoke_gen/utils/remote_cli.py:272— RemoteKaraokeClient.submit_job_from_url has cyclomatic complexity 24 (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.
PasteLyricsTab.PasteLyricsTab (cyclomatic 24) frontend/components/lyrics-review/modals/PasteLyricsTab.tsx:19— PasteLyricsTab.PasteLyricsTab has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 2 function items inside it that branch. 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.
audio-search-utils.categorizeResult (cyclomatic 24) frontend/lib/audio-search-utils.ts:63— audio-search-utils.categorizeResult 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.
admin.reset_job (cyclomatic 23) backend/api/routes/admin.py:1233— admin.reset_job 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.
apply.apply_suggestion (cyclomatic 23) backend/services/auto_approval/apply.py:103— apply.apply_suggestion 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.
scorer.extract_lyrics_signals (cyclomatic 23) backend/services/auto_approval/scorer.py:273— scorer.extract_lyrics_signals has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GCEEncodingBackend.encode (cyclomatic 23) backend/services/encoding_interface.py:421— GCEEncodingBackend.encode 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.
encoding_interface.classify_encoded_output (cyclomatic 23) backend/services/encoding_interface.py:57— encoding_interface.classify_encoded_output 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.
free_text._verdict_from_response (cyclomatic 23) backend/services/match_judge/free_text.py:135— free_text._verdict_from_response has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
youtube_comment_bot.decide (cyclomatic 23) backend/services/youtube_comment_bot.py:410— youtube_comment_bot.decide 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.
screens_worker.generate_screens (cyclomatic 23) backend/workers/screens_worker.py:71— screens_worker.generate_screens 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.
main.backup_to_aws (cyclomatic 23) infrastructure/functions/backup_to_aws/main.py:85— main.backup_to_aws 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.
client.ReplaySyncVerdict (cyclomatic 23) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:604— client.ReplaySyncVerdict has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (save, nextJob, pill, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
client.ReplayActionLog (cyclomatic 23) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:694— client.ReplayActionLog has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 707, badge, a function literal at line 753). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page.AdminFeedbackPage (cyclomatic 23) frontend/app/admin/feedback/page.tsx:76— page.AdminFeedbackPage has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 213, a function literal at line 85, hasTextContent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TenantBulkFlow.TenantBulkFlow::submitOneRow (cyclomatic 23) frontend/components/job/TenantBulkFlow.tsx:277— TenantBulkFlow.TenantBulkFlow::submitOneRow has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TenantBulkFlow.TenantBulkFlow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
audio_search._download_audio_and_trigger_workers (cyclomatic 22) backend/api/routes/audio_search.py:424— audio_search._download_audio_and_trigger_workers 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.
review._save_review_completion (cyclomatic 22) REDACTED:1415— review._save_review_completion 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.
deterministic.reference_majority_suggestions (cyclomatic 22) backend/services/auto_correct/deterministic.py:289— deterministic.reference_majority_suggestions 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.
JobManager._transition_to_state_unlocked (cyclomatic 22) backend/services/job_manager.py:693— JobManager._transition_to_state_unlocked 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.
PushNotificationService.send_push_sync (cyclomatic 22) backend/services/push_notification_service.py:109— PushNotificationService.send_push_sync 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.
storage_retention.classify_file (cyclomatic 22) backend/services/storage_retention.py:97— storage_retention.classify_file 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.
analyze._llm_analyze (cyclomatic 22) backend/services/tenant_bulk/analyze.py:367— analyze._llm_analyze 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.
lyrics_worker.upload_lyrics_results (cyclomatic 22) backend/workers/lyrics_worker.py:755— lyrics_worker.upload_lyrics_results 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.
KaraokeFinalise.validate_input_parameters_for_features (cyclomatic 22) REDACTED:256— KaraokeFinalise.validate_input_parameters_for_features 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.
KaraokeFinalise.execute_command_with_fallback (cyclomatic 22) REDACTED:1823— KaraokeFinalise.execute_command_with_fallback 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.
LyricsTranscriber.process (cyclomatic 22) karaoke_gen/lyrics_transcriber/core/controller.py:295— LyricsTranscriber.process 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.
KaraokeComposer.__init__ (cyclomatic 22) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:203— KaraokeComposer.__init__ 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.
page.RevenueOverviewTab (cyclomatic 22) frontend/app/admin/payments/page.tsx:136— page.RevenueOverviewTab has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TenantBulkFlow.TenantBulkFlow (cyclomatic 22) frontend/components/job/TenantBulkFlow.tsx:91— TenantBulkFlow.TenantBulkFlow 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. This shape REPEATS in the file: one other method here (TenantBulkFlow.TenantBulkFlow::submitOneRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CorrectionAnnotationModal.CorrectionAnnotationModal (cyclomatic 22) frontend/components/lyrics-review/modals/CorrectionAnnotationModal.tsx:56— CorrectionAnnotationModal.CorrectionAnnotationModal has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QRCodeTab.QRCodeTab (cyclomatic 22) frontend/components/referrals/QRCodeTab.tsx:94— QRCodeTab.QRCodeTab has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 125, a function literal at line 101, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
admin.get_edit_review_detail (cyclomatic 21) backend/api/routes/admin.py:3649— admin.get_edit_review_detail has cyclomatic complexity 21 (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.
file_upload.complete_style_uploads (cyclomatic 21) backend/api/routes/file_upload.py:2889— file_upload.complete_style_uploads 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.
jobs.download_file (cyclomatic 21) backend/api/routes/jobs.py:1920— jobs.download_file 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.
users.resend_magic_link_from_token (cyclomatic 21) backend/api/routes/users.py:779— users.resend_magic_link_from_token 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.
users.submit_user_feedback (cyclomatic 21) backend/api/routes/users.py:2052— users.submit_user_feedback has cyclomatic complexity 21 (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.
vocal_gaps.reference_lines_between (cyclomatic 21) backend/services/auto_approval/vocal_gaps.py:159— vocal_gaps.reference_lines_between 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.
service._assign_conflict_groups (cyclomatic 21) backend/services/auto_correct/service.py:140— service._assign_conflict_groups 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.
StorageRetentionService._execute (cyclomatic 21) backend/services/storage_retention.py:781— StorageRetentionService._execute 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.
UserService.find_account_correlations (cyclomatic 21) backend/services/user_service.py:872— UserService.find_account_correlations 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.
VisibilityChangeService._delete_public_outputs (cyclomatic 21) backend/services/visibility_change_service.py:339— VisibilityChangeService._delete_public_outputs 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.
video_worker._prepare_distribution_directory (cyclomatic 21) backend/workers/video_worker.py:1824— video_worker._prepare_distribution_directory 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.
VideoWorkerOrchestrator._upload_to_youtube (cyclomatic 21) backend/workers/video_worker_orchestrator.py:825— VideoWorkerOrchestrator._upload_to_youtube 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.
AudioProcessor._organize_stage1_remote_results (cyclomatic 21) karaoke_gen/audio_processor.py:676— AudioProcessor._organize_stage1_remote_results 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.
SoundAlikeHandler.handle (cyclomatic 21) karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:78— SoundAlikeHandler.handle 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.
payment-detail.PaymentDetailSheet (cyclomatic 21) REDACTED:62— payment-detail.PaymentDetailSheet has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
AudioEditor.WaveformCanvas (cyclomatic 21) frontend/components/audio-editor/AudioEditor.tsx:102— AudioEditor.WaveformCanvas has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 124, a function literal at line 222, getTimeFromEvent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TitleCardPreview.TitleCardPreview (cyclomatic 21) frontend/components/job/TitleCardPreview.tsx:151— TitleCardPreview.TitleCardPreview has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 159). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
BulkMode.BulkMode (cyclomatic 21) frontend/components/job/bulk/BulkMode.tsx:30— BulkMode.BulkMode has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 67, a function literal at line 43, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FlyerTab.FlyerTab (cyclomatic 21) frontend/components/referrals/FlyerTab.tsx:21— FlyerTab.FlyerTab has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 57, handleExport, a function literal at line 36, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
admin.list_audio_edit_reviews (cyclomatic 20) backend/api/routes/admin.py:3761— admin.list_audio_edit_reviews 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.
AuthService.validate_token (cyclomatic 20) backend/services/auth_service.py:150— AuthService.validate_token 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.
scorer._extract_gating_signals (cyclomatic 20) backend/services/auto_approval/scorer.py:156— scorer._extract_gating_signals 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.
FakeConfig.validate (cyclomatic 20) backend/services/fake_workers/config.py:92— FakeConfig.validate 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.
video_worker._setup_working_directory (cyclomatic 20) backend/workers/video_worker.py:1706— video_worker._setup_working_directory 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.
main.validate_files (cyclomatic 20) infrastructure/functions/gdrive_validator/main.py:238— main.validate_files 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.
refund-dialog.RefundDialog (cyclomatic 20) frontend/components/admin/refund-dialog.tsx:38— refund-dialog.RefundDialog has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
AuthStatus.AuthStatus (cyclomatic 20) frontend/components/auth/AuthStatus.tsx:31— AuthStatus.AuthStatus has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
ThemeSelector.ThemeSelector (cyclomatic 20) frontend/components/job/ThemeSelector.tsx:20— ThemeSelector.ThemeSelector has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
UploadProgressModal.UploadProgressModal (cyclomatic 20) frontend/components/upload/UploadProgressModal.tsx:57— UploadProgressModal.UploadProgressModal has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useManualSync.useManualSync (cyclomatic 20) frontend/hooks/useManualSync.ts:126— useManualSync.useManualSync has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 386, 552, 561, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
admin.cleanup_orphaned_outputs (cyclomatic 19) backend/api/routes/admin.py:1890— admin.cleanup_orphaned_outputs 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.
health.system_status (cyclomatic 19) backend/api/routes/health.py:361— health.system_status 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.
login_code.send_login_code (cyclomatic 19) backend/api/routes/login_code.py:146— login_code.send_login_code has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
review.generate_preview_video (cyclomatic 19) REDACTED:2021— review.generate_preview_video 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.
review.apply_audio_edit (cyclomatic 19) REDACTED:3105— review.apply_audio_edit has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
users.send_magic_link (cyclomatic 19) backend/api/routes/users.py:292— users.send_magic_link has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
users.verify_magic_link (cyclomatic 19) backend/api/routes/users.py:599— users.verify_magic_link has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LoopWatchdog._finish (cyclomatic 19) REDACTED:349— LoopWatchdog._finish has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
service.judge_match (cyclomatic 19) backend/services/match_judge/service.py:130— service.judge_match 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.
service.separate_quick (cyclomatic 19) backend/services/quick_version/service.py:95— service.separate_quick 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.
timing_sanitizer.sanitize_corrections (cyclomatic 19) backend/services/timing_sanitizer.py:61— timing_sanitizer.sanitize_corrections 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.
tracing.setup_tracing (cyclomatic 19) backend/services/tracing.py:98— tracing.setup_tracing has cyclomatic complexity 19 (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.
VideoWorkerOrchestrator._run_encoding (cyclomatic 19) backend/workers/video_worker_orchestrator.py:505— VideoWorkerOrchestrator._run_encoding 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.
pack.tile_to_packets (cyclomatic 19) karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:346— pack.tile_to_packets 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.
OutputGenerator.__init__ (cyclomatic 19) karaoke_gen/lyrics_transcriber/output/generator.py:37— OutputGenerator.__init__ has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AuthDialog.AuthDialog (cyclomatic 19) frontend/components/auth/AuthDialog.tsx:25— AuthDialog.AuthDialog has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
FeedbackDialog.FeedbackDialog (cyclomatic 19) frontend/components/feedback/FeedbackDialog.tsx:49— FeedbackDialog.FeedbackDialog has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
ImageUploadField.ImageUploadField (cyclomatic 19) frontend/components/job/ImageUploadField.tsx:26— ImageUploadField.ImageUploadField has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JobActions.JobActions (cyclomatic 19) frontend/components/job/JobActions.tsx:20— JobActions.JobActions has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
ReferenceView.ReferenceView (cyclomatic 19) frontend/components/lyrics-review/ReferenceView.tsx:15— ReferenceView.ReferenceView has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 78, 48, 39, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
system-status-modal.SystemStatusModal (cyclomatic 19) frontend/components/system-status-modal.tsx:212— system-status-modal.SystemStatusModal has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
admin.override_audio_source (cyclomatic 18) backend/api/routes/admin.py:2940— admin.override_audio_source 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.
admin.list_edit_reviews (cyclomatic 18) backend/api/routes/admin.py:3553— admin.list_edit_reviews has cyclomatic complexity 18 (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.
audio_search.research_audio (cyclomatic 18) backend/api/routes/audio_search.py:1149— audio_search.research_audio 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.
audio_search.provide_url_for_job (cyclomatic 18) backend/api/routes/audio_search.py:1303— audio_search.provide_url_for_job 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.
users.complete_verified_login (cyclomatic 18) backend/api/routes/users.py:502— users.complete_verified_login 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.
CustomLyricsService.generate (cyclomatic 18) backend/services/custom_lyrics/service.py:95— CustomLyricsService.generate 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.
EmailService.send_karaokehunt_conversion (cyclomatic 18) REDACTED:1017— EmailService.send_karaokehunt_conversion 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.
LoopWatchdog.check (cyclomatic 18) REDACTED:276— LoopWatchdog.check 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.
regenerate_service.validate_regenerate (cyclomatic 18) backend/services/regenerate_service.py:135— regenerate_service.validate_regenerate 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.
StripeAdminService.list_payments (cyclomatic 18) backend/services/stripe_admin_service.py:368— StripeAdminService.list_payments 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.
UserService.grant_welcome_credits_if_eligible (cyclomatic 18) backend/services/user_service.py:532— UserService.grant_welcome_credits_if_eligible 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.
karaokehunt_conversion.process_intake (cyclomatic 18) backend/workers/karaokehunt_conversion.py:159— karaokehunt_conversion.process_intake 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.
ephemeral.cleanup_orphans (cyclomatic 18) REDACTED:633— ephemeral.cleanup_orphans 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.
lrclib_client.get (cyclomatic 18) karaoke_gen/lyrics_transcriber/lyrics/lrclib_client.py:57— lrclib_client.get 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.
ASS.tidy_styles (cyclomatic 18) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1240— ASS.tidy_styles 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.
CDGGenerator.format_lyrics (cyclomatic 18) karaoke_gen/lyrics_transcriber/output/cdg.py:684— CDGGenerator.format_lyrics 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.
client.ReferralInterstitialClient (cyclomatic 18) frontend/app/[locale]/r/client.tsx:13— client.ReferralInterstitialClient has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutoProcessor.AutoProcessor (cyclomatic 18) frontend/components/AutoProcessor.tsx:22— AutoProcessor.AutoProcessor has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 26, 89). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
backend-status-banner.BackendStatusBanner (cyclomatic 18) frontend/components/backend-status-banner.tsx:49— backend-status-banner.BackendStatusBanner has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 112, 72, 94, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditTrackModal.EditTrackModal (cyclomatic 18) frontend/components/job/EditTrackModal.tsx:26— EditTrackModal.EditTrackModal has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (handleConfirm, handleOpenChange). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
KaraokeBackgroundPreview.KaraokeBackgroundPreview (cyclomatic 18) frontend/components/job/KaraokeBackgroundPreview.tsx:45— KaraokeBackgroundPreview.KaraokeBackgroundPreview has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 58, 106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
VocalsAudioDataLoader.VocalsAudioDataLoader (cyclomatic 18) frontend/components/lyrics-review/VocalsAudioDataLoader.tsx:40— VocalsAudioDataLoader.VocalsAudioDataLoader has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 73, 44, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditTimelineSection.EditTimelineSection (cyclomatic 18) frontend/components/lyrics-review/EditTimelineSection.tsx:83— EditTimelineSection.EditTimelineSection 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.
useAutoCorrect.useAutoCorrect (cyclomatic 18) frontend/hooks/useAutoCorrect.ts:73— useAutoCorrect.useAutoCorrect has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 170, 183, 362). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
admin.get_audio_edit_review_detail (cyclomatic 17) backend/api/routes/admin.py:3877— admin.get_audio_edit_review_detail has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
admin.list_user_feedback (cyclomatic 17) backend/api/routes/admin.py:4311— admin.list_user_feedback has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
jobs.complete_review (cyclomatic 17) backend/api/routes/jobs.py:1660— jobs.complete_review has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
review.search_lyrics (cyclomatic 17) REDACTED:1874— review.search_lyrics has cyclomatic complexity 17 (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.
users.get_user_detail (cyclomatic 17) backend/api/routes/users.py:2455— users.get_user_detail 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.
vocal_gaps.compute_vocal_gaps (cyclomatic 17) backend/services/auto_approval/vocal_gaps.py:235— vocal_gaps.compute_vocal_gaps 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.
frontend_ingestion.build_pattern_data (cyclomatic 17) backend/services/error_monitor/frontend_ingestion.py:187— frontend_ingestion.build_pattern_data has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
free_text.resolve_and_tidy (cyclomatic 17) backend/services/match_judge/free_text.py:259— free_text.resolve_and_tidy 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.
renderer.fetch_lrclib_lyrics (cyclomatic 17) backend/services/quick_version/renderer.py:142— renderer.fetch_lrclib_lyrics 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.
storage_retention.job_skip_reason (cyclomatic 17) backend/services/storage_retention.py:196— storage_retention.job_skip_reason has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
theme_preview_service.render_cdg_previews (cyclomatic 17) REDACTED:554— theme_preview_service.render_cdg_previews has cyclomatic complexity 17 (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.
theme_rerender_service.validate_rerender (cyclomatic 17) backend/services/theme_rerender_service.py:73— theme_rerender_service.validate_rerender has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
voice_pool_separate_worker.run_manifest (cyclomatic 17) backend/workers/voice_pool_separate_worker.py:93— voice_pool_separate_worker.run_manifest has cyclomatic complexity 17 (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.
git_repos_export.export_git_repos (cyclomatic 17) infrastructure/functions/backup_to_aws/git_repos_export.py:244— git_repos_export.export_git_repos 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.
KaraokeFinalise.choose_instrumental_audio_file (cyclomatic 17) REDACTED:714— KaraokeFinalise.choose_instrumental_audio_file has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KaraokePrep.process (cyclomatic 17) karaoke_gen/karaoke_gen.py:1126— KaraokePrep.process 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.
AnchorSequenceFinder._extend_anchors_into_single_word_gaps (cyclomatic 17) REDACTED:1089— AnchorSequenceFinder._extend_anchors_into_single_word_gaps 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.
LevenshteinHandler.handle (cyclomatic 17) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:78— LevenshteinHandler.handle 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.
CorrectionOperations.search_lyrics_sources (cyclomatic 17) REDACTED:285— CorrectionOperations.search_lyrics_sources has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GeniusProvider._extract_lyrics_from_rapidapi_response (cyclomatic 17) karaoke_gen/lyrics_transcriber/lyrics/genius.py:134— GeniusProvider._extract_lyrics_from_rapidapi_response 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.
ASS.read (cyclomatic 17) karaoke_gen/lyrics_transcriber/output/ass/ass.py:351— ASS.read 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.
VideoGenerator.detect_nvenc_support (cyclomatic 17) karaoke_gen/lyrics_transcriber/output/video.py:50— VideoGenerator.detect_nvenc_support 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.
ReviewServer.start (cyclomatic 17) REDACTED:1340— ReviewServer.start has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
renderer.render_portrait_video (cyclomatic 17) karaoke_gen/portrait/renderer.py:146— renderer.render_portrait_video has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JobMonitor.handle_instrumental_selection (cyclomatic 17) karaoke_gen/utils/remote_cli.py:1567— JobMonitor.handle_instrumental_selection 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.
VisibilityStep.VisibilityStep (cyclomatic 17) frontend/components/job/steps/VisibilityStep.tsx:15— VisibilityStep.VisibilityStep has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TranslatedLyricsOption.TranslatedLyricsOption (cyclomatic 17) frontend/components/job/TranslatedLyricsOption.tsx:27— TranslatedLyricsOption.TranslatedLyricsOption has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 59, a function literal at line 32, a function literal at line 64, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GuidedJobFlow.GuidedJobFlow (cyclomatic 17) frontend/components/job/GuidedJobFlow.tsx:98— GuidedJobFlow.GuidedJobFlow has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (GuidedJobFlow.GuidedJobFlow::handleConfirm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EditFeedbackBar.EditFeedbackBar (cyclomatic 17) frontend/components/lyrics-review/EditFeedbackBar.tsx:36— EditFeedbackBar.EditFeedbackBar has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 84, 77, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditWordList.EditWordList (cyclomatic 17) frontend/components/lyrics-review/EditWordList.tsx:214— EditWordList.EditWordList has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function items inside it that branch (handleTabNavigation, a function literal at line 357, handleReplaceAllWords, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FlyerControls.FlyerControls (cyclomatic 17) frontend/components/referrals/FlyerControls.tsx:72— FlyerControls.FlyerControls has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 12 function items inside it that branch (handleLoadPreset, handleSavePreset, handleDeletePreset, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-push-notifications.usePushNotifications (cyclomatic 17) frontend/hooks/use-push-notifications.ts:154— use-push-notifications.usePushNotifications has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 173). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
useManualSync.useManualSync.handleKeyDown (cyclomatic 17) frontend/hooks/useManualSync.ts:245— useManualSync.useManualSync.handleKeyDown 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.
backend-status.recompute (cyclomatic 17) frontend/lib/backend-status.ts:197— backend-status.recompute 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.
admin.regenerate_screens (cyclomatic 16) backend/api/routes/admin.py:2297— admin.regenerate_screens 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.
jobs.create_job (cyclomatic 16) backend/api/routes/jobs.py:83— jobs.create_job 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.
kjbox.send_code (cyclomatic 16) backend/api/routes/kjbox.py:185— kjbox.send_code 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.
tenant_admin.admin_update_tenant (cyclomatic 16) backend/api/routes/tenant_admin.py:230— tenant_admin.admin_update_tenant has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
scorer.extract_backing_signals (cyclomatic 16) backend/services/auto_approval/scorer.py:522— scorer.extract_backing_signals 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.
deterministic.phantom_parenthetical_suggestions (cyclomatic 16) backend/services/auto_correct/deterministic.py:397— deterministic.phantom_parenthetical_suggestions 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.
AutoCorrectService._check (cyclomatic 16) backend/services/auto_correct/service.py:814— AutoCorrectService._check 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.
DropboxService.upload_folder (cyclomatic 16) backend/services/dropbox_service.py:361— DropboxService.upload_folder 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.
PostmarkEmailProvider.send_email_detailed (cyclomatic 16) REDACTED:294— PostmarkEmailProvider.send_email_detailed 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.
EmailService.send_duration_confirm_reminder (cyclomatic 16) REDACTED:2050— EmailService.send_duration_confirm_reminder 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.
EncodingWorkerManager._ensure_any_running_once (cyclomatic 16) backend/services/encoding_worker_manager.py:588— EncodingWorkerManager._ensure_any_running_once 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.
main._ensure_latest_wheel_locked (cyclomatic 16) REDACTED:740— main._ensure_latest_wheel_locked 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.
ThemeService.apply_color_overrides (cyclomatic 16) backend/services/theme_service.py:240— ThemeService.apply_color_overrides 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.
youtube_backfill.classify (cyclomatic 16) backend/services/youtube_backfill.py:115— youtube_backfill.classify 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.
youtube_comment_bot.parse_classification (cyclomatic 16) backend/services/youtube_comment_bot.py:207— youtube_comment_bot.parse_classification 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.
idle-watchdog.decide (cyclomatic 16) infrastructure/encoding-worker/aws/idle-watchdog.py:34— idle-watchdog.decide 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.
RemoteFlacFetchAudioFetcher._basic_interactive_select (cyclomatic 16) karaoke_gen/audio_fetcher.py:1605— RemoteFlacFetchAudioFetcher._basic_interactive_select 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.
FileHandler.download_video (cyclomatic 16) karaoke_gen/file_handler.py:80— FileHandler.download_video 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.
KaraokeFinalise.get_next_brand_code_server_side (cyclomatic 16) REDACTED:1381— KaraokeFinalise.get_next_brand_code_server_side 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.
LyricsTranscriber._prepare_instrumental_options (cyclomatic 16) karaoke_gen/lyrics_transcriber/core/controller.py:702— LyricsTranscriber._prepare_instrumental_options 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.
ASS.shiftscale (cyclomatic 16) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1328— ASS.shiftscale 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.
ASS.__shiftscale_action_geometry_modify_tag (cyclomatic 16) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1597— ASS.__shiftscale_action_geometry_modify_tag 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.
segment_resizer.split_text_proportionally (cyclomatic 16) karaoke_gen/lyrics_transcriber/output/segment_resizer.py:109— segment_resizer.split_text_proportionally 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.
gen_cli.auto_select_instrumental (cyclomatic 16) karaoke_gen/utils/gen_cli.py:66— gen_cli.auto_select_instrumental 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.
JobMonitor.handle_audio_selection (cyclomatic 16) karaoke_gen/utils/remote_cli.py:1733— JobMonitor.handle_audio_selection 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.
VideoGenerator.calculate_text_size_to_fit (cyclomatic 16) REDACTED:153— VideoGenerator.calculate_text_size_to_fit 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.
AudioEditRestoreDialog.AudioEditRestoreDialog (cyclomatic 16) frontend/components/audio-editor/AudioEditRestoreDialog.tsx:34— AudioEditRestoreDialog.AudioEditRestoreDialog has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 128, a function literal at line 49, a function literal at line 66, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AudioSourceStep.PickCard (cyclomatic 16) frontend/components/job/steps/AudioSourceStep.tsx:702— AudioSourceStep.PickCard 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.
BackingVocalsWaveform.BackingVocalsWaveform (cyclomatic 16) frontend/components/lyrics-review/BackingVocalsWaveform.tsx:35— BackingVocalsWaveform.BackingVocalsWaveform has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 82, a function literal at line 53, handleClick, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
autocomplete-input.AutocompleteInput (cyclomatic 16) frontend/components/ui/autocomplete-input.tsx:50— autocomplete-input.AutocompleteInput has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 96, a function literal at line 73, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
audio-search-utils.getBestResult (cyclomatic 16) frontend/lib/audio-search-utils.ts:172— audio-search-utils.getBestResult has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
job-status.getParallelProcessingLabel (cyclomatic 16) frontend/lib/job-status.ts:300— job-status.getParallelProcessingLabel 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.
sanitizeWordTimings.sanitizeSegmentTimings (cyclomatic 16) frontend/lib/lyrics-review/sanitizeWordTimings.ts:36— sanitizeWordTimings.sanitizeSegmentTimings has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 55). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D11 · Test Reliability· Test reliability not measured · ×1
Test reliability not measured — JavaScript/TypeScript suite install refused the lockfile — Test reliability NOT MEASURED: the JavaScript/TypeScript suite's dependency install refused the committed lockfile, so no test ever ran and flakiness could not be exercised — the dependency install for frontend/ refused the committed lockfile (ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json), so the suite never ran. It is excluded from the score rather than counted as a defect; a lockfile in sync with REDACTED is what lets the suite be re-run.
FixmeComment karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1076— # FIXME This happens when the instrumental is — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
page.AdminJobsPageContent (cognitive 352) REDACTED:139— page.AdminJobsPageContent has cognitive complexity 352 (threshold 15). Drivers by points: boolean chains 137, ternaries 54 (124 pts), if/else 64 (71 pts), error handling 13 (14 pts), loops 5, match/switch 1 (nesting depth added 78). Of this number, 159 points are the body's own statements and 193 belong to 47 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsAnalyzer.LyricsAnalyzer (cognitive 302) frontend/components/lyrics-review/LyricsAnalyzer.tsx:144— LyricsAnalyzer.LyricsAnalyzer has cognitive complexity 302 (threshold 15). Drivers by points: if/else 91 (118 pts), boolean chains 83, ternaries 48 (75 pts), loops 10 (15 pts), error handling 7 (11 pts) (nesting depth added 63). Of this number, 75 points are the body's own statements and 227 belong to 74 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsCorrector._process_corrections (cognitive 301) karaoke_gen/lyrics_transcriber/correction/corrector.py:270— LyricsCorrector._process_corrections has cognitive complexity 301 (threshold 15). Drivers by points: if/else 44 (158 pts), loops 30 (92 pts), ternaries 9 (40 pts), boolean chains 9, error handling 1 (2 pts) (nesting depth added 208). 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.
gen_cli.async_main (cognitive 263) karaoke_gen/utils/gen_cli.py:357— gen_cli.async_main has cognitive complexity 263 (threshold 15). Drivers by points: if/else 78 (163 pts), error handling 26 (68 pts), boolean chains 16, loops 3 (8 pts), ternaries 4 (8 pts) (nesting depth added 136). 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.
remote_cli.main (cognitive 232) karaoke_gen/utils/remote_cli.py:2491— remote_cli.main has cognitive complexity 232 (threshold 15). Drivers by points: if/else 95 (144 pts), error handling 23 (45 pts), boolean chains 25, ternaries 2 (12 pts), loops 3 (6 pts) (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokePrep.prep_single_track (cognitive 199) karaoke_gen/karaoke_gen.py:363— KaraokePrep.prep_single_track has cognitive complexity 199 (threshold 15). Drivers by points: if/else 65 (125 pts), boolean chains 25, error handling 9 (23 pts), ternaries 6 (17 pts), loops 4 (9 pts) (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsSynchronizer.LyricsSynchronizer (cognitive 178) frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:55— LyricsSynchronizer.LyricsSynchronizer has cognitive complexity 178 (threshold 15). Drivers by points: if/else 76 (107 pts), boolean chains 36, ternaries 10 (21 pts), loops 10 (14 pts) (nesting depth added 46). Most of this is not in the body itself: 7 of the 178 points are its own statements and the rest belongs to 40 function literals inside it that branch (lines 559, 677, 285, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stale_review_processor.process_stale_reviews_sync (cognitive 151) backend/workers/stale_review_processor.py:51— stale_review_processor.process_stale_reviews_sync has cognitive complexity 151 (threshold 15). Drivers by points: if/else 26 (78 pts), error handling 14 (58 pts), boolean chains 9, ternaries 1 (4 pts), loops 2 (nesting depth added 99). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TenantThemeEditorDialog.TenantThemeEditorDialog (cognitive 144) frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94— TenantThemeEditorDialog.TenantThemeEditorDialog has cognitive complexity 144 (threshold 15). Drivers by points: boolean chains 76, ternaries 23 (38 pts), if/else 21 (23 pts), error handling 6 (7 pts) (nesting depth added 18). Of this number, 47 points are the body's own statements and 97 belong to 35 function items inside it that branch. 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.
AudioEditor.AudioEditor (cognitive 134) frontend/components/audio-editor/AudioEditor.tsx:341— AudioEditor.AudioEditor has cognitive complexity 134 (threshold 15). Drivers by points: boolean chains 49, if/else 42 (45 pts), ternaries 23 (32 pts), error handling 7, loops 1 (nesting depth added 12). Of this number, 52 points are the body's own statements and 82 belong to 28 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InstrumentalSelector.InstrumentalSelector (cognitive 131) frontend/components/instrumental-review/InstrumentalSelector.tsx:56— InstrumentalSelector.InstrumentalSelector has cognitive complexity 131 (threshold 15). Drivers by points: if/else 45 (48 pts), boolean chains 37, ternaries 23 (37 pts), error handling 5, match/switch 2 (4 pts) (nesting depth added 19). Of this number, 28 points are the body's own statements and 103 belong to 26 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
page.AdminUserDetailPage (cognitive 128) REDACTED:76— page.AdminUserDetailPage has cognitive complexity 128 (threshold 15). Drivers by points: ternaries 36 (64 pts), boolean chains 39, if/else 17, error handling 8 (nesting depth added 28). Of this number, 53 points are the body's own statements and 75 belong to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render_video_worker.process_render_video (cognitive 125) backend/workers/render_video_worker.py:93— render_video_worker.process_render_video has cognitive complexity 125 (threshold 15). Drivers by points: if/else 44 (79 pts), ternaries 11 (25 pts), boolean chains 10, error handling 6 (9 pts), loops 1 (2 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeComposer._compose_lyric (cognitive 121) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:935— KaraokeComposer._compose_lyric has cognitive complexity 121 (threshold 15). Drivers by points: if/else 47 (106 pts), loops 6 (10 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 64). 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.
TimelineCanvas.TimelineCanvas (cognitive 119) frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:107— TimelineCanvas.TimelineCanvas has cognitive complexity 119 (threshold 15). Drivers by points: if/else 50 (77 pts), boolean chains 21, loops 10 (14 pts), ternaries 4 (7 pts) (nesting depth added 34). None of this is in the body itself: all 119 points belong to 15 function literals inside it that branch (lines 283, 600, 536, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
internal._recover_stuck_jobs_sync (cognitive 118) backend/api/routes/internal.py:1185— internal._recover_stuck_jobs_sync has cognitive complexity 118 (threshold 15). Drivers by points: if/else 35 (76 pts), boolean chains 17, error handling 5 (12 pts), loops 8, ternaries 2 (5 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewVideoSection.PreviewVideoSection (cognitive 115) frontend/components/lyrics-review/PreviewVideoSection.tsx:85— PreviewVideoSection.PreviewVideoSection has cognitive complexity 115 (threshold 15). Drivers by points: if/else 56 (72 pts), boolean chains 33, ternaries 4 (5 pts), error handling 3 (4 pts), loops 1 (nesting depth added 18). Most of this is not in the body itself: 15 of the 115 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 466, 210, 240, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
JobMonitor.download_outputs (cognitive 114) karaoke_gen/utils/remote_cli.py:1947— JobMonitor.download_outputs has cognitive complexity 114 (threshold 15). Drivers by points: if/else 43 (91 pts), loops 7 (13 pts), error handling 2 (6 pts), boolean chains 4 (nesting depth added 58). 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.
ErrorMonitor._run_monitor_cycle (cognitive 112) backend/services/error_monitor/monitor.py:417— ErrorMonitor._run_monitor_cycle has cognitive complexity 112 (threshold 15). Drivers by points: if/else 25 (65 pts), loops 12 (26 pts), boolean chains 12, error handling 3 (9 pts) (nesting depth added 60). 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.
AudioSearchDialog.AudioSearchDialog (cognitive 110) frontend/components/audio-search/AudioSearchDialog.tsx:34— AudioSearchDialog.AudioSearchDialog has cognitive complexity 110 (threshold 15). Drivers by points: ternaries 19 (51 pts), boolean chains 40, if/else 13 (14 pts), error handling 5 (nesting depth added 33). Of this number, 20 points are the body's own statements and 90 belong to 17 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
file_upload.upload_and_create_job (cognitive 105) backend/api/routes/file_upload.py:487— file_upload.upload_and_create_job has cognitive complexity 105 (threshold 15). Drivers by points: if/else 58 (73 pts), boolean chains 18, error handling 6 (9 pts), ternaries 3, loops 2 (nesting depth added 18). 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.
page.AdminTenantsPage (cognitive 103) frontend/app/admin/tenants/page.tsx:126— page.AdminTenantsPage has cognitive complexity 103 (threshold 15). Drivers by points: boolean chains 33, ternaries 19 (33 pts), if/else 25 (26 pts), error handling 9, loops 2 (nesting depth added 15). Of this number, 30 points are the body's own statements and 73 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioProcessor.process_audio_separation (cognitive 89) karaoke_gen/audio_processor.py:256— AudioProcessor.process_audio_separation has cognitive complexity 89 (threshold 15). Drivers by points: if/else 25 (52 pts), error handling 5 (13 pts), ternaries 3 (11 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
admin.restart_job (cognitive 88) backend/api/routes/admin.py:2593— admin.restart_job has cognitive complexity 88 (threshold 15). Drivers by points: if/else 24 (53 pts), error handling 6 (17 pts), loops 5 (11 pts), boolean chains 6, ternaries 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASS.write_srt (cognitive 84) karaoke_gen/lyrics_transcriber/output/ass/ass.py:504— ASS.write_srt has cognitive complexity 84 (threshold 15). Drivers by points: if/else 21 (55 pts), loops 12 (26 pts), boolean chains 3 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SoundAlikeHandler._codes_match (cognitive 79) karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:163— SoundAlikeHandler._codes_match has cognitive complexity 79 (threshold 15). Drivers by points: if/else 17 (55 pts), loops 6 (18 pts), boolean chains 6 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscriptionView.TranscriptionView (cognitive 77) frontend/components/lyrics-review/TranscriptionView.tsx:36— TranscriptionView.TranscriptionView has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 17 (30 pts), if/else 8 (23 pts), boolean chains 19, loops 4 (5 pts) (nesting depth added 29). Most of this is not in the body itself: 5 of the 77 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 131, a function literal at line 283, a function literal at line 284, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tenant_theme_service.sanitize_style_params (cognitive 75) backend/services/tenant_theme_service.py:165— tenant_theme_service.sanitize_style_params has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 14 (17 pts), boolean chains 15 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.AppPageContent (cognitive 75) frontend/app/[locale]/app/page.tsx:50— page.AppPageContent has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 20 (26 pts), boolean chains 25, if/else 20 (23 pts), error handling 1 (nesting depth added 9). Of this number, 39 points are the body's own statements and 36 belong to 16 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OutputLinks.OutputLinks (cognitive 75) frontend/components/job/OutputLinks.tsx:41— OutputLinks.OutputLinks has cognitive complexity 75 (threshold 15). Drivers by points: boolean chains 41, ternaries 11 (16 pts), if/else 11, error handling 7 (nesting depth added 5). Of this number, 47 points are the body's own statements and 28 belong to 10 function literals inside it that branch. 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.
RemoteKaraokeClient.submit_finalise_only_job (cognitive 74) karaoke_gen/utils/remote_cli.py:676— RemoteKaraokeClient.submit_finalise_only_job has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (53 pts), loops 9 (11 pts), boolean chains 6, error handling 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EncodingService.wait_for_completion (cognitive 73) backend/services/encoding_service.py:769— EncodingService.wait_for_completion has cognitive complexity 73 (threshold 15). Drivers by points: if/else 18 (45 pts), error handling 4 (16 pts), boolean chains 8, ternaries 1 (3 pts), loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
users.stripe_webhook (cognitive 72) backend/api/routes/users.py:1703— users.stripe_webhook has cognitive complexity 72 (threshold 15). Drivers by points: if/else 18 (41 pts), error handling 6 (15 pts), boolean chains 10, ternaries 2 (6 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.
client.RequestsBoardClient (cognitive 72) frontend/app/[locale]/requests/client.tsx:62— client.RequestsBoardClient has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 23, ternaries 11 (16 pts), error handling 5 (6 pts), match/switch 1 (nesting depth added 8). Of this number, 28 points are the body's own statements and 44 belong to 17 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BulkAlbumMode.BulkAlbumMode (cognitive 71) frontend/components/job/bulk/BulkAlbumMode.tsx:208— BulkAlbumMode.BulkAlbumMode has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 33, if/else 18 (22 pts), ternaries 9 (12 pts), error handling 4 (nesting depth added 7). Of this number, 28 points are the body's own statements and 43 belong to 14 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ASS.tidy (cognitive 70) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1135— ASS.tidy has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (47 pts), loops 9 (22 pts), boolean chains 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
page.ReferralsPage (cognitive 69) frontend/app/admin/referrals/page.tsx:37— page.ReferralsPage has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 14 (33 pts), boolean chains 26, error handling 7, if/else 3 (nesting depth added 19). Most of this is not in the body itself: 14 of the 69 points are its own statements and the rest belongs to 13 function items inside it that branch (handleEdit, handleCreate, a function literal at line 503, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AnchorSequenceFinder._find_anchors_impl (cognitive 67) REDACTED:396— AnchorSequenceFinder._find_anchors_impl has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 6 (14 pts), loops 5 (11 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditModal.EditModal (cognitive 67) frontend/components/lyrics-review/modals/EditModal.tsx:45— EditModal.EditModal has cognitive complexity 67 (threshold 15). Drivers by points: if/else 33 (35 pts), boolean chains 22, ternaries 7 (10 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 48 belong to 20 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
admin._compute_admin_stats_overview (cognitive 66) backend/api/routes/admin.py:191— admin._compute_admin_stats_overview has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 4 (10 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
translate.translate_locale (cognitive 66) frontend/scripts/translate.py:343— translate.translate_locale has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 6 (18 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.AdminUsersPage (cognitive 66) REDACTED:79— page.AdminUsersPage has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 19 (30 pts), boolean chains 22, if/else 9 (10 pts), error handling 4 (nesting depth added 12). Of this number, 21 points are the body's own statements and 45 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
user-emails-card.UserEmailsCard (cognitive 66) frontend/components/admin/user-emails-card.tsx:51— user-emails-card.UserEmailsCard has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 13 (36 pts), boolean chains 23, if/else 2 (5 pts), error handling 2 (nesting depth added 26). Of this number, 36 points are the body's own statements and 30 belong to 5 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AudioSourceStep.AudioSourceStep (cognitive 66) frontend/components/job/steps/AudioSourceStep.tsx:135— AudioSourceStep.AudioSourceStep has cognitive complexity 66 (threshold 15). Drivers by points: if/else 30 (34 pts), boolean chains 26, error handling 3 (4 pts), ternaries 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 47 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JobSubmission.JobSubmission (cognitive 66) frontend/components/job/JobSubmission.tsx:24— JobSubmission.JobSubmission has cognitive complexity 66 (threshold 15). Drivers by points: boolean chains 33, if/else 23 (26 pts), error handling 5, ternaries 2 (nesting depth added 3). Of this number, 20 points are the body's own statements and 46 belong to 13 function items inside it that branch. 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.
jobs._run_distribution_cleanup (cognitive 65) backend/api/routes/jobs.py:2601— jobs._run_distribution_cleanup has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (38 pts), ternaries 3 (11 pts), boolean chains 8, error handling 4 (8 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
audio_search.search_audio (cognitive 64) backend/api/routes/audio_search.py:685— audio_search.search_audio has cognitive complexity 64 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 9, ternaries 6 (7 pts), error handling 5 (6 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomizeStep.CustomizeStep (cognitive 64) frontend/components/job/steps/CustomizeStep.tsx:295— CustomizeStep.CustomizeStep has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 46, if/else 9, ternaries 8 (9 pts) (nesting depth added 1). Of this number, 50 points are the body's own statements and 14 belong to 10 function items inside it that branch. 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.
SoundAlikeHandler.handle (cognitive 63) karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:78— SoundAlikeHandler.handle has cognitive complexity 63 (threshold 15). Drivers by points: if/else 13 (48 pts), loops 4 (8 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_import_list.main (cognitive 61) infrastructure/cloudflare/scripts/build_import_list.py:69— build_import_list.main has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 16 (23 pts), boolean chains 4 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Word.WordComponent (cognitive 60) frontend/components/lyrics-review/shared/Word.tsx:11— Word.WordComponent has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 16 (43 pts), boolean chains 11, if/else 5 (6 pts) (nesting depth added 28). 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.
song_request_service._cast_vote_txn (cognitive 58) backend/services/song_request_service.py:653— song_request_service._cast_vote_txn has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 8, loops 3 (7 pts), ternaries 4 (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.
RemoteKaraokeClient.submit_job (cognitive 58) karaoke_gen/utils/remote_cli.py:404— RemoteKaraokeClient.submit_job has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (39 pts), ternaries 2 (8 pts), error handling 2 (4 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video_worker.generate_video_legacy (cognitive 57) backend/workers/video_worker.py:914— video_worker.generate_video_legacy has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (30 pts), ternaries 6 (11 pts), error handling 5 (9 pts), boolean chains 6, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jobs.retry_job (cognitive 56) backend/api/routes/jobs.py:2094— jobs.retry_job has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 21, error handling 5 (8 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.
review._reconstruct_post_ai_segments (cognitive 55) REDACTED:679— review._reconstruct_post_ai_segments has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 4 (13 pts), boolean chains 9, error handling 1 (2 pts), loops 2 (nesting depth added 28). 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.
page.AdminRateLimitsPage (cognitive 55) frontend/app/admin/rate-limits/page.tsx:43— page.AdminRateLimitsPage has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 26, error handling 13, ternaries 9, if/else 7. Of this number, 22 points are the body's own statements and 33 belong to 19 function items inside it that branch. 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.
resumable-upload.uploadResumable (cognitive 55) frontend/lib/resumable-upload.ts:249— resumable-upload.uploadResumable has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 9, ternaries 3 (6 pts), error handling 2 (5 pts), loops 1 (nesting depth added 25). Of this number, 47 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageRetentionService.run (cognitive 54) backend/services/storage_retention.py:530— StorageRetentionService.run has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 13, error handling 4 (8 pts), ternaries 7 (8 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lyrics_worker.process_lyrics_transcription (cognitive 52) backend/workers/lyrics_worker.py:196— lyrics_worker.process_lyrics_transcription has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (25 pts), error handling 10 (16 pts), boolean chains 8, ternaries 2, loops 1 (nesting depth added 7). 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.
executor.maybe_auto_complete_review (cognitive 51) REDACTED:87— executor.maybe_auto_complete_review has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 14, ternaries 5 (6 pts), error handling 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.execute_command_with_fallback (cognitive 51) REDACTED:1823— KaraokeFinalise.execute_command_with_fallback has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (38 pts), error handling 5 (10 pts), boolean chains 3 (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.
video_worker.generate_video_orchestrated (cognitive 50) backend/workers/video_worker.py:230— video_worker.generate_video_orchestrated has cognitive complexity 50 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 10, error handling 5 (7 pts), ternaries 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
api.apiFetch (cognitive 49) frontend/lib/api.ts:635— api.apiFetch has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (31 pts), ternaries 5 (10 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 23). Of this number, 47 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
youtube_comment_bot_worker.run_comment_bot_sync (cognitive 48) backend/workers/youtube_comment_bot_worker.py:116— youtube_comment_bot_worker.run_comment_bot_sync has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7, ternaries 5 (7 pts), error handling 4 (6 pts), loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gen_cli.run_combined_review (cognitive 48) karaoke_gen/utils/gen_cli.py:149— gen_cli.run_combined_review has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (29 pts), error handling 5 (6 pts), ternaries 3 (6 pts), boolean chains 5, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_upload.create_job_from_url (cognitive 47) backend/api/routes/file_upload.py:2002— file_upload.create_job_from_url has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 8, error handling 4, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audio_worker.process_audio_separation (cognitive 47) backend/workers/audio_worker.py:139— audio_worker.process_audio_separation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (27 pts), error handling 7 (9 pts), ternaries 5, boolean chains 4, loops 2 (nesting depth added 8). 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.
KaraokeComposer.__init__ (cognitive 47) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:203— KaraokeComposer.__init__ has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 8 (16 pts), boolean chains 2, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobMonitor.monitor (cognitive 47) karaoke_gen/utils/remote_cli.py:2308— JobMonitor.monitor has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (38 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.ConsumerLandingPage (cognitive 46) frontend/app/[locale]/page.tsx:44— page.ConsumerLandingPage has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 19, ternaries 12 (14 pts), if/else 10, error handling 3 (nesting depth added 2). Of this number, 21 points are the body's own statements and 25 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SessionRestoreDialog.SessionRestoreDialog (cognitive 46) frontend/components/lyrics-review/SessionRestoreDialog.tsx:94— SessionRestoreDialog.SessionRestoreDialog has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 14, if/else 12 (14 pts), error handling 3 (nesting depth added 9). Of this number, 20 points are the body's own statements and 26 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jobs.edit_completed_track (cognitive 45) backend/api/routes/jobs.py:298— jobs.edit_completed_track has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 10, error handling 4 (6 pts), ternaries 4 (5 pts), loops 3 (4 pts) (nesting depth added 7). 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.
jobs.list_jobs (cognitive 45) backend/api/routes/jobs.py:667— jobs.list_jobs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 13, error handling 4 (6 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tenant_admin_service.create_tenant (cognitive 45) backend/services/tenant_admin_service.py:272— tenant_admin_service.create_tenant has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 11, error handling 8 (11 pts), loops 1 (nesting depth added 8). 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.
AudioProcessor._process_audio_separation_remote (cognitive 45) karaoke_gen/audio_processor.py:507— AudioProcessor._process_audio_separation_remote has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_upload.create_job_with_upload_urls (cognitive 44) backend/api/routes/file_upload.py:1273— file_upload.create_job_with_upload_urls has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 8, error handling 3, ternaries 3, loops 1 (nesting depth added 7). 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.
lyrics_worker.upload_lyrics_results (cognitive 44) backend/workers/lyrics_worker.py:755— lyrics_worker.upload_lyrics_results has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 4 (9 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.execute_optional_features (cognitive 44) REDACTED:1523— KaraokeFinalise.execute_optional_features has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASS.loop (cognitive 44) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1755— ASS.loop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
theme_preview_service.resolve_assets (cognitive 43) REDACTED:204— theme_preview_service.resolve_assets has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 6, loops 3 (5 pts), error handling 1 (3 pts), ternaries 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
VisibilityChangeService._delete_distributed_outputs (cognitive 43) backend/services/visibility_change_service.py:436— VisibilityChangeService._delete_distributed_outputs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 5 (10 pts), ternaries 3 (9 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video_worker._handle_native_distribution (cognitive 43) backend/workers/video_worker.py:1343— video_worker._handle_native_distribution has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 6 (13 pts), boolean chains 6, ternaries 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.
timing_sanitizer.sanitize_corrections (cognitive 42) backend/services/timing_sanitizer.py:61— timing_sanitizer.sanitize_corrections has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 4, ternaries 1 (4 pts), loops 2 (3 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.
ASS.tidy_styles (cognitive 42) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1240— ASS.tidy_styles has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 7 (18 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.
RemoteKaraokeClient.search_audio (cognitive 42) karaoke_gen/utils/remote_cli.py:1190— RemoteKaraokeClient.search_audio has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (29 pts), error handling 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). 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.
ReferralDashboard.ReferralDashboard (cognitive 42) frontend/components/referrals/ReferralDashboard.tsx:26— ReferralDashboard.ReferralDashboard has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 14, error handling 6, if/else 6 (nesting depth added 6). Of this number, 25 points are the body's own statements and 17 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageRetentionService.purge_orphans (cognitive 41) backend/services/storage_retention.py:884— StorageRetentionService.purge_orphans has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (8 pts), error handling 3 (7 pts), boolean chains 6, loops 3 (6 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.
JobMonitor.handle_audio_selection (cognitive 41) karaoke_gen/utils/remote_cli.py:1733— JobMonitor.handle_audio_selection has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (31 pts), error handling 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.update_job (cognitive 40) backend/api/routes/admin.py:933— admin.update_job has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 10, error handling 3 (7 pts), ternaries 2 (3 pts) (nesting depth added 9). 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.
file_upload.mark_uploads_complete (cognitive 40) backend/api/routes/file_upload.py:1557— file_upload.mark_uploads_complete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (27 pts), error handling 5 (8 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_upload.create_finalise_only_job (cognitive 40) backend/api/routes/file_upload.py:2345— file_upload.create_finalise_only_job has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 7, error handling 3, loops 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.run_encoding (cognitive 40) REDACTED:1079— main.run_encoding has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 8, ternaries 6 (8 pts), error handling 3 (5 pts), loops 1 (nesting depth added 8). 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.
timing_sanitizer._fill_segment_bounds (cognitive 40) backend/services/timing_sanitizer.py:26— timing_sanitizer._fill_segment_bounds has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 4 (8 pts), boolean chains 7, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audio_worker.upload_separation_results (cognitive 40) backend/workers/audio_worker.py:595— audio_worker.upload_separation_results has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 7, loops 3 (6 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.
LevenshteinHandler.handle (cognitive 40) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:78— LevenshteinHandler.handle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.validate_files (cognitive 38) infrastructure/functions/gdrive_validator/main.py:238— main.validate_files has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (10 pts), boolean chains 3, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.AudioEditsPage (cognitive 38) frontend/app/admin/audio-edits/page.tsx:211— page.AudioEditsPage has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (24 pts), boolean chains 8, if/else 4, error handling 2 (nesting depth added 12). Of this number, 16 points are the body's own statements and 22 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.AdminSearchesPage (cognitive 38) frontend/app/admin/searches/page.tsx:60— page.AdminSearchesPage has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 13, ternaries 8 (13 pts), if/else 7, error handling 4, match/switch 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 38 points are its own statements and the rest belongs to 9 function items inside it that branch (getStatusVariant, a function literal at line 303, a function literal at line 80, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
jobs._create_job_from_search_sync (cognitive 37) backend/api/routes/jobs.py:2873— jobs._create_job_from_search_sync has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 9, error handling 5 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
users._handle_made_for_you_order (cognitive 37) backend/api/routes/users.py:1335— users._handle_made_for_you_order has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 8 (13 pts), ternaries 5, boolean chains 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AuthService.validate_token_full (cognitive 37) backend/services/auth_service.py:248— AuthService.validate_token_full has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 3 (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.
LocalEncodingService.encode_all_formats (cognitive 37) REDACTED:497— LocalEncodingService.encode_all_formats has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 6, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeComposer.create_ass (cognitive 37) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1935— KaraokeComposer.create_ass has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 6 (14 pts), boolean chains 1 (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.
EncodingService._request_with_retry (cognitive 36) backend/services/encoding_service.py:518— EncodingService._request_with_retry has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 4 (12 pts), error handling 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
translate.async_main (cognitive 36) frontend/scripts/translate.py:551— translate.async_main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CDGGenerator.format_lyrics (cognitive 36) karaoke_gen/lyrics_transcriber/output/cdg.py:684— CDGGenerator.format_lyrics has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), ternaries 3 (7 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
page.EditReviewsPage (cognitive 36) frontend/app/admin/edit-reviews/page.tsx:353— page.EditReviewsPage has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 5, if/else 4, error handling 2 (nesting depth added 10). Of this number, 22 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.cleanup_orphaned_outputs (cognitive 35) backend/api/routes/admin.py:1890— admin.cleanup_orphaned_outputs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 3 (9 pts), error handling 4 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.run_render_video (cognitive 35) REDACTED:443— main.run_render_video has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, error handling 3 (4 pts), ternaries 3, 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.
PackagingService.create_cdg_package (cognitive 35) backend/services/packaging_service.py:51— PackagingService.create_cdg_package has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 7, ternaries 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.
VisibilityChangeService._delete_public_outputs (cognitive 35) backend/services/visibility_change_service.py:339— VisibilityChangeService._delete_public_outputs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 5 (10 pts), ternaries 3 (9 pts), boolean chains 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.
VideoWorkerOrchestrator._run_encoding (cognitive 35) backend/workers/video_worker_orchestrator.py:505— VideoWorkerOrchestrator._run_encoding has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 16). 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.
ASS.parse_tags (cognitive 35) karaoke_gen/lyrics_transcriber/output/ass/ass.py:957— ASS.parse_tags has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (10 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobMonitor.handle_instrumental_selection (cognitive 35) karaoke_gen/utils/remote_cli.py:1567— JobMonitor.handle_instrumental_selection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (21 pts), error handling 4 (9 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobCard.JobCard (cognitive 35) frontend/components/job/JobCard.tsx:104— JobCard.JobCard has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 20, ternaries 6 (9 pts), if/else 6 (nesting depth added 3). Of this number, 20 points are the body's own statements and 15 belong to one function item inside it that branches. 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.
service._assign_conflict_groups (cognitive 34) backend/services/auto_correct/service.py:140— service._assign_conflict_groups has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 10 (14 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
storage_retention.classify_file (cognitive 34) backend/services/storage_retention.py:97— storage_retention.classify_file has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 4 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASS.read (cognitive 34) karaoke_gen/lyrics_transcriber/output/ass/ass.py:351— ASS.read has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
client.JobRouterClient (cognitive 34) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:48— client.JobRouterClient has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 8, ternaries 5 (6 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 94, 51, 56, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WaveformViewer.WaveformViewer (cognitive 34) frontend/components/instrumental-review/WaveformViewer.tsx:54— WaveformViewer.WaveformViewer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19, boolean chains 10, loops 2 (4 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 73, handleMouseDown, handleMouseUp, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CustomLyricsMode.CustomLyricsMode (cognitive 34) frontend/components/lyrics-review/modals/CustomLyricsMode.tsx:49— CustomLyricsMode.CustomLyricsMode has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 20, if/else 8 (9 pts), ternaries 3 (4 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 142, 119, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ReviewChangesModal.ReviewChangesModal (cognitive 34) frontend/components/lyrics-review/modals/ReviewChangesModal.tsx:76— ReviewChangesModal.ReviewChangesModal has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 27, if/else 4, ternaries 2 (3 pts) (nesting depth added 1). Of this number, 22 points are the body's own statements and 12 belong to 6 function items inside it that branch. 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.
push-settings.PushSettings (cognitive 34) frontend/components/push-settings.tsx:14— push-settings.PushSettings has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 8, boolean chains 7, error handling 3 (nesting depth added 7). Of this number, 21 points are the body's own statements and 13 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audio_search._download_audio_and_trigger_workers (cognitive 33) backend/api/routes/audio_search.py:424— audio_search._download_audio_and_trigger_workers has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 4 (6 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
review.get_correction_data (cognitive 33) REDACTED:811— review.get_correction_data has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, error handling 4 (6 pts), 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.
audio_download_worker.process_audio_download (cognitive 33) backend/workers/audio_download_worker.py:208— audio_download_worker.process_audio_download has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 8, error handling 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
screens_worker.generate_screens (cognitive 33) backend/workers/screens_worker.py:71— screens_worker.generate_screens has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (24 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
video_worker.redistribute_video (cognitive 33) backend/workers/video_worker.py:690— video_worker.redistribute_video has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 4 (8 pts), loops 3, boolean chains 2, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.format_notification (cognitive 33) infrastructure/functions/gdrive_validator/main.py:378— main.format_notification has cognitive complexity 33 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 8 (15 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LyricsCorrector._apply_corrections_to_segments (cognitive 33) karaoke_gen/lyrics_transcriber/correction/corrector.py:795— LyricsCorrector._apply_corrections_to_segments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (9 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.
OutputGenerator.__init__ (cognitive 33) karaoke_gen/lyrics_transcriber/output/generator.py:37— OutputGenerator.__init__ has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 14). 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.
keyboardHandlers.setupKeyboardHandlers.handleKeyDown (cognitive 33) frontend/lib/lyrics-review/utils/keyboardHandlers.ts:63— keyboardHandlers.setupKeyboardHandlers.handleKeyDown has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 11 (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.
AuthService.validate_token (cognitive 32) backend/services/auth_service.py:150— AuthService.validate_token has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 2 (4 pts), boolean chains 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.
scorer._extract_gating_signals (cognitive 32) backend/services/auto_approval/scorer.py:156— scorer._extract_gating_signals has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
job_health_service.check_job_consistency (cognitive 32) backend/services/job_health_service.py:67— job_health_service.check_job_consistency has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 8, error handling 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.
StripeAdminService.store_payment (cognitive 32) backend/services/stripe_admin_service.py:60— StripeAdminService.store_payment has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (8 pts), ternaries 4 (7 pts), error handling 2 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KaraokeFinalise.validate_input_parameters_for_features (cognitive 32) REDACTED:256— KaraokeFinalise.validate_input_parameters_for_features has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsProcessor.transcribe_lyrics (cognitive 32) karaoke_gen/lyrics_processor.py:256— LyricsProcessor.transcribe_lyrics has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 4, loops 2 (3 pts), ternaries 3 (nesting depth added 7). 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.
LyricsTranscriber.process (cognitive 32) karaoke_gen/lyrics_transcriber/core/controller.py:295— LyricsTranscriber.process has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 7). 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.
lrclib_client.get (cognitive 32) karaoke_gen/lyrics_transcriber/lyrics/lrclib_client.py:57— lrclib_client.get has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.DeleteAccountClient (cognitive 32) frontend/app/[locale]/account/delete/client.tsx:46— client.DeleteAccountClient has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (11 pts), ternaries 3 (4 pts), error handling 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 13 belong to 3 function literals inside it that branch. 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.
version-footer.VersionFooter (cognitive 32) frontend/components/version-footer.tsx:7— version-footer.VersionFooter has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10, boolean chains 9, ternaries 9, error handling 4. Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (renderEncodingWorkerStatus, renderFlacfetchStatus, renderAudioSeparatorStatus, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
audio_search.select_audio_source (cognitive 31) backend/api/routes/audio_search.py:1537— audio_search.select_audio_source has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 4 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
review.generate_preview_video (cognitive 31) REDACTED:2021— review.generate_preview_video has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 4 (6 pts), loops 2 (5 pts), boolean chains 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.
lyrics_diff.compute_lyrics_diff (cognitive 31) backend/services/auto_approval/lyrics_diff.py:133— lyrics_diff.compute_lyrics_diff has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (13 pts), loops 4 (5 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.
deterministic.leading_connective_suggestions (cognitive 31) backend/services/auto_correct/deterministic.py:199— deterministic.leading_connective_suggestions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 12, loops 3 (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.
deterministic.reference_majority_suggestions (cognitive 31) backend/services/auto_correct/deterministic.py:289— deterministic.reference_majority_suggestions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conversion_emails.process_conversion_emails (cognitive 31) backend/services/conversion_emails.py:110— conversion_emails.process_conversion_emails has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (9 pts), error handling 2 (4 pts), loops 2 (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.
GCEEncodingBackend.encode (cognitive 31) backend/services/encoding_interface.py:421— GCEEncodingBackend.encode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts), error handling 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.
analyze._llm_analyze (cognitive 31) backend/services/tenant_bulk/analyze.py:367— analyze._llm_analyze has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 9, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserService.find_account_correlations (cognitive 31) backend/services/user_service.py:872— UserService.find_account_correlations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 9 (10 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtendAnchorHandler.handle (cognitive 31) karaoke_gen/lyrics_transcriber/correction/handlers/extend_anchor.py:85— ExtendAnchorHandler.handle has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (5 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
metadata.parse_track_metadata (cognitive 31) karaoke_gen/metadata.py:58— metadata.parse_track_metadata has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 5, error handling 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.
GuidedJobFlow.GuidedJobFlow::handleConfirm (cognitive 31) frontend/components/job/GuidedJobFlow.tsx:177— GuidedJobFlow.GuidedJobFlow::handleConfirm has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (13 pts), ternaries 1 (4 pts), error handling 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.
admin.reset_job (cognitive 30) backend/api/routes/admin.py:1233— admin.reset_job has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6, loops 2 (3 pts), error handling 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.
users.resend_magic_link_from_token (cognitive 30) backend/api/routes/users.py:779— users.resend_magic_link_from_token has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
apply.apply_suggestion (cognitive 30) backend/services/auto_approval/apply.py:103— apply.apply_suggestion has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 4 (5 pts), boolean chains 4, 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.
UserService.grant_welcome_credits_if_eligible (cognitive 30) backend/services/user_service.py:532— UserService.grant_welcome_credits_if_eligible has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
voice_pool_separate_worker.run_manifest (cognitive 30) backend/workers/voice_pool_separate_worker.py:93— voice_pool_separate_worker.run_manifest has cognitive complexity 30 (threshold 15). Drivers by points: error handling 6 (14 pts), if/else 5 (9 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioProcessor._organize_stage1_remote_results (cognitive 30) karaoke_gen/audio_processor.py:676— AudioProcessor._organize_stage1_remote_results has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 pts), boolean chains 3 (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.
KaraokeComposer._compose_instrumental (cognitive 30) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1299— KaraokeComposer._compose_instrumental has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (7 pts), boolean chains 4, match/switch 3 (4 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoGenerator.calculate_text_size_to_fit (cognitive 30) REDACTED:153— VideoGenerator.calculate_text_size_to_fit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 4 (10 pts), boolean chains 6, loops 2 (4 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.
client.LyricsReviewWrapper (cognitive 30) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:342— client.LyricsReviewWrapper has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, ternaries 6 (9 pts), if/else 4, error handling 1 (nesting depth added 3). Of this number, 23 points are the body's own statements and 7 belong to 2 function literals inside it that branch. 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.
InstrumentalSelectorEmbedded.InstrumentalSelectorEmbedded (cognitive 30) frontend/components/instrumental-review/InstrumentalSelectorEmbedded.tsx:45— InstrumentalSelectorEmbedded.InstrumentalSelectorEmbedded has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, ternaries 9 (10 pts), if/else 7 (nesting depth added 1). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 128, 66, 60, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TenantBulkFlow.TenantBulkFlow::submitOneRow (cognitive 30) frontend/components/job/TenantBulkFlow.tsx:277— TenantBulkFlow.TenantBulkFlow::submitOneRow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 11, error handling 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TenantBulkFlow.TenantBulkFlow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
youtube_comment_bot.decide (cognitive 29) backend/services/youtube_comment_bot.py:410— youtube_comment_bot.decide has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5, 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.
youtube_description_backfill_worker.run_backfill_sync (cognitive 29) backend/workers/youtube_description_backfill_worker.py:57— youtube_description_backfill_worker.run_backfill_sync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 4 (8 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 8). 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.
KaraokeComposer._set_draw_times_line_eager (cognitive 29) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:588— KaraokeComposer._set_draw_times_line_eager has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnchorSequence.__init__ (cognitive 29) karaoke_gen/lyrics_transcriber/types.py:303— AnchorSequence.__init__ has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (18 pts), if/else 6 (9 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wrap.balance_segments (cognitive 29) karaoke_gen/portrait/wrap.py:50— wrap.balance_segments has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.list_audio_edit_reviews (cognitive 28) backend/api/routes/admin.py:3761— admin.list_audio_edit_reviews has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 10, error handling 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.
file_upload.complete_style_uploads (cognitive 28) backend/api/routes/file_upload.py:2889— file_upload.complete_style_uploads has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 3, error handling 3, 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.
vocal_gaps.reference_lines_between (cognitive 28) backend/services/auto_approval/vocal_gaps.py:159— vocal_gaps.reference_lines_between has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 10, 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.
deterministic._gap_readings (cognitive 28) backend/services/auto_correct/deterministic.py:110— deterministic._gap_readings has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (9 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EncodingWorkerManager._ensure_any_running_once (cognitive 28) backend/services/encoding_worker_manager.py:588— EncodingWorkerManager._ensure_any_running_once has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 5 (10 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ops_alerts.notify_job_failed (cognitive 28) backend/services/ops_alerts.py:277— ops_alerts.notify_job_failed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 10, error handling 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
StripeAdminService.list_payments (cognitive 28) backend/services/stripe_admin_service.py:368— StripeAdminService.list_payments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tenant_admin_service.update_tenant (cognitive 28) backend/services/tenant_admin_service.py:581— tenant_admin_service.update_tenant has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 11, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ephemeral.cleanup_orphans (cognitive 28) REDACTED:633— ephemeral.cleanup_orphans has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (4 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cdg_decoder._apply_packet (cognitive 28) karaoke_gen/lyrics_transcriber/output/cdg_decoder.py:46— cdg_decoder._apply_packet has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 4 (9 pts), loops 3 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack.tile_to_packets (cognitive 28) karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:346— pack.tile_to_packets has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bulk_cli.process_csv_rows (cognitive 28) karaoke_gen/utils/bulk_cli.py:344— bulk_cli.process_csv_rows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (4 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useWordClick.useWordClick.handleWordClick (cognitive 28) frontend/components/lyrics-review/shared/useWordClick.ts:35— useWordClick.useWordClick.handleWordClick has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (14 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.
SearchLyricsTab.SearchLyricsTab (cognitive 28) frontend/components/lyrics-review/modals/SearchLyricsTab.tsx:21— SearchLyricsTab.SearchLyricsTab has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, ternaries 5 (8 pts), if/else 5, error handling 1 (nesting depth added 3). Of this number, 19 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
health.system_status (cognitive 27) backend/api/routes/health.py:361— health.system_status has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, error handling 1 (3 pts), ternaries 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DropboxService.upload_folder (cognitive 27) backend/services/dropbox_service.py:361— DropboxService.upload_folder has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 2 (3 pts), ternaries 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobManager._transition_to_state_unlocked (cognitive 27) backend/services/job_manager.py:693— JobManager._transition_to_state_unlocked has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, error handling 2 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
bulk_search_worker._auto_select (cognitive 27) backend/workers/bulk_search_worker.py:71— bulk_search_worker._auto_select has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
video_worker._prepare_distribution_directory (cognitive 27) backend/workers/video_worker.py:1824— video_worker._prepare_distribution_directory has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 3 (6 pts), loops 4, ternaries 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segment_resizer.split_text_proportionally (cognitive 27) karaoke_gen/lyrics_transcriber/output/segment_resizer.py:109— segment_resizer.split_text_proportionally has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioShakeAPI.wait_for_task_result (cognitive 27) karaoke_gen/lyrics_transcriber/transcribers/audioshake.py:291— AudioShakeAPI.wait_for_task_result has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioPlayer.AudioPlayer (cognitive 27) frontend/components/lyrics-review/AudioPlayer.tsx:35— AudioPlayer.AudioPlayer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, boolean chains 6, ternaries 1. Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 89, handlePlayPause, a function literal at line 162, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GuidancePanel.GuidancePanel (cognitive 27) frontend/components/lyrics-review/GuidancePanel.tsx:32— GuidancePanel.GuidancePanel has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 18, ternaries 5, if/else 4. Of this number, 20 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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.
chart.ChartTooltipContent (cognitive 27) REDACTED:107— chart.ChartTooltipContent has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, ternaries 6 (9 pts), if/else 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 182, 131). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
file_upload.mark_finalise_uploads_complete (cognitive 26) backend/api/routes/file_upload.py:2582— file_upload.mark_finalise_uploads_complete has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 2, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
internal.test_webhook (cognitive 26) backend/api/routes/internal.py:1738— internal.test_webhook has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 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.
PushNotificationService.send_push_sync (cognitive 26) backend/services/push_notification_service.py:109— PushNotificationService.send_push_sync has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, error handling 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StorageRetentionService._execute (cognitive 26) backend/services/storage_retention.py:781— StorageRetentionService._execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 4 (6 pts), ternaries 4, loops 3, 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.
main.backup_to_aws (cognitive 26) infrastructure/functions/backup_to_aws/main.py:85— main.backup_to_aws has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 7 (9 pts), ternaries 3, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
main.divebar_lookup (cognitive 26) infrastructure/functions/divebar_lookup/main.py:718— main.divebar_lookup has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, error handling 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.
KaraokeFinalise.check_if_video_title_exists_on_youtube_channel (cognitive 26) REDACTED:432— KaraokeFinalise.check_if_video_title_exists_on_youtube_channel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.create_cdg_zip_file (cognitive 26) REDACTED:1117— KaraokeFinalise.create_cdg_zip_file has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 1 (2 pts), ternaries 1 (2 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.
AnchorSequenceFinder._extend_anchors_into_single_word_gaps (cognitive 26) REDACTED:1089— AnchorSequenceFinder._extend_anchors_into_single_word_gaps has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASS.__range_cut (cognitive 26) karaoke_gen/lyrics_transcriber/output/ass/ass.py:258— ASS.__range_cut has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (22 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
KaraokeComposer._set_draw_times_line_delayed (cognitive 26) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:660— KaraokeComposer._set_draw_times_line_delayed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (9 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.
VideoBackgroundProcessor.execute_command_with_fallback (cognitive 26) REDACTED:213— VideoBackgroundProcessor.execute_command_with_fallback has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 4 (6 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.
client.ReplaySyncVerdict (cognitive 26) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:604— client.ReplaySyncVerdict has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 6, if/else 2, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (save, pill, nextJob, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.AdminBreadcrumb::getBreadcrumbs (cognitive 26) frontend/app/admin/layout.tsx:28— layout.AdminBreadcrumb::getBreadcrumbs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 1 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HighlightedText.HighlightedText::shouldWordFlash (cognitive 26) frontend/components/lyrics-review/shared/HighlightedText.tsx:160— HighlightedText.HighlightedText::shouldWordFlash has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 22, if/else 3 (4 pts) (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.
useManualSync.useManualSync.handleKeyDown (cognitive 26) frontend/hooks/useManualSync.ts:245— useManualSync.useManualSync.handleKeyDown has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
admin.delete_job_outputs (cognitive 25) backend/api/routes/admin.py:1682— admin.delete_job_outputs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
admin.backfill_signup_ips (cognitive 25) backend/api/routes/admin.py:4156— admin.backfill_signup_ips has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 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.
jobs.download_file (cognitive 25) backend/api/routes/jobs.py:1920— jobs.download_file has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (5 pts), boolean chains 4, error handling 3 (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.
review._save_review_completion (cognitive 25) REDACTED:1415— review._save_review_completion has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, ternaries 2 (3 pts), error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
users.submit_user_feedback (cognitive 25) backend/api/routes/users.py:2052— users.submit_user_feedback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 5 (8 pts), boolean chains 6, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
backfill_original_audio.run_backfill (cognitive 25) backend/scripts/backfill_original_audio.py:90— backfill_original_audio.run_backfill has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (6 pts), ternaries 3 (5 pts), loops 2, 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.
scorer.extract_lyrics_signals (cognitive 25) backend/services/auto_approval/scorer.py:273— scorer.extract_lyrics_signals has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (6 pts), loops 3, ternaries 3 (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.
LoopWatchdog.check (cognitive 25) REDACTED:276— LoopWatchdog.check has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
ThemeService.apply_color_overrides (cognitive 25) backend/services/theme_service.py:240— ThemeService.apply_color_overrides has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (25 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteFlacFetchAudioFetcher._basic_interactive_select (cognitive 25) karaoke_gen/audio_fetcher.py:1605— RemoteFlacFetchAudioFetcher._basic_interactive_select has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4 (8 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokePrep._scan_directory_for_instrumentals (cognitive 25) karaoke_gen/karaoke_gen.py:268— KaraokePrep._scan_directory_for_instrumentals has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsTranscriber.__init__ (cognitive 25) karaoke_gen/lyrics_transcriber/core/controller.py:62— LyricsTranscriber.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (7 pts), ternaries 7 (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.
ReviewServer.start (cognitive 25) REDACTED:1340— ReviewServer.start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 5 (9 pts), boolean chains 2, 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.
JobMonitor.log_timeline_updates (cognitive 25) karaoke_gen/utils/remote_cli.py:2230— JobMonitor.log_timeline_updates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.CommunityReviewsPage (cognitive 25) frontend/app/admin/community-reviews/page.tsx:16— page.CommunityReviewsPage has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (19 pts), boolean chains 3, error handling 2, if/else 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (doAction, a function literal at line 99, a function literal at line 23). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page.RevenueOverviewTab (cognitive 25) frontend/app/admin/payments/page.tsx:136— page.RevenueOverviewTab has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 15 (21 pts), boolean chains 3, error handling 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantJobFlow.TenantJobFlow (cognitive 25) frontend/components/job/TenantJobFlow.tsx:30— TenantJobFlow.TenantJobFlow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 8 (9 pts), boolean chains 5, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (handleSubmit, a function literal at line 55, a function literal at line 72). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ReplaceAllLyricsModal.ReplaceAllLyricsModal (cognitive 25) frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx:48— ReplaceAllLyricsModal.ReplaceAllLyricsModal has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, ternaries 6, if/else 4, error handling 1. Of this number, 15 points are the body's own statements and 10 belong to 10 function literals inside it that branch. 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.
admin._extract_files_recursive (cognitive 24) backend/api/routes/admin.py:819— admin._extract_files_recursive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (7 pts), error handling 1 (4 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.get_edit_review_detail (cognitive 24) backend/api/routes/admin.py:3649— admin.get_edit_review_detail has cognitive complexity 24 (threshold 15). Drivers by points: error handling 5 (9 pts), boolean chains 6, if/else 6, ternaries 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.
audio_search_service._categorize_result (cognitive 24) backend/services/audio_search_service.py:83— audio_search_service._categorize_result has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deterministic.phantom_parenthetical_suggestions (cognitive 24) backend/services/auto_correct/deterministic.py:397— deterministic.phantom_parenthetical_suggestions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmailService.send_credit_review_needed_email (cognitive 24) REDACTED:2924— EmailService.send_credit_review_needed_email has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
encoding_interface.classify_encoded_output (cognitive 24) backend/services/encoding_interface.py:57— encoding_interface.classify_encoded_output has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 9 (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.
IpGeolocationService.lookup_ips_batch (cognitive 24) backend/services/ip_geolocation_service.py:163— IpGeolocationService.lookup_ips_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
free_text._verdict_from_response (cognitive 24) backend/services/match_judge/free_text.py:135— free_text._verdict_from_response has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (10 pts), loops 1, ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
video_worker._setup_working_directory (cognitive 24) backend/workers/video_worker.py:1706— video_worker._setup_working_directory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 2 (4 pts), error handling 1 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
main.idle_shutdown (cognitive 24) REDACTED:165— main.idle_shutdown has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.upload_final_mp4_to_youtube_with_title_thumbnail (cognitive 24) REDACTED:523— KaraokeFinalise.upload_final_mp4_to_youtube_with_title_thumbnail has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 1 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SoundAlikeHandler._extract_replacement_from_references (cognitive 24) karaoke_gen/lyrics_transcriber/correction/agentic/handlers/sound_alike.py:16— SoundAlikeHandler._extract_replacement_from_references has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (21 pts), ternaries 2, loops 1 (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.
ASS.parse_text (cognitive 24) karaoke_gen/lyrics_transcriber/output/ass/ass.py:868— ASS.parse_text has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ASS.shiftscale (cognitive 24) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1328— ASS.shiftscale has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (7 pts), boolean chains 5 (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.
style_loader.apply_style_overrides (cognitive 24) karaoke_gen/style_loader.py:294— style_loader.apply_style_overrides has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteKaraokeClient.submit_job_from_url (cognitive 24) karaoke_gen/utils/remote_cli.py:272— RemoteKaraokeClient.submit_job_from_url has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, error handling 1 (2 pts) (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.
BuyCreditsDialog.BuyCreditsDialog (cognitive 24) frontend/components/credits/BuyCreditsDialog.tsx:22— BuyCreditsDialog.BuyCreditsDialog has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, ternaries 4 (5 pts), if/else 3, error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 10 belong to 8 function items inside it that branch. 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.
Header.Header (cognitive 24) frontend/components/lyrics-review/Header.tsx:77— Header.Header has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 21, ternaries 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.
audio-search-utils.getSearchConfidence (cognitive 24) frontend/lib/audio-search-utils.ts:380— audio-search-utils.getSearchConfidence has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), ternaries 2 (4 pts) (nesting depth added 3). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
admin.backfill_user_stats (cognitive 23) backend/api/routes/admin.py:3474— admin.backfill_user_stats has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.list_edit_reviews (cognitive 23) backend/api/routes/admin.py:3553— admin.list_edit_reviews has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (10 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
users.send_magic_link (cognitive 23) backend/api/routes/users.py:292— users.send_magic_link has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
apply.find_suspicious_duplicates (cognitive 23) backend/services/auto_approval/apply.py:326— apply.find_suspicious_duplicates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (10 pts), boolean chains 7, loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
timing_check._repetition_run_flags (cognitive 23) backend/services/auto_approval/timing_check.py:197— timing_check._repetition_run_flags has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (9 pts), ternaries 1 (3 pts), boolean chains 2 (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.
CustomLyricsService.generate (cognitive 23) backend/services/custom_lyrics/service.py:95— CustomLyricsService.generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (3 pts), ternaries 3, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
service.judge_match (cognitive 23) backend/services/match_judge/service.py:130— service.judge_match has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderer.fetch_lrclib_lyrics (cognitive 23) backend/services/quick_version/renderer.py:142— renderer.fetch_lrclib_lyrics has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, error handling 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tracing.setup_tracing (cognitive 23) backend/services/tracing.py:98— tracing.setup_tracing has cognitive complexity 23 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 8, 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.
VideoWorkerOrchestrator._upload_to_youtube (cognitive 23) backend/workers/video_worker_orchestrator.py:825— VideoWorkerOrchestrator._upload_to_youtube has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, error handling 3 (4 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.
git_repos_export.export_git_repos (cognitive 23) infrastructure/functions/backup_to_aws/git_repos_export.py:244— git_repos_export.export_git_repos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, error handling 2 (4 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgenticCorrector.propose_for_gap (cognitive 23) karaoke_gen/lyrics_transcriber/correction/agentic/agent.py:191— AgenticCorrector.propose_for_gap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (4 pts), error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.ReferralInterstitialClient (cognitive 23) frontend/app/[locale]/r/client.tsx:13— client.ReferralInterstitialClient has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 3 (6 pts), boolean chains 5, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (handleSubmit, a function literal at line 28, a function literal at line 43, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page.AdminFeedbackPage (cognitive 23) frontend/app/admin/feedback/page.tsx:76— page.AdminFeedbackPage has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 7, error handling 1, if/else 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 213, a function literal at line 85, handleKeyDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CrashReport.CrashReport (cognitive 23) frontend/components/CrashReport.tsx:37— CrashReport.CrashReport has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, ternaries 10, error handling 2, if/else 1. Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (send, a function literal at line 57, a function literal at line 47, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AudioEditor.WaveformCanvas (cognitive 23) frontend/components/audio-editor/AudioEditor.tsx:102— AudioEditor.WaveformCanvas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 5, loops 2 (4 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 124, handleMouseUp, a function literal at line 222, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FindReplaceModal.FindReplaceModal (cognitive 23) frontend/components/lyrics-review/modals/FindReplaceModal.tsx:35— FindReplaceModal.FindReplaceModal has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 7, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 69, a function literal at line 60, handleReplace, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SyncControls.SyncControls (cognitive 23) frontend/components/lyrics-review/synchronizer/SyncControls.tsx:51— SyncControls.SyncControls has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 11 (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.
review.apply_audio_edit (cognitive 22) REDACTED:3105— review.apply_audio_edit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
users.get_user_detail (cognitive 22) backend/api/routes/users.py:2455— users.get_user_detail has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 4 (6 pts), loops 3, 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.
ErrorMonitor._run_daily_digest (cognitive 22) backend/services/error_monitor/monitor.py:755— ErrorMonitor._run_daily_digest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (8 pts), error handling 1 (2 pts), boolean chains 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.
service.separate_quick (cognitive 22) backend/services/quick_version/service.py:95— service.separate_quick has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 2 (3 pts), loops 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThemeService._build_style_assets_mapping (cognitive 22) backend/services/theme_service.py:345— ThemeService._build_style_assets_mapping has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 6, loops 1 (nesting depth added 10). 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.
community_handoff.process_community_handoffs (cognitive 22) backend/workers/community_handoff.py:61— community_handoff.process_community_handoffs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), boolean chains 3, ternaries 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.
karaokehunt_conversion.process_intake (cognitive 22) backend/workers/karaokehunt_conversion.py:159— karaokehunt_conversion.process_intake has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
gcs_sync.sync_gcs_to_staging (cognitive 22) infrastructure/functions/backup_to_aws/gcs_sync.py:12— gcs_sync.sync_gcs_to_staging has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2, 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.
AudioProcessor._organize_stage2_remote_results (cognitive 22) karaoke_gen/audio_processor.py:757— AudioProcessor._organize_stage2_remote_results has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileHandler.download_video (cognitive 22) karaoke_gen/file_handler.py:80— FileHandler.download_video has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 4 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtendAnchorHandler.can_handle (cognitive 22) karaoke_gen/lyrics_transcriber/correction/handlers/extend_anchor.py:45— ExtendAnchorHandler.can_handle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseLyricsProvider._create_segments_with_words (cognitive 22) REDACTED:125— BaseLyricsProvider._create_segments_with_words has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6 (9 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeComposer._compose_intro (cognitive 22) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1537— KaraokeComposer._compose_intro has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentResizer._sanitize_segment_timings (cognitive 22) karaoke_gen/lyrics_transcriber/output/segment_resizer.py:367— SegmentResizer._sanitize_segment_timings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoGenerator.detect_nvenc_support (cognitive 22) karaoke_gen/lyrics_transcriber/output/video.py:50— VideoGenerator.detect_nvenc_support has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 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.
gen_cli.auto_select_instrumental (cognitive 22) karaoke_gen/utils/gen_cli.py:66— gen_cli.auto_select_instrumental has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payment-detail.PaymentDetailSheet (cognitive 22) REDACTED:62— payment-detail.PaymentDetailSheet has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, ternaries 3 (6 pts), if/else 1 (nesting depth added 3). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
TitleCardPreview.TitleCardPreview (cognitive 22) frontend/components/job/TitleCardPreview.tsx:151— TitleCardPreview.TitleCardPreview has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 8, error handling 2 (3 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 159). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
ImageUploadField.ImageUploadField (cognitive 22) frontend/components/job/ImageUploadField.tsx:26— ImageUploadField.ImageUploadField has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7 (8 pts), boolean chains 4 (nesting depth added 5). Of this number, 13 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QRCodeTab.QRCodeTab (cognitive 22) frontend/components/referrals/QRCodeTab.tsx:94— QRCodeTab.QRCodeTab has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 125, a function literal at line 101, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
contextWords.computeContextWordsBySegment (cognitive 22) frontend/lib/lyrics-review/utils/contextWords.ts:12— contextWords.computeContextWordsBySegment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 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.
admin.get_audio_edit_review_detail (cognitive 21) backend/api/routes/admin.py:3877— admin.get_audio_edit_review_detail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (5 pts), boolean chains 3, loops 2 (3 pts), ternaries 3 (nesting depth added 5). 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.
users.complete_verified_login (cognitive 21) backend/api/routes/users.py:502— users.complete_verified_login has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
users.verify_magic_link (cognitive 21) backend/api/routes/users.py:599— users.verify_magic_link has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
scorer.extract_backing_signals (cognitive 21) backend/services/auto_approval/scorer.py:522— scorer.extract_backing_signals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 1 (3 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.
timing_check.compute_timing_signals (cognitive 21) backend/services/auto_approval/timing_check.py:259— timing_check.compute_timing_signals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), boolean chains 3, loops 2, error handling 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.
AutoCorrectService.suggest (cognitive 21) backend/services/auto_correct/service.py:215— AutoCorrectService.suggest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
monitor._extract_message (cognitive 21) backend/services/error_monitor/monitor.py:152— monitor._extract_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). 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.
LoopWatchdog._finish (cognitive 21) REDACTED:349— LoopWatchdog._finish has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, boolean chains 5, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
theme_preview_service._pick_lyrics_frame (cognitive 21) REDACTED:477— theme_preview_service._pick_lyrics_frame has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, ternaries 2 (5 pts), error handling 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.
ThemeService._update_asset_paths_in_style (cognitive 21) backend/services/theme_service.py:390— ThemeService._update_asset_paths_in_style has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts), boolean chains 2 (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.
YouTubeUploadService.check_duplicate (cognitive 21) REDACTED:185— YouTubeUploadService.check_duplicate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
community_daily_pick.run_daily_pick (cognitive 21) backend/workers/community_daily_pick.py:52— community_daily_pick.run_daily_pick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (10 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate-translations.validate_locale (cognitive 21) frontend/scripts/validate-translations.py:42— validate-translations.validate_locale has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate-translations.main (cognitive 21) frontend/scripts/validate-translations.py:104— validate-translations.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
divebar_file_sync.main (cognitive 21) infrastructure/scripts/divebar_file_sync.py:270— divebar_file_sync.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteFlacFetchAudioFetcher._interactive_select (cognitive 21) karaoke_gen/audio_fetcher.py:1538— RemoteFlacFetchAudioFetcher._interactive_select has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.get_next_brand_code_server_side (cognitive 21) REDACTED:1381— KaraokeFinalise.get_next_brand_code_server_side has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CorrectionOperations.search_lyrics_sources (cognitive 21) REDACTED:285— CorrectionOperations.search_lyrics_sources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GeniusProvider._extract_lyrics_from_rapidapi_response (cognitive 21) karaoke_gen/lyrics_transcriber/lyrics/genius.py:134— GeniusProvider._extract_lyrics_from_rapidapi_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (2 pts), error handling 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.
ASS.__range_action (cognitive 21) karaoke_gen/lyrics_transcriber/output/ass/ass.py:285— ASS.__range_action has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, 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.
ASS.__shiftscale_action_time (cognitive 21) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1482— ASS.__shiftscale_action_time has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (21 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GapSequence.__init__ (cognitive 21) karaoke_gen/lyrics_transcriber/types.py:473— GapSequence.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 2, 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.
JobMonitor._show_download_progress (cognitive 21) karaoke_gen/utils/remote_cli.py:1446— JobMonitor._show_download_progress has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (4 pts), error handling 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.
page.CommunityRequestsPage (cognitive 21) frontend/app/admin/community-requests/page.tsx:31— page.CommunityRequestsPage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (16 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 121, 36, 53). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditTrackModal.EditTrackModal (cognitive 21) frontend/components/job/EditTrackModal.tsx:26— EditTrackModal.EditTrackModal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, error handling 1, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (handleConfirm, handleOpenChange). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
BulkMode.BulkMode (cognitive 21) frontend/components/job/bulk/BulkMode.tsx:30— BulkMode.BulkMode has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, error handling 4 (6 pts), if/else 4, ternaries 3 (nesting depth added 2). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 67, startAnother, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CorrectionAnnotationModal.CorrectionAnnotationModal (cognitive 21) frontend/components/lyrics-review/modals/CorrectionAnnotationModal.tsx:56— CorrectionAnnotationModal.CorrectionAnnotationModal has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 6, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 83, a function literal at line 94, handleSave, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FlyerTab.FlyerTab (cognitive 21) frontend/components/referrals/FlyerTab.tsx:21— FlyerTab.FlyerTab has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 57, handleExport, a function literal at line 36, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
audio-search-utils.categorizeResult (cognitive 21) frontend/lib/audio-search-utils.ts:63— audio-search-utils.categorizeResult has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
audio-search-utils.getBestResult (cognitive 21) frontend/lib/audio-search-utils.ts:172— audio-search-utils.getBestResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 5 (7 pts), boolean chains 4, loops 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.action_community_review (cognitive 20) backend/api/routes/admin.py:4484— admin.action_community_review has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 2 (6 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
login_code.send_login_code (cognitive 20) backend/api/routes/login_code.py:146— login_code.send_login_code has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 4, 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.
review.get_instrumental_analysis (cognitive 20) REDACTED:2423— review.get_instrumental_analysis has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
users.list_users (cognitive 20) backend/api/routes/users.py:2357— users.list_users has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 6 (7 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.
vocal_gaps.compute_vocal_gaps (cognitive 20) backend/services/auto_approval/vocal_gaps.py:235— vocal_gaps.compute_vocal_gaps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, error handling 4 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmailService.send_duration_confirm_reminder (cognitive 20) REDACTED:2050— EmailService.send_duration_confirm_reminder has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 5, if/else 4 (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.
frontend_ingestion.build_pattern_data (cognitive 20) backend/services/error_monitor/frontend_ingestion.py:187— frontend_ingestion.build_pattern_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, loops 1, ternaries 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.
JobManager.get_output_urls (cognitive 20) backend/services/job_manager.py:532— JobManager.get_output_urls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lyrics_worker._store_lyrics_processing_metadata (cognitive 20) backend/workers/lyrics_worker.py:892— lyrics_worker._store_lyrics_processing_metadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts), error handling 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.
VideoWorkerOrchestrator._run_packaging (cognitive 20) backend/workers/video_worker_orchestrator.py:405— VideoWorkerOrchestrator._run_packaging has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
youtube_queue_processor.process_youtube_upload_queue (cognitive 20) backend/workers/youtube_queue_processor.py:31— youtube_queue_processor.process_youtube_upload_queue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 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.
benchmark_types.benchmark (cognitive 20) REDACTED:182— benchmark_types.benchmark has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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.
main.validate_gdrive (cognitive 20) infrastructure/functions/gdrive_validator/main.py:524— main.validate_gdrive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
KaraokeFinalise.process (cognitive 20) REDACTED:1909— KaraokeFinalise.process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (19 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, 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.
LyricsProcessor.find_best_split_point (cognitive 20) karaoke_gen/lyrics_processor.py:90— LyricsProcessor.find_best_split_point has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LevenshteinHandler.can_handle (cognitive 20) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:41— LevenshteinHandler.can_handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 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.
pack.line_image_to_packets (cognitive 20) karaoke_gen/lyrics_transcriber/output/cdgmaker/pack.py:69— pack.line_image_to_packets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bulk_cli.process_track_render (cognitive 20) karaoke_gen/utils/bulk_cli.py:60— bulk_cli.process_track_render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 4 (8 pts), 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.
client.ReplayActionLog (cognitive 20) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:694— client.ReplayActionLog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 9, ternaries 1. Of this number, 10 points are the body's own statements and 10 belong to 3 function items inside it that branch. 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.
AudioSourceStep.FallbackSection (cognitive 20) frontend/components/job/steps/AudioSourceStep.tsx:1248— AudioSourceStep.FallbackSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 7 (nesting depth added 1). Of this number, 18 points are the body's own statements and 2 belong to 3 function literals inside it that branch. 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.
ThemeSelector.ThemeSelector (cognitive 20) frontend/components/job/ThemeSelector.tsx:20— ThemeSelector.ThemeSelector has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), error handling 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 9 belong to 3 function literals inside it that branch. 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.
UploadProgressModal.UploadProgressModal (cognitive 20) frontend/components/upload/UploadProgressModal.tsx:57— UploadProgressModal.UploadProgressModal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 4 (5 pts), loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
audio-search-utils.buildConfidenceReason (cognitive 20) frontend/lib/audio-search-utils.ts:455— audio-search-utils.buildConfidenceReason has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2 (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.
vocal_gaps._transcribed_to_reference (cognitive 19) backend/services/auto_approval/vocal_gaps.py:143— vocal_gaps._transcribed_to_reference has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (11 pts), boolean chains 4, if/else 2 (4 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FakeConfig.validate (cognitive 19) backend/services/fake_workers/config.py:92— FakeConfig.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 5. 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.
flacfetch_client.with_retry (cognitive 19) backend/services/flacfetch_client.py:110— flacfetch_client.with_retry has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 2 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input_persistence.persist_job_inputs (cognitive 19) backend/services/input_persistence.py:57— input_persistence.persist_job_inputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 3 (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.
free_text.resolve_and_tidy (cognitive 19) backend/services/match_judge/free_text.py:259— free_text.resolve_and_tidy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, error handling 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.
theme_preview_service.render_cdg_previews (cognitive 19) REDACTED:554— theme_preview_service.render_cdg_previews has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 4, ternaries 2 (4 pts), loops 2 (3 pts), error handling 2 (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.
stale_upload_processor.process_stale_uploads (cognitive 19) backend/workers/stale_upload_processor.py:38— stale_upload_processor.process_stale_uploads has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (3 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.
AnchorSequenceFinder.find_gaps (cognitive 19) REDACTED:889— AnchorSequenceFinder.find_gaps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
SoundAlikeHandler.can_handle (cognitive 19) karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:39— SoundAlikeHandler.can_handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeComposer._compose_outro (cognitive 19) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1722— KaraokeComposer._compose_outro has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
timing_validation.validate_segment_timing (cognitive 19) karaoke_gen/lyrics_transcriber/output/timing_validation.py:36— timing_validation.validate_segment_timing has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobMonitor._find_original_index (cognitive 19) karaoke_gen/utils/remote_cli.py:1847— JobMonitor._find_original_index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.VerifyMagicLinkContent::handleConfirm::verify (cognitive 19) frontend/app/[locale]/auth/verify/page.tsx:105— page.VerifyMagicLinkContent::handleConfirm::verify has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7 (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.
refund-dialog.RefundDialog (cognitive 19) frontend/components/admin/refund-dialog.tsx:38— refund-dialog.RefundDialog has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 4 (5 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
backend-status-banner.BackendStatusBanner (cognitive 19) frontend/components/backend-status-banner.tsx:49— backend-status-banner.BackendStatusBanner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 112, 72, 94, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
KaraokeBackgroundPreview.KaraokeBackgroundPreview (cognitive 19) frontend/components/job/KaraokeBackgroundPreview.tsx:45— KaraokeBackgroundPreview.KaraokeBackgroundPreview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 8, error handling 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 58, 106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PasteLyricsTab.PasteLyricsTab (cognitive 19) frontend/components/lyrics-review/modals/PasteLyricsTab.tsx:19— PasteLyricsTab.PasteLyricsTab has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 3 (4 pts), if/else 3, error handling 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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.
job-status.getParallelProcessingLabel (cognitive 19) frontend/lib/job-status.ts:300— job-status.getParallelProcessingLabel 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.
admin.list_user_feedback (cognitive 18) backend/api/routes/admin.py:4311— admin.list_user_feedback has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8, if/else 3 (6 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.
audio_search.research_audio (cognitive 18) backend/api/routes/audio_search.py:1149— audio_search.research_audio has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, error handling 2, ternaries 1 (2 pts) (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.
audio_search.provide_url_for_job (cognitive 18) backend/api/routes/audio_search.py:1303— audio_search.provide_url_for_job has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 2, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jobs.complete_review (cognitive 18) backend/api/routes/jobs.py:1660— jobs.complete_review has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 2, error handling 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.
users._build_user_public (cognitive 18) backend/api/routes/users.py:92— users._build_user_public has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (5 pts), boolean chains 2, error handling 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.
vocal_gaps._synced_reference_lines (cognitive 18) backend/services/auto_approval/vocal_gaps.py:207— vocal_gaps._synced_reference_lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 7, loops 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.
PostmarkEmailProvider.send_email_detailed (cognitive 18) REDACTED:294— PostmarkEmailProvider.send_email_detailed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6, error handling 4 (5 pts), ternaries 2 (4 pts), boolean chains 3 (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.
EmailService.send_karaokehunt_conversion (cognitive 18) REDACTED:1017— EmailService.send_karaokehunt_conversion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (7 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
known_issues.should_ignore (cognitive 18) backend/services/error_monitor/known_issues.py:185— known_issues.should_ignore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main._ensure_latest_wheel_locked (cognitive 18) REDACTED:740— main._ensure_latest_wheel_locked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lyrics_translation.prepare_job_translations (cognitive 18) backend/services/lyrics_translation.py:279— lyrics_translation.prepare_job_translations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (6 pts), boolean chains 4 (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.
published_outputs_cleanup.delete_dropbox_folder (cognitive 18) backend/services/published_outputs_cleanup.py:81— published_outputs_cleanup.delete_dropbox_folder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (4 pts), ternaries 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
youtube_backfill.build_entries (cognitive 18) backend/services/youtube_backfill.py:192— youtube_backfill.build_entries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 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.
FileHandler.backup_existing_outputs (cognitive 18) karaoke_gen/file_handler.py:321— FileHandler.backup_existing_outputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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.
KaraokeFinalise.authenticate_youtube (cognitive 18) REDACTED:350— KaraokeFinalise.authenticate_youtube has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.detect_nvenc_support (cognitive 18) REDACTED:1711— KaraokeFinalise.detect_nvenc_support has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 5, boolean chains 2 (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.
KaraokePrep.process (cognitive 18) karaoke_gen/karaoke_gen.py:1126— KaraokePrep.process has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (5 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LyricsTranscriber._prepare_instrumental_options (cognitive 18) karaoke_gen/lyrics_transcriber/core/controller.py:702— LyricsTranscriber._prepare_instrumental_options has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (2 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
adapter.adapt_proposals_to_word_corrections (cognitive 18) karaoke_gen/lyrics_transcriber/correction/agentic/adapter.py:10— adapter.adapt_proposals_to_word_corrections has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 3 (6 pts), if/else 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PhraseAnalyzer.calculate_line_break_score (cognitive 18) karaoke_gen/lyrics_transcriber/correction/phrase_analyzer.py:380— PhraseAnalyzer.calculate_line_break_score has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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.
SegmentResizer._find_best_split_point (cognitive 18) karaoke_gen/lyrics_transcriber/output/segment_resizer.py:650— SegmentResizer._find_best_split_point has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderer.render_portrait_video (cognitive 18) karaoke_gen/portrait/renderer.py:146— renderer.render_portrait_video has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AuthStatus.AuthStatus (cognitive 18) frontend/components/auth/AuthStatus.tsx:31— AuthStatus.AuthStatus has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, ternaries 1. Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
TenantBulkFlow.TenantBulkFlow (cognitive 18) frontend/components/job/TenantBulkFlow.tsx:91— TenantBulkFlow.TenantBulkFlow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 32 (48 pts), boolean chains 47, ternaries 19 (22 pts), error handling 3, loops 3 (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. This shape REPEATS in the file: one other method here (TenantBulkFlow.TenantBulkFlow::submitOneRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EditFeedbackBar.EditFeedbackBar (cognitive 18) frontend/components/lyrics-review/EditFeedbackBar.tsx:36— EditFeedbackBar.EditFeedbackBar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 84, 68, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
VocalsAudioDataLoader.VocalsAudioDataLoader (cognitive 18) frontend/components/lyrics-review/VocalsAudioDataLoader.tsx:40— VocalsAudioDataLoader.VocalsAudioDataLoader has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 18 points belong to 5 function literals inside it that branch (lines 73, 44, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditWordList.EditWordList (cognitive 18) frontend/components/lyrics-review/EditWordList.tsx:214— EditWordList.EditWordList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (handleTabNavigation, handleReplaceAllWords, a function literal at line 357, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
admin.clear_audio_search_cache (cognitive 17) backend/api/routes/admin.py:555— admin.clear_audio_search_cache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
admin.regenerate_screens (cognitive 17) backend/api/routes/admin.py:2297— admin.regenerate_screens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, error handling 3 (4 pts), boolean chains 3, ternaries 2, loops 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.
admin.override_audio_source (cognitive 17) backend/api/routes/admin.py:2940— admin.override_audio_source has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 3, ternaries 3, error handling 2, loops 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.
health.get_system_info (cognitive 17) backend/api/routes/health.py:31— health.get_system_info has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 3 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
internal._retry_pending_render_jobs_sync (cognitive 17) backend/api/routes/internal.py:1017— internal._retry_pending_render_jobs_sync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jobs.create_job (cognitive 17) backend/api/routes/jobs.py:83— jobs.create_job has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, error handling 2, ternaries 2. 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.
kjbox.send_code (cognitive 17) backend/api/routes/kjbox.py:185— kjbox.send_code has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, 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.
users.attribution_summary (cognitive 17) backend/api/routes/users.py:2312— users.attribution_summary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scorer.score_lyrics (cognitive 17) backend/services/auto_approval/scorer.py:399— scorer.score_lyrics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (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.
FlacfetchClient.wait_for_download (cognitive 17) backend/services/flacfetch_client.py:547— FlacfetchClient.wait_for_download has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
regenerate_service.validate_regenerate (cognitive 17) backend/services/regenerate_service.py:135— regenerate_service.validate_regenerate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 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.
StorageRetentionService._iter_jobs (cognitive 17) backend/services/storage_retention.py:692— StorageRetentionService._iter_jobs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
storage_retention.job_skip_reason (cognitive 17) backend/services/storage_retention.py:196— storage_retention.job_skip_reason has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, loops 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.
StripeAdminService.get_revenue_by_period (cognitive 17) backend/services/stripe_admin_service.py:305— StripeAdminService.get_revenue_by_period has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
theme_preview_service._pick_instrumental_frame (cognitive 17) REDACTED:500— theme_preview_service._pick_instrumental_frame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1, ternaries 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.
youtube_comment_bot.parse_classification (cognitive 17) backend/services/youtube_comment_bot.py:207— youtube_comment_bot.parse_classification has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (5 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VideoWorkerOrchestrator.run (cognitive 17) backend/workers/video_worker_orchestrator.py:309— VideoWorkerOrchestrator.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 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.
video_worker_orchestrator.create_orchestrator_config_from_job (cognitive 17) backend/workers/video_worker_orchestrator.py:1237— video_worker_orchestrator.create_orchestrator_config_from_job has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
idle-watchdog.decide (cognitive 17) infrastructure/encoding-worker/aws/idle-watchdog.py:34— idle-watchdog.decide has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 2 (3 pts), error handling 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.
filename_parser._try_prefix (cognitive 17) infrastructure/functions/divebar_mirror/filename_parser.py:191— filename_parser._try_prefix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 1 (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.
main.list_folder_contents (cognitive 17) infrastructure/functions/gdrive_validator/main.py:112— main.list_folder_contents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 1, 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.
ephemeral.redispatch_stalled_jobs (cognitive 17) REDACTED:861— ephemeral.redispatch_stalled_jobs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
classifier.build_classification_prompt_hardcoded (cognitive 17) karaoke_gen/lyrics_transcriber/correction/agentic/prompts/classifier.py:172— classifier.build_classification_prompt_hardcoded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeComposer._set_draw_times (cognitive 17) karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:460— KaraokeComposer._set_draw_times has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
style_loader.load_styles_from_gcs (cognitive 17) karaoke_gen/style_loader.py:414— style_loader.load_styles_from_gcs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoBackgroundProcessor.detect_nvenc_support (cognitive 17) REDACTED:29— VideoBackgroundProcessor.detect_nvenc_support has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 5, boolean chains 2 (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.
AutoCorrectPanel.AutoCorrectPanel (cognitive 17) frontend/components/lyrics-review/AutoCorrectPanel.tsx:55— AutoCorrectPanel.AutoCorrectPanel has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 2 (3 pts), if/else 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. 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.
system-status-modal.SystemStatusModal (cognitive 17) frontend/components/system-status-modal.tsx:212— system-status-modal.SystemStatusModal has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 16, if/else 1. Of this number, 14 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
use-notifications.useJobNotifications (cognitive 17) frontend/hooks/use-notifications.ts:110— use-notifications.useJobNotifications has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 209, 189). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
backend-status.recompute (cognitive 17) frontend/lib/backend-status.ts:197— backend-status.recompute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
autoCorrectApply.revertSuggestion (cognitive 17) frontend/lib/lyrics-review/utils/autoCorrectApply.ts:242— autoCorrectApply.revertSuggestion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
health.get_ffmpeg_info (cognitive 16) backend/api/routes/health.py:72— health.get_ffmpeg_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), error handling 3 (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.
jobs.delete_job (cognitive 16) backend/api/routes/jobs.py:829— jobs.delete_job has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3, boolean chains 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.
login_code.verify_login_code (cognitive 16) backend/api/routes/login_code.py:262— login_code.verify_login_code has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (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.
review.search_lyrics (cognitive 16) REDACTED:1874— review.search_lyrics has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, error handling 3, ternaries 2. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tenant_admin.admin_update_tenant (cognitive 16) backend/api/routes/tenant_admin.py:230— tenant_admin.admin_update_tenant has cognitive complexity 16 (threshold 15). Drivers by points: error handling 7, boolean chains 5, if/else 2 (3 pts), loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccountDeletionService._anonymise_kept_records (cognitive 16) backend/services/account_deletion_service.py:620— AccountDeletionService._anonymise_kept_records has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (7 pts), boolean chains 6, ternaries 1 (2 pts), if/else 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deterministic._parenthetical_runs (cognitive 16) backend/services/auto_correct/deterministic.py:367— deterministic._parenthetical_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmailService.send_duration_confirm_expired (cognitive 16) REDACTED:2325— EmailService.send_duration_confirm_expired has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5, boolean chains 4 (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.
EncodingService._warmup_encoding_worker_fallback (cognitive 16) backend/services/encoding_service.py:425— EncodingService._warmup_encoding_worker_fallback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (6 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
job_manager.drain_notifications (cognitive 16) backend/services/job_manager.py:123— job_manager.drain_notifications has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LyricsTranslationService.translate_lines (cognitive 16) backend/services/lyrics_translation.py:210— LyricsTranslationService.translate_lines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
analyze._regex_analyze (cognitive 16) backend/services/tenant_bulk/analyze.py:272— analyze._regex_analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (5 pts), boolean chains 4 (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.
tenant_theme_service.store_uploaded_asset (cognitive 16) backend/services/tenant_theme_service.py:373— tenant_theme_service.store_uploaded_asset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
theme_rerender_service.validate_rerender (cognitive 16) backend/services/theme_rerender_service.py:73— theme_rerender_service.validate_rerender has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. 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.
TornadoClient._create_job (cognitive 16) backend/services/tornado_client.py:181— TornadoClient._create_job has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YouTubeUploadService._authenticate (cognitive 16) REDACTED:82— YouTubeUploadService._authenticate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
bulk_search_worker.process_album_jobs (cognitive 16) backend/workers/bulk_search_worker.py:247— bulk_search_worker.process_album_jobs has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 2 (3 pts), ternaries 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bulk_search_worker.process_batch (cognitive 16) backend/workers/bulk_search_worker.py:332— bulk_search_worker.process_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlacFetchAudioFetcher._get_manager (cognitive 16) karaoke_gen/audio_fetcher.py:377— FlacFetchAudioFetcher._get_manager has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KaraokeFinalise.choose_instrumental_audio_file (cognitive 16) REDACTED:714— KaraokeFinalise.choose_instrumental_audio_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KaraokeFinalise.execute_command (cognitive 16) REDACTED:818— KaraokeFinalise.execute_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 2 (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.
KaraokePrep.process_folder (cognitive 16) karaoke_gen/karaoke_gen.py:1079— KaraokePrep.process_folder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoSpacePunctuationMatchHandler.can_handle (cognitive 16) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:23— NoSpacePunctuationMatchHandler.can_handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (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.
SyllablesMatchHandler.can_handle (cognitive 16) karaoke_gen/lyrics_transcriber/correction/handlers/syllables_match.py:32— SyllablesMatchHandler.can_handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (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.
LRCLIBProvider._parse_synced_lyrics (cognitive 16) karaoke_gen/lyrics_transcriber/lyrics/lrclib.py:161— LRCLIBProvider._parse_synced_lyrics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 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.
CDGGenerator._format_lyrics_data (cognitive 16) karaoke_gen/lyrics_transcriber/output/cdg.py:477— CDGGenerator._format_lyrics_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReviewServer.search_lyrics (cognitive 16) REDACTED:1266— ReviewServer.search_lyrics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, error handling 3 (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.
AudioEditRestoreDialog.AudioEditRestoreDialog (cognitive 16) frontend/components/audio-editor/AudioEditRestoreDialog.tsx:34— AudioEditRestoreDialog.AudioEditRestoreDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), boolean chains 4, if/else 4, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 128, a function literal at line 49, a function literal at line 66, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FeedbackDialog.FeedbackDialog (cognitive 16) frontend/components/feedback/FeedbackDialog.tsx:49— FeedbackDialog.FeedbackDialog has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (5 pts), error handling 1, if/else 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 belong to 3 function items inside it that branch. 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.
VisibilityStep.VisibilityStep (cognitive 16) frontend/components/job/steps/VisibilityStep.tsx:15— VisibilityStep.VisibilityStep has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 14, boolean chains 2. 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.
TitleCardPreview.fitText (cognitive 16) frontend/components/job/TitleCardPreview.tsx:80— TitleCardPreview.fitText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 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.
FlyerControls.FlyerControls (cognitive 16) frontend/components/referrals/FlyerControls.tsx:72— FlyerControls.FlyerControls has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 3. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 12 function items inside it that branch (handleLoadPreset, handleSavePreset, handleDeletePreset, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useAutoCorrect.useAutoCorrect (cognitive 16) frontend/hooks/useAutoCorrect.ts:73— useAutoCorrect.useAutoCorrect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, loops 2. None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 170, 183, 362). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useManualSync.useManualSync.handleKeyUp (cognitive 16) frontend/hooks/useManualSync.ts:319— useManualSync.useManualSync.handleKeyUp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audio-data.computePeaks (cognitive 16) frontend/lib/audio-data.ts:54— audio-data.computePeaks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crash-reporter.reportClientError (cognitive 16) frontend/lib/crash-reporter.ts:167— crash-reporter.reportClientError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 1 (2 pts), ternaries 2, boolean chains 1, 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.
job-status.sortJobs (cognitive 16) frontend/lib/job-status.ts:468— job-status.sortJobs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 472, 482). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Near-duplicate member family (4 members, 26 shared lines) · ×1
Near-duplicate member family (4 members, 26 shared lines) backend/services/email_validation_service.py:556— backend/services/email_validation_service.py:556-599 | backend/services/email_validation_service.py:635-670 | backend/services/email_validation_service.py:706-741 | backend/services/email_validation_service.py:777-812 — These 4 members are variants of one another: a block of 26 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 (42 shared lines) karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:79— karaoke_gen/lyrics_transcriber/correction/handlers/levenshtein.py:79-162 | karaoke_gen/lyrics_transcriber/correction/handlers/sound_alike.py:79-161 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) backend/services/visibility_change_service.py:340— backend/services/visibility_change_service.py:340-434 | backend/services/visibility_change_service.py:437-528 — These two members are variants of one another: 35 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 (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) backend/api/routes/jobs.py:222— backend/api/routes/jobs.py:222-237 | backend/api/routes/jobs.py:305-562 | backend/api/routes/jobs.py:1031-1087 | backend/api/routes/jobs.py:1105-1144 | backend/api/routes/jobs.py:1155-1246 | backend/api/routes/jobs.py:1256-1297 | backend/api/routes/jobs.py:1307-1385 | backend/api/routes/jobs.py:1400-1413 | backend/api/routes/jobs.py:1667-1750 | backend/api/routes/jobs.py:1761-1820 | backend/api/routes/jobs.py:1829-1865 | backend/api/routes/jobs.py:1927-2050 | backend/api/routes/jobs.py:2060-2083 | backend/api/routes/jobs.py:2101-2502 | backend/api/routes/jobs.py:2511-2549 | backend/api/routes/jobs.py:2560-2598 | backend/api/routes/jobs.py:3324-3465 — These 17 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 17 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 17 times.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) infrastructure/modules/audio_separator_service.py:95— infrastructure/modules/audio_separator_service.py:95-130 | infrastructure/modules/backup.py:24-288 | infrastructure/modules/divebar_lookup.py:29-249 | infrastructure/modules/divebar_mirror.py:41-284 | infrastructure/modules/iam/backend_sa.py:32-143 | infrastructure/modules/iam/claude_automation_sa.py:36-105 | infrastructure/modules/iam/github_actions_sa.py:80-229 | infrastructure/modules/iam/worker_sas.py:33-78 | infrastructure/modules/iam/worker_sas.py:154-189 | infrastructure/modules/kn_data_sync.py:28-268 | infrastructure/modules/runner_manager.py:63-109 — These 11 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 11 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 11 times.
D4 · Code Duplication· Edited copy of a member (78 corresponding lines) · ×1
Edited copy of a member (78 corresponding lines) REDACTED:1712— REDACTED:1712-1793 | REDACTED:30-107 — These two members are one piece of code written twice and then edited apart: 78 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 (86 corresponding lines) · ×1
Edited copy of a member (86 corresponding lines) backend/api/routes/admin.py:3560— backend/api/routes/admin.py:3560-3645 | backend/api/routes/admin.py:3768-3873 — These two members are one piece of code written twice and then edited apart: 86 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 (83 corresponding lines) · ×1
Edited copy of a member (83 corresponding lines) karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:72— karaoke_gen/lyrics_transcriber/correction/handlers/no_space_punct_match.py:72-154 | karaoke_gen/lyrics_transcriber/correction/handlers/syllables_match.py:85-179 — These two members are one piece of code written twice and then edited apart: 83 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 (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) backend/workers/screens_worker.py:425— backend/workers/screens_worker.py:425-501 | backend/workers/screens_worker.py:512-579 — These two members are one piece of code written twice and then edited apart: 68 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 (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) REDACTED:83— REDACTED:83-157 | REDACTED:351-416 — These two members are one piece of code written twice and then edited apart: 66 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 (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) backend/services/encoding_service.py:647— backend/services/encoding_service.py:647-713 | backend/services/encoding_service.py:1176-1240 — These two members are one piece of code written twice and then edited apart: 65 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 (71 corresponding lines) · ×1
Edited copy of a member (71 corresponding lines) backend/services/audio_search_service.py:621— backend/services/audio_search_service.py:621-691 | backend/services/audio_search_service.py:701-784 — These two members are one piece of code written twice and then edited apart: 71 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) backend/services/firestore_service.py:249— backend/services/firestore_service.py:249-302 | backend/services/firestore_service.py:364-416 — These two members are one piece of code written twice and then edited apart: 53 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 (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) backend/services/worker_service.py:916— backend/services/worker_service.py:916-1002 | backend/services/worker_service.py:1010-1103 — These two members are one piece of code written twice and then edited apart: 87 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:40— karaoke_gen/lyrics_transcriber/correction/handlers/relaxed_word_count_match.py:40-85 | karaoke_gen/lyrics_transcriber/correction/handlers/word_count_match.py:41-80 — These two members are one piece of code written twice and then edited apart: 40 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) backend/services/job_notification_service.py:156— backend/services/job_notification_service.py:156-220 | backend/services/job_notification_service.py:460-520 — These two members are one piece of code written twice and then edited apart: 61 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) REDACTED:1444— REDACTED:1444-1491 | REDACTED:1500-1550 — These two members are one piece of code written twice and then edited apart: 48 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 (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) karaoke_gen/lyrics_transcriber/correction/agentic/handlers/background_vocals.py:24— karaoke_gen/lyrics_transcriber/correction/agentic/handlers/background_vocals.py:24-67 | karaoke_gen/lyrics_transcriber/correction/agentic/handlers/extra_words.py:27-73 — These two members are one piece of code written twice and then edited apart: 44 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, 65+ corresponding lines) · ×1
Edited copies of one member (3 members, 65+ corresponding lines) infrastructure/compute/github_runners.py:76— infrastructure/compute/github_runners.py:76-158 | infrastructure/compute/github_runners.py:166-230 | infrastructure/compute/github_runners.py:238-317 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 65 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 (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) backend/services/gdrive_service.py:85— backend/services/gdrive_service.py:85-127 | backend/services/youtube_service.py:28-78 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) backend/workers/karaokehunt_conversion.py:274— backend/workers/karaokehunt_conversion.py:274-302 | backend/workers/karaokehunt_conversion.py:326-348 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) karaoke_gen/lyrics_transcriber/output/cdg.py:114— karaoke_gen/lyrics_transcriber/output/cdg.py:114-154 | karaoke_gen/lyrics_transcriber/output/cdg.py:802-852 — These two members are one piece of code written twice and then edited apart: 41 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 (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) backend/services/tracing.py:290— backend/services/tracing.py:290-328 | karaoke_gen/lyrics_transcriber/utils/tracing.py:113-155 — These two members are one piece of code written twice and then edited apart: 39 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) backend/services/user_service.py:83— backend/services/user_service.py:83-106 | backend/services/user_service.py:109-128 — 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 (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) backend/services/flacfetch_client.py:658— backend/services/flacfetch_client.py:658-682 | backend/services/flacfetch_client.py:689-716 | backend/services/flacfetch_client.py:796-829 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) backend/api/routes/themes.py:117— backend/api/routes/themes.py:117-157 | backend/api/routes/themes.py:162-197 — These two members are one piece of code written twice and then edited apart: 36 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, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) REDACTED:1455— REDACTED:1455-1482 | REDACTED:1488-1515 | REDACTED:1633-1660 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 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, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) backend/api/routes/jobs.py:589— backend/api/routes/jobs.py:589-609 | backend/services/job_manager.py:181-191 | backend/services/ops_alerts.py:264-274 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) REDACTED:327— REDACTED:327-368 | REDACTED:470-495 | REDACTED:894-916 | REDACTED:958-974 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) REDACTED:981— REDACTED:981-1009 | REDACTED:1023-1050 | REDACTED:1062-1087 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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) · ×1
Edited copy of a member (8 corresponding lines) REDACTED:262— REDACTED:262-270 | REDACTED:275-282 — 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, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) backend/api/routes/internal.py:882— backend/api/routes/internal.py:882-901 | backend/api/routes/internal.py:909-925 | backend/api/routes/internal.py:933-948 — 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 (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) backend/services/firestore_service.py:963— backend/services/firestore_service.py:963-986 | backend/services/firestore_service.py:989-1007 | backend/services/firestore_service.py:1156-1170 | backend/services/firestore_service.py:1173-1185 — 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 copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) backend/services/song_request_service.py:261— backend/services/song_request_service.py:261-270 | backend/services/song_request_service.py:273-278 | backend/services/song_request_service.py:440-446 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 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, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) backend/api/routes/rate_limits.py:105— backend/api/routes/rate_limits.py:105-117 | backend/api/routes/rate_limits.py:143-149 | backend/api/routes/rate_limits.py:194-206 | backend/api/routes/rate_limits.py:232-244 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) backend/api/routes/rate_limits.py:125— backend/api/routes/rate_limits.py:125-135 | backend/api/routes/rate_limits.py:157-162 | backend/api/routes/rate_limits.py:214-224 | backend/api/routes/rate_limits.py:252-262 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 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 (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) backend/api/routes/users.py:2666— backend/api/routes/users.py:2666-2677 | backend/api/routes/users.py:2687-2698 | backend/api/routes/users.py:2708-2724 | backend/api/routes/users.py:2735-2746 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 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, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) karaoke_gen/utils/remote_cli.py:1078— karaoke_gen/utils/remote_cli.py:1078-1090 | karaoke_gen/utils/remote_cli.py:1176-1188 | karaoke_gen/utils/remote_cli.py:1377-1389 — 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 copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) karaoke_gen/style_loader.py:578— karaoke_gen/style_loader.py:578-604 | karaoke_gen/style_loader.py:608-634 | karaoke_gen/style_loader.py:638-664 | karaoke_gen/style_loader.py:668-692 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 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 (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) backend/services/admin_rerender_service.py:233— backend/services/admin_rerender_service.py:233-237 | backend/services/regenerate_service.py:129-132 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (66–67 lines × 2) REDACTED:1728— REDACTED:1728-1793 | REDACTED:41-107 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (40–62 lines × 2) infrastructure/modules/backup.py:144— infrastructure/modules/backup.py:144-205 | infrastructure/modules/kn_data_sync.py:147-186 — before extracting anything, compare `infrastructure/modules/backup.py` and `infrastructure/modules/kn_data_sync.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 151 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (35–58 lines × 2) backend/api/routes/audio_search.py:303— backend/api/routes/audio_search.py:303-337 | backend/api/routes/file_upload.py:350-407 — 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 `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 `created_from` to `str = "audio_search"` in one and `str = "upload"` 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 (54–55 lines × 2) karaoke_gen/utils/remote_cli.py:595— karaoke_gen/utils/remote_cli.py:595-649 | karaoke_gen/utils/remote_cli.py:867-920 — both copies are in the same file, so extract the 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 (51–52 lines × 3) karaoke_gen/utils/gen_cli.py:593— karaoke_gen/utils/gen_cli.py:593-644 | karaoke_gen/utils/gen_cli.py:706-756 | karaoke_gen/utils/gen_cli.py:1180-1230 — 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 `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 (47–48 lines × 2) backend/workers/video_worker.py:556— backend/workers/video_worker.py:556-603 | backend/workers/video_worker.py:1269-1315 — both copies are in the same file, so extract the 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 `backend/workers/video_worker.py:556` 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 (33–46 lines × 3) infrastructure/modules/divebar_lookup.py:85— infrastructure/modules/divebar_lookup.py:85-117 | infrastructure/modules/divebar_mirror.py:128-173 | infrastructure/modules/kn_data_sync.py:121-156 — before extracting anything, compare `infrastructure/modules/divebar_lookup.py` and `infrastructure/modules/divebar_mirror.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 149 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 `infrastructure/modules/divebar_lookup.py:85` 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 (40–46 lines × 2) backend/services/firestore_service.py:249— backend/services/firestore_service.py:249-294 | backend/services/firestore_service.py:364-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (31–45 lines × 3) backend/services/firestore_service.py:705— backend/services/firestore_service.py:705-749 | backend/services/firestore_service.py:1010-1049 | backend/services/firestore_service.py:1188-1218 — 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 (33–41 lines × 3) infrastructure/compute/github_runners.py:114— infrastructure/compute/github_runners.py:114-154 | infrastructure/compute/github_runners.py:198-230 | infrastructure/compute/github_runners.py:281-313 — 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 `infrastructure/compute/github_runners.py:114` 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 (39–40 lines × 2) backend/services/worker_service.py:934— backend/services/worker_service.py:934-973 | backend/services/worker_service.py:1028-1066 — both copies are in the same file, so extract the 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 `backend/services/worker_service.py:934` 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 (35–37 lines × 2) backend/services/audio_search_service.py:646— backend/services/audio_search_service.py:646-680 | backend/services/audio_search_service.py:737-773 — both copies are in the same file, so extract the 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 `backend/services/audio_search_service.py:646` 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 (34–36 lines × 2) backend/services/auth_service.py:439— backend/services/auth_service.py:439-474 | backend/services/auth_service.py:478-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (29–36 lines × 2) backend/workers/audio_worker.py:140— backend/workers/audio_worker.py:140-175 | backend/workers/render_video_worker.py:94-122 — 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 (29–35 lines × 2) backend/services/audio_search_service.py:142— backend/services/audio_search_service.py:142-176 | scripts/karaokehunt_outreach/phase1b_audio_search.py:192-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (31–35 lines × 2) REDACTED:1663— REDACTED:1663-1697 | REDACTED:2476-2506 — both copies are in the same file, so extract the 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 (17–34 lines × 3) REDACTED:1416— REDACTED:1416-1432 | REDACTED:1761-1779 | REDACTED:1879-1912 — 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 (24–33 lines × 2) backend/services/audio_analysis_service.py:66— backend/services/audio_analysis_service.py:66-89 | backend/services/audio_analysis_service.py:108-140 — both copies are in the same file, so extract the 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 (30–32 lines × 2) REDACTED:3239— REDACTED:3239-3268 | REDACTED:3290-3321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25–31 lines × 3) karaoke_gen/utils/remote_cli.py:340— karaoke_gen/utils/remote_cli.py:340-370 | karaoke_gen/utils/remote_cli.py:557-583 | karaoke_gen/utils/remote_cli.py:1242-1266 — 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 (30–31 lines × 2) backend/services/packaging_service.py:311— backend/services/packaging_service.py:311-340 | REDACTED:1079-1109 — 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 `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 (29–30 lines × 2) backend/services/gemini_client.py:104— backend/services/gemini_client.py:104-133 | frontend/scripts/gemini_client.py:114-142 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `exc` to `Optional[BaseException]` in one and `BaseException | None` 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 (29 lines × 4) backend/services/email_validation_service.py:525— backend/services/email_validation_service.py:525-553 | backend/services/email_validation_service.py:604-632 | backend/services/email_validation_service.py:675-703 | backend/services/email_validation_service.py:746-774 — 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–28 lines × 3) infrastructure/modules/cloud_run.py:138— infrastructure/modules/cloud_run.py:138-144 | infrastructure/modules/cloud_run.py:702-729 | infrastructure/modules/cloud_run.py:756-762 — 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 `infrastructure/modules/cloud_run.py:138` 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 (28 lines × 2) backend/api/routes/file_upload.py:644— backend/api/routes/file_upload.py:644-671 | backend/api/routes/file_upload.py:1366-1393 — both copies are in the same file, so extract the 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 (27–28 lines × 2) backend/api/routes/file_upload.py:2813— backend/api/routes/file_upload.py:2813-2840 | backend/api/routes/file_upload.py:2894-2920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/api/routes/file_upload.py:2813` 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–28 lines × 2) REDACTED:1790— REDACTED:1790-1817 | REDACTED:1924-1947 — both copies are in the same file, so extract the 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 (21–26 lines × 5) backend/api/routes/internal.py:152— backend/api/routes/internal.py:152-175 | backend/api/routes/internal.py:236-259 | backend/api/routes/internal.py:321-341 | backend/api/routes/internal.py:383-404 | backend/api/routes/internal.py:424-449 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 `request` to `Request` in one and `WorkerRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/api/routes/internal.py:345` calls `get_settings` and `backend/api/routes/internal.py:180` 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 (17–25 lines × 5) backend/workers/audio_download_worker.py:694— backend/workers/audio_download_worker.py:694-715 | backend/workers/audio_worker.py:797-821 | backend/workers/lyrics_worker.py:1011-1035 | backend/workers/render_video_worker.py:1003-1019 | backend/workers/video_worker.py:2053-2077 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/workers/audio_worker.py:793` calls `URL` and `backend/workers/video_worker.py:2049` 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 (25 lines × 4) infrastructure/modules/backup.py:24— infrastructure/modules/backup.py:24-48 | infrastructure/modules/divebar_lookup.py:29-53 | infrastructure/modules/divebar_mirror.py:41-65 | infrastructure/modules/kn_data_sync.py:28-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/backup.py:24` 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–25 lines × 2) backend/api/routes/users.py:2017— backend/api/routes/users.py:2017-2039 | backend/api/routes/users.py:2058-2082 — both copies are in the same file, so extract the 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–25 lines × 2) backend/services/brand_code_service.py:176— backend/services/brand_code_service.py:176-183 | backend/services/dropbox_service.py:191-215 — 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 (22–24 lines × 3) backend/services/auth_service.py:399— backend/services/auth_service.py:399-422 | backend/services/auth_service.py:440-463 | backend/services/auth_service.py:479-500 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/services/auth_service.py:426` calls `get`, `time` and `backend/services/auth_service.py:465` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–24 lines × 2) backend/services/firestore_service.py:1052— backend/services/firestore_service.py:1052-1075 | backend/services/firestore_service.py:1221-1236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–24 lines × 2) backend/services/youtube_download_service.py:311— backend/services/youtube_download_service.py:311-334 | backend/services/youtube_download_service.py:380-401 — both copies are in the same file, so extract the 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 (26 lines × 2) backend/workers/screens_worker.py:425— backend/workers/screens_worker.py:425-450 | backend/workers/screens_worker.py:512-537 — both copies are in the same file, so extract the 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 (21–24 lines × 2) karaoke_gen/audio_fetcher.py:713— karaoke_gen/audio_fetcher.py:713-736 | karaoke_gen/audio_fetcher.py:1717-1737 — both copies are in the same file, so extract the 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 (23–24 lines × 2) karaoke_gen/audio_fetcher.py:791— karaoke_gen/audio_fetcher.py:791-813 | karaoke_gen/audio_fetcher.py:860-883 — both copies are in the same file, so extract the 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 `karaoke_gen/audio_fetcher.py:860` 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, `karaoke_gen/audio_fetcher.py:886` calls `_cleanup_transmission_torrents` and `karaoke_gen/audio_fetcher.py:815` 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 (20–24 lines × 2) karaoke_gen/lyrics_transcriber/lyrics/spotify.py:197— karaoke_gen/lyrics_transcriber/lyrics/spotify.py:197-216 | karaoke_gen/lyrics_transcriber/lyrics/spotify.py:267-290 — both copies are in the same file, so extract the 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 `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–23 lines × 2) backend/services/encoding_service.py:677— backend/services/encoding_service.py:677-698 | backend/services/encoding_service.py:1200-1222 — both copies are in the same file, so extract the 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 `backend/services/encoding_service.py:1200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–23 lines × 2) backend/services/flacfetch_client.py:632— backend/services/flacfetch_client.py:632-650 | backend/services/flacfetch_client.py:836-858 — both copies are in the same file, so extract the 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 `backend/services/flacfetch_client.py:836` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21–23 lines × 2) infrastructure/modules/backup.py:251— infrastructure/modules/backup.py:251-271 | infrastructure/modules/divebar_mirror.py:241-263 — before extracting anything, compare `infrastructure/modules/backup.py` and `infrastructure/modules/divebar_mirror.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 126 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 `infrastructure/modules/backup.py:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) karaoke_gen/utils/gen_cli.py:539— karaoke_gen/utils/gen_cli.py:539-560 | karaoke_gen/utils/gen_cli.py:653-674 | karaoke_gen/utils/gen_cli.py:1110-1131 — 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 (18–22 lines × 2) backend/api/routes/internal.py:1601— backend/api/routes/internal.py:1601-1618 | backend/api/routes/internal.py:1664-1685 — both copies are in the same file, so extract the 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, `backend/api/routes/internal.py:1620` calls `update_state_data` and `backend/api/routes/internal.py:1686` 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–22 lines × 2) backend/services/firestore_service.py:920— backend/services/firestore_service.py:920-941 | backend/services/firestore_service.py:1132-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. 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 `session` to `ReviewSession` in one and `AudioEditSession` 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 (22 lines × 2) backend/workers/render_video_worker.py:434— backend/workers/render_video_worker.py:434-455 | backend/workers/render_video_worker.py:758-779 — both copies are in the same file, so extract the 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 `backend/workers/render_video_worker.py:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/workers/render_video_worker.py:433` calls `set_attribute` and `backend/workers/render_video_worker.py:757` 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–21 lines × 12) infrastructure/modules/audio_separator_service.py:99— infrastructure/modules/audio_separator_service.py:99-117 | infrastructure/modules/backup.py:38-55 | infrastructure/modules/divebar_lookup.py:43-61 | infrastructure/modules/divebar_mirror.py:55-73 | infrastructure/modules/iam/backend_sa.py:44-62 | infrastructure/modules/iam/backend_sa.py:117-137 | infrastructure/modules/iam/claude_automation_sa.py:50-68 | infrastructure/modules/iam/github_actions_sa.py:93-111 | infrastructure/modules/iam/github_actions_sa.py:195-215 | infrastructure/modules/iam/worker_sas.py:42-56 | infrastructure/modules/iam/worker_sas.py:158-176 | infrastructure/modules/kn_data_sync.py:42-60 — there are 12 copies across 9 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 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/audio_separator_service.py:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (19–21 lines × 4) karaoke_gen/utils/remote_cli.py:332— karaoke_gen/utils/remote_cli.py:332-350 | karaoke_gen/utils/remote_cli.py:547-567 | karaoke_gen/utils/remote_cli.py:837-857 | karaoke_gen/utils/remote_cli.py:1232-1252 — 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 (19–21 lines × 3) REDACTED:2494— REDACTED:2494-2514 | REDACTED:2534-2552 | REDACTED:2568-2586 — 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:2494` 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, `REDACTED:2492` calls `t` and `REDACTED:2532` 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 (18–21 lines × 2) backend/api/routes/file_upload.py:2090— backend/api/routes/file_upload.py:2090-2107 | backend/api/routes/file_upload.py:2420-2440 — both copies are in the same file, so extract the 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 `backend/api/routes/file_upload.py:2420` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–21 lines × 2) backend/api/routes/push.py:134— backend/api/routes/push.py:134-154 | backend/api/routes/push.py:276-290 — both copies are in the same file, so extract the 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 `auth_result` to `AuthResult = Depends(require_auth)` in one and `AuthResult = Depends(require_admin)` 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–20 lines × 4) backend/api/routes/file_upload.py:915— backend/api/routes/file_upload.py:915-934 | karaoke_gen/utils/remote_cli.py:352-367 | karaoke_gen/utils/remote_cli.py:565-580 | karaoke_gen/utils/remote_cli.py:1248-1263 — 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.
Duplicated block (20 lines × 4) infrastructure/modules/cloud_run.py:121— infrastructure/modules/cloud_run.py:121-144 | infrastructure/modules/cloud_run.py:449-473 | infrastructure/modules/cloud_run.py:592-611 | infrastructure/modules/cloud_run.py:737-762 — 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 `infrastructure/modules/cloud_run.py:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) backend/services/encoding_service.py:1012— backend/services/encoding_service.py:1012-1030 | backend/services/encoding_service.py:1144-1163 — both copies are in the same file, so extract the 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 `backend/services/encoding_service.py:1012` 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 (19 lines × 3) backend/services/worker_service.py:249— backend/services/worker_service.py:249-272 | backend/services/worker_service.py:946-964 | backend/services/worker_service.py:1040-1058 — 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 (18–19 lines × 2) backend/services/push_notification_service.py:263— backend/services/push_notification_service.py:263-281 | backend/services/push_notification_service.py:338-355 — both copies are in the same file, so extract the 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 (16–19 lines × 2) backend/workers/video_worker.py:317— backend/workers/video_worker.py:317-332 | backend/workers/video_worker.py:979-997 — both copies are in the same file, so extract the 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, `backend/workers/video_worker.py:976` calls `warning` and `backend/workers/video_worker.py:314` 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 (17–19 lines × 2) infrastructure/modules/iam/backend_sa.py:97— infrastructure/modules/iam/backend_sa.py:97-115 | infrastructure/modules/iam/github_actions_sa.py:162-178 — before extracting anything, compare `infrastructure/modules/iam/backend_sa.py` and `infrastructure/modules/iam/github_actions_sa.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `infrastructure/modules/iam/backend_sa.py:97` 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 (18 lines × 3) infrastructure/modules/cloud_tasks.py:112— infrastructure/modules/cloud_tasks.py:112-129 | infrastructure/modules/cloud_tasks.py:130-147 | infrastructure/modules/cloud_tasks.py:148-166 — 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 `infrastructure/modules/cloud_tasks.py:112` 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 (17–18 lines × 2) backend/api/routes/admin.py:3622— backend/api/routes/admin.py:3622-3639 | backend/api/routes/admin.py:3851-3867 — both copies are in the same file, so extract the 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 `backend/api/routes/admin.py:3622` 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 (16–18 lines × 2) backend/services/youtube_quota_service.py:265— backend/services/youtube_quota_service.py:265-282 | backend/services/youtube_quota_service.py:288-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–17 lines × 3) backend/api/routes/audio_search.py:742— backend/api/routes/audio_search.py:742-757 | backend/api/routes/file_upload.py:658-674 | backend/api/routes/file_upload.py:1380-1396 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15–17 lines × 2) backend/services/job_notification_service.py:266— backend/services/job_notification_service.py:266-280 | backend/services/job_notification_service.py:502-518 — both copies are in the same file, so extract the 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 `backend/services/job_notification_service.py:266` 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, `backend/services/job_notification_service.py:264` calls `send_youtube_upload_complete` and `backend/services/job_notification_service.py:500` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 3) infrastructure/modules/backup.py:75— infrastructure/modules/backup.py:75-90 | infrastructure/modules/divebar_mirror.py:68-84 | infrastructure/modules/kn_data_sync.py:63-78 — before extracting anything, compare `infrastructure/modules/backup.py` and `infrastructure/modules/divebar_mirror.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 126 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 `infrastructure/modules/backup.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) karaoke_gen/audio_processor.py:680— karaoke_gen/audio_processor.py:680-695 | karaoke_gen/audio_processor.py:761-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–16 lines × 2) karaoke_gen/lyrics_transcriber/correction/corrector.py:688— karaoke_gen/lyrics_transcriber/correction/corrector.py:688-695 | karaoke_gen/lyrics_transcriber/correction/corrector.py:742-757 — both copies are in the same file, so extract the 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 `karaoke_gen/lyrics_transcriber/correction/corrector.py:688` 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 × 4) backend/services/email_validation_service.py:585— backend/services/email_validation_service.py:585-599 | backend/services/email_validation_service.py:656-670 | backend/services/email_validation_service.py:727-741 | backend/services/email_validation_service.py:798-812 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 2) backend/services/audio_search_service.py:85— backend/services/audio_search_service.py:85-99 | scripts/karaokehunt_outreach/phase1b_audio_search.py:138-151 — 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 (8–15 lines × 2) backend/services/gdrive_service.py:153— backend/services/gdrive_service.py:153-167 | scripts/cleanup_test_job_gdrive.py:70-77 — 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 `backend/services/gdrive_service.py:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 4) infrastructure/modules/backup.py:75— infrastructure/modules/backup.py:75-88 | infrastructure/modules/divebar_lookup.py:56-69 | infrastructure/modules/divebar_mirror.py:68-82 | infrastructure/modules/kn_data_sync.py:63-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/backup.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–14 lines × 3) REDACTED:1365— REDACTED:1365-1375 | REDACTED:1393-1406 | REDACTED:1436-1449 — 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:1393` 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 `request` to `EncodePreviewRequest` in one and `RenderVideoRequest` 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–14 lines × 3) karaoke_gen/utils/remote_cli.py:725— karaoke_gen/utils/remote_cli.py:725-738 | karaoke_gen/utils/remote_cli.py:740-753 | karaoke_gen/utils/remote_cli.py:754-765 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note 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, `karaoke_gen/utils/remote_cli.py:725` calls `exists` and `karaoke_gen/utils/remote_cli.py:754` 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–13 lines × 6) backend/api/routes/jobs.py:1039— backend/api/routes/jobs.py:1039-1046 | backend/api/routes/jobs.py:1112-1124 | backend/api/routes/jobs.py:1165-1172 | backend/api/routes/jobs.py:1315-1321 | backend/api/routes/jobs.py:1402-1408 | backend/api/routes/jobs.py:1681-1688 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `auth_result` to `AuthResult = Depends(require_auth)` in one and `AuthResult` 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 (13 lines × 6) karaoke_gen/utils/remote_cli.py:339— karaoke_gen/utils/remote_cli.py:339-351 | karaoke_gen/utils/remote_cli.py:361-375 | karaoke_gen/utils/remote_cli.py:556-568 | karaoke_gen/utils/remote_cli.py:574-588 | karaoke_gen/utils/remote_cli.py:846-858 | karaoke_gen/utils/remote_cli.py:1241-1253 — 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.
Duplicated block (13 lines × 4) REDACTED:1685— REDACTED:1685-1699 | REDACTED:2494-2508 | REDACTED:2534-2546 | REDACTED:2568-2580 — 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, `REDACTED:2492` calls `t` and `REDACTED:2532` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) infrastructure/modules/monitoring.py:377— infrastructure/modules/monitoring.py:377-390 | infrastructure/modules/monitoring.py:554-566 | infrastructure/modules/monitoring.py:651-663 — 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 `infrastructure/modules/monitoring.py:377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 5) karaoke_gen/pipeline/stages/finalize.py:191— karaoke_gen/pipeline/stages/finalize.py:191-202 | karaoke_gen/pipeline/stages/render.py:139-150 | karaoke_gen/pipeline/stages/screens.py:128-139 | karaoke_gen/pipeline/stages/separation.py:139-150 | karaoke_gen/pipeline/stages/transcription.py:180-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `karaoke_gen/pipeline/stages/finalize.py:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 4) backend/services/email_validation_service.py:559— backend/services/email_validation_service.py:559-570 | backend/services/email_validation_service.py:638-648 | backend/services/email_validation_service.py:709-719 | backend/services/email_validation_service.py:780-790 — 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 (12 lines × 3) karaoke_gen/lyrics_transcriber/output/ass/ass.py:1330— karaoke_gen/lyrics_transcriber/output/ass/ass.py:1330-1341 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1888-1899 | karaoke_gen/lyrics_transcriber/output/ass/ass.py:1989-2000 — 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 (8–12 lines × 2) backend/api/routes/jobs.py:2652— backend/api/routes/jobs.py:2652-2659 | backend/api/routes/jobs.py:2676-2687 — both copies are in the same file, so extract the 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–12 lines × 2) karaoke_gen/utils/remote_cli.py:3058— karaoke_gen/utils/remote_cli.py:3058-3066 | karaoke_gen/utils/remote_cli.py:3192-3203 — both copies are in the same file, so extract the 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 × 13) infrastructure/modules/audio_separator_service.py:102— infrastructure/modules/audio_separator_service.py:102-112 | infrastructure/modules/backup.py:41-51 | infrastructure/modules/divebar_lookup.py:46-56 | infrastructure/modules/divebar_mirror.py:58-68 | infrastructure/modules/iam/backend_sa.py:47-57 | infrastructure/modules/iam/backend_sa.py:123-133 | infrastructure/modules/iam/claude_automation_sa.py:53-63 | infrastructure/modules/iam/github_actions_sa.py:96-106 | infrastructure/modules/iam/github_actions_sa.py:201-211 | infrastructure/modules/iam/worker_sas.py:40-50 | infrastructure/modules/iam/worker_sas.py:161-171 | infrastructure/modules/kn_data_sync.py:45-55 | infrastructure/modules/runner_manager.py:97-107 — there are 13 copies across 10 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 13 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/audio_separator_service.py:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 7) infrastructure/modules/audio_separator_service.py:120— infrastructure/modules/audio_separator_service.py:120-130 | infrastructure/modules/iam/backend_sa.py:133-143 | infrastructure/modules/iam/claude_automation_sa.py:95-105 | infrastructure/modules/iam/github_actions_sa.py:219-229 | infrastructure/modules/iam/worker_sas.py:66-78 | infrastructure/modules/iam/worker_sas.py:179-189 | infrastructure/modules/runner_manager.py:99-109 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `infrastructure/modules/audio_separator_service.py:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) karaoke_gen/utils/remote_cli.py:2025— karaoke_gen/utils/remote_cli.py:2025-2035 | karaoke_gen/utils/remote_cli.py:2065-2075 | karaoke_gen/utils/remote_cli.py:2087-2097 — 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 before the matched lines, `karaoke_gen/utils/remote_cli.py:2063` calls `Path` and `karaoke_gen/utils/remote_cli.py:2086` 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–11 lines × 2) infrastructure/functions/divebar_lookup/main.py:697— infrastructure/functions/divebar_lookup/main.py:697-707 | infrastructure/functions/divebar_mirror/main.py:78-84 — 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 `infrastructure/functions/divebar_lookup/main.py:697` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) karaoke_gen/instrumental_review/analyzer.py:204— karaoke_gen/instrumental_review/analyzer.py:204-214 | karaoke_gen/instrumental_review/waveform.py:330-339 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 5) karaoke_gen/utils/remote_cli.py:381— karaoke_gen/utils/remote_cli.py:381-390 | karaoke_gen/utils/remote_cli.py:592-601 | karaoke_gen/utils/remote_cli.py:641-650 | karaoke_gen/utils/remote_cli.py:864-873 | karaoke_gen/utils/remote_cli.py:912-921 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 4) REDACTED:1424— REDACTED:1424-1432 | REDACTED:1770-1779 | REDACTED:1904-1912 | REDACTED:2040-2049 — 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, `REDACTED:2037` calls `get_settings`, `to_thread` and `REDACTED:1422` 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–10 lines × 3) backend/services/job_health_service.py:127— backend/services/job_health_service.py:127-136 | backend/services/job_health_service.py:142-151 | backend/services/job_health_service.py:159-165 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note 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, `backend/services/job_health_service.py:127` calls `now` and `backend/services/job_health_service.py:159` 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 × 14) backend/api/routes/jobs.py:222— backend/api/routes/jobs.py:222-230 | backend/api/routes/jobs.py:1031-1044 | backend/api/routes/jobs.py:1105-1117 | backend/api/routes/jobs.py:1155-1170 | backend/api/routes/jobs.py:1256-1270 | backend/api/routes/jobs.py:1307-1319 | backend/api/routes/jobs.py:1667-1686 | backend/api/routes/jobs.py:1761-1784 | backend/api/routes/jobs.py:1829-1842 | backend/api/routes/jobs.py:2060-2072 | backend/api/routes/jobs.py:2101-2123 | backend/api/routes/jobs.py:2511-2524 | backend/api/routes/jobs.py:2560-2589 | backend/api/routes/jobs.py:3324-3346 — all 14 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 × 3) backend/api/routes/file_upload.py:648— backend/api/routes/file_upload.py:648-655 | backend/api/routes/file_upload.py:1370-1377 | backend/api/routes/file_upload.py:2108-2115 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) backend/models/audio_edit_session.py:84— backend/models/audio_edit_session.py:84-90 | backend/models/review_session.py:82-88 | backend/models/worker_log.py:143-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 5) REDACTED:3137— REDACTED:3137-3143 | REDACTED:3240-3246 | REDACTED:3291-3297 | REDACTED:3351-3357 | REDACTED:3470-3476 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) backend/services/firestore_service.py:272— backend/services/firestore_service.py:272-279 | backend/services/firestore_service.py:384-390 | backend/services/firestore_service.py:442-448 — 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 before the matched lines, `backend/services/firestore_service.py:269` calls `where`, `FieldFilter` and `backend/services/firestore_service.py:440` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 7) backend/api/routes/jobs.py:1038— backend/api/routes/jobs.py:1038-1044 | backend/api/routes/jobs.py:1111-1117 | backend/api/routes/jobs.py:1164-1170 | backend/api/routes/jobs.py:1314-1319 | backend/api/routes/jobs.py:1401-1406 | backend/api/routes/jobs.py:1680-1686 | backend/api/routes/jobs.py:2117-2123 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `auth_result` to `AuthResult = Depends(require_auth)` in one and `AuthResult` 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.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×1
Edited copies of one member (3 members, 2+ corresponding lines) scripts/karaokehunt_outreach/phase1c_recanonicalize.py:75— scripts/karaokehunt_outreach/phase1c_recanonicalize.py:75-76 | scripts/karaokehunt_outreach/phase_batch_generate.py:56-57 | scripts/karaokehunt_outreach/torrent_review.py:52-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 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, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) scripts/karaokehunt_outreach/phase1b_audio_search.py:248— scripts/karaokehunt_outreach/phase1b_audio_search.py:248-250 | scripts/karaokehunt_outreach/phase2_execute.py:98-100 | scripts/karaokehunt_outreach/phase_batch_generate.py:89-91 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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 (42–43 lines × 2) scripts/setup-singa-tenant.py:194— scripts/setup-singa-tenant.py:194-236 | scripts/setup-singa-tenant.py:260-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/setup-singa-tenant.py:194` 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 (45–47 lines × 2) scripts/karaokehunt_outreach/phase1_analyze.py:142— scripts/karaokehunt_outreach/phase1_analyze.py:142-188 | scripts/karaokehunt_outreach/phase1b_audio_search.py:339-383 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `community` to `list[dict]` in one and `list` 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–23 lines × 2) scripts/analyze_reference_relevance.py:53— scripts/analyze_reference_relevance.py:53-75 | scripts/review_reference_relevance.py:50-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (17–21 lines × 2) scripts/karaokehunt_outreach/phase1_analyze.py:182— scripts/karaokehunt_outreach/phase1_analyze.py:182-202 | scripts/karaokehunt_outreach/phase1b_audio_search.py:399-415 — 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 `scripts/karaokehunt_outreach/phase1_analyze.py:182` 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 (26–28 lines × 2) scripts/analyze_reference_relevance.py:290— scripts/analyze_reference_relevance.py:290-317 | scripts/review_reference_relevance.py:1064-1089 — 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 `scripts/analyze_reference_relevance.py:290` 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 (15–19 lines × 2) scripts/cleanup_test_job_gdrive.py:95— scripts/cleanup_test_job_gdrive.py:95-113 | scripts/cleanup_test_job_gdrive.py:154-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/cleanup_test_job_gdrive.py:114` calls `debug` and `scripts/cleanup_test_job_gdrive.py:169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–15 lines × 2) scripts/setup-singa-tenant.py:724— scripts/setup-singa-tenant.py:724-736 | scripts/setup-vocalstar-tenant.py:356-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/setup-singa-tenant.py:724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 3) scripts/analyze_reference_relevance.py:56— scripts/analyze_reference_relevance.py:56-66 | scripts/measure_autocorrect_cost.py:89-98 | scripts/review_reference_relevance.py:51-60 — 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.
Low cohesion: FlacfetchClient (LCOM4 5) backend/services/flacfetch_client.py:164— FlacfetchClient'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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for frontend/ refused the committed lockfile (ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
P12 · CI test-gate honesty· Runner config excludes tests no gate runs · ×1
Runner config excludes tests no gate runs frontend/jest.config.js:21— `/e2e/` removes 133 test(s) in 35 file(s) (e.g. `frontend/e2e/lyrics-review-test.spec.ts`, `frontend/e2e/fixtures/review-fixtures.spec.ts`) from what jest collects, and no other runner or CI command runs them — they are dead tests. Run them (another runner, project or job), or delete them.
Duplication concentrated across 4 sibling directories (39 clone groups) frontend/components/ui/use-toast.ts:4— 39 duplicated blocks under frontend/ have copies in at least two of the sibling directories app, components, hooks, lib — 15 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 13 sibling directories (33 clone groups) frontend/app/admin/audio-edits/page.tsx:212— 33 duplicated blocks under frontend/app/admin/ have copies in at least two of the sibling directories abuse, audio-edits, community-requests, community-reviews, edit-reviews, feedback (+7 more sibling(s) not listed) — 17 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 9 sibling directories (32 clone groups) frontend/components/audio-editor/AudioEditor.tsx:76— 32 duplicated blocks under frontend/components/ have copies in at least two of the sibling directories admin, audio-editor, audio-search, credits, feedback, instrumental-review (+3 more sibling(s) not listed) — 8 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 32 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 32 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 32 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (199 matched lines × 2 locations) · ×1
Duplicated block with local edits (199 matched lines × 2 locations) frontend/app/admin/audio-edits/page.tsx:212— frontend/app/admin/audio-edits/page.tsx:212 · frontend/app/admin/edit-reviews/page.tsx:357 — the two spans are one implementation copied and then locally edited — 1162 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (172 matched lines × 2 locations) · ×1
Duplicated block with local edits (172 matched lines × 2 locations) frontend/components/audio-editor/AudioEditor.tsx:76— frontend/components/audio-editor/AudioEditor.tsx:76 · frontend/components/instrumental-review/WaveformViewer.tsx:29 — the two spans are one implementation copied and then locally edited — 1136 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (116 lines × 2 locations) frontend/components/ui/context-menu.tsx:110— frontend/components/ui/context-menu.tsx:110 · frontend/components/ui/menubar.tsx:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (108 matched lines × 2 locations) · ×1
Duplicated block with local edits (108 matched lines × 2 locations) frontend/components/ui/item.tsx:8— frontend/components/ui/item.tsx:8 · frontend/components/ui/sidebar.tsx:346 — the two spans are one implementation copied and then locally edited — 394 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (103 identical lines × 2 files) frontend/components/ui/use-toast.ts:4— frontend/components/ui/use-toast.ts:4 · frontend/hooks/use-toast.ts:4 — these 2 files are line-for-line copies of one another — 103 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (96 lines × 2 locations) frontend/components/ui/dropdown-menu.tsx:131— frontend/components/ui/dropdown-menu.tsx:131 · frontend/components/ui/menubar.tsx:149 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (95 matched lines × 2 locations) · ×1
Duplicated block with local edits (95 matched lines × 2 locations) frontend/components/ui/drawer.tsx:8— frontend/components/ui/drawer.tsx:8 · frontend/components/ui/sheet.tsx:9 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (89 identical lines × 2 files) frontend/public/sw.js:9— frontend/public/sw.js:9 · karaoke_gen/nextjs_frontend/sw.js:9 — these 2 files are line-for-line copies of one another — 89 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (79 lines × 2 locations) frontend/components/job/steps/CustomizeStep.tsx:583— frontend/components/job/steps/CustomizeStep.tsx:583 · frontend/components/job/steps/CustomizeStep.tsx:670 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (66 matched lines × 2 locations) · ×1
Duplicated block with local edits (66 matched lines × 2 locations) frontend/app/admin/searches/page.tsx:87— frontend/app/admin/searches/page.tsx:87 · REDACTED:124 — the two spans are one implementation copied and then locally edited — 286 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (63 lines × 2 locations) frontend/app/admin/referrals/page.tsx:288— frontend/app/admin/referrals/page.tsx:288 · frontend/app/admin/referrals/page.tsx:628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (63 matched lines × 2 locations) · ×1
Duplicated block with local edits (63 matched lines × 2 locations) frontend/components/job/KaraokeBackgroundPreview.tsx:50— frontend/components/job/KaraokeBackgroundPreview.tsx:50 · frontend/components/job/TitleCardPreview.tsx:151 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) frontend/components/auth/AuthDialog.tsx:86— frontend/components/auth/AuthDialog.tsx:86 · frontend/components/auth/AuthDialog.tsx:199 — the two spans are one implementation copied and then locally edited — 276 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (59 matched lines × 2 locations) · ×1
Duplicated block with local edits (59 matched lines × 2 locations) frontend/hooks/useManualSync.ts:252— frontend/hooks/useManualSync.ts:252 · frontend/hooks/useManualSync.ts:429 — the two spans are one implementation copied and then locally edited — 354 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (53 matched lines × 2 locations) · ×1
Duplicated block with local edits (53 matched lines × 2 locations) frontend/app/[locale]/order/success/page.tsx:12— frontend/app/[locale]/order/success/page.tsx:12 · frontend/app/[locale]/payment/success/page.tsx:26 — the two spans are one implementation copied and then locally edited — 261 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) frontend/app/admin/community-requests/page.tsx:32— frontend/app/admin/community-requests/page.tsx:32 · frontend/app/admin/community-reviews/page.tsx:19 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) REDACTED:2264— REDACTED:2264 · REDACTED:391 — the two spans are one implementation copied and then locally edited — 278 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (48 lines × 3 locations) frontend/components/job/JobSubmission.tsx:416— frontend/components/job/JobSubmission.tsx:416 · frontend/components/job/JobSubmission.tsx:515 · frontend/components/job/JobSubmission.tsx:660 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (46 lines × 2 locations) frontend/components/job/GuidedJobFlow.tsx:307— frontend/components/job/GuidedJobFlow.tsx:307 · frontend/components/job/TenantJobFlow.tsx:128 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (43 lines × 2 locations) REDACTED:404— REDACTED:404 · REDACTED:466 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (42 lines × 2 locations) frontend/components/ui/avatar.tsx:8— frontend/components/ui/avatar.tsx:8 · frontend/components/ui/tabs.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (42 matched lines × 2 locations) · ×1
Duplicated block with local edits (42 matched lines × 2 locations) frontend/lib/api.ts:3681— frontend/lib/api.ts:3681 · frontend/lib/api.ts:3749 — the two spans are one implementation copied and then locally edited — 434 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) frontend/hooks/use-audio-edit-autosave.ts:32— frontend/hooks/use-audio-edit-autosave.ts:32 · frontend/hooks/use-review-session-autosave.ts:56 — the two spans are one implementation copied and then locally edited — 194 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (37 lines × 2 locations) frontend/test-brand-screenshots.mjs:27— frontend/test-brand-screenshots.mjs:27 · frontend/test-brand-screenshots.mjs:91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) frontend/app/admin/payments/page.tsx:156— frontend/app/admin/payments/page.tsx:156 · frontend/app/admin/payments/page.tsx:720 — the two spans are one implementation copied and then locally edited — 205 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (33 lines × 4 locations) frontend/app/admin/rate-limits/page.tsx:494— frontend/app/admin/rate-limits/page.tsx:494 · frontend/app/admin/rate-limits/page.tsx:554 · frontend/app/admin/rate-limits/page.tsx:614 · frontend/app/admin/rate-limits/page.tsx:673 — 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 (32 lines × 3 locations) frontend/components/ui/context-menu.tsx:54— frontend/components/ui/context-menu.tsx:54 · frontend/components/ui/dropdown-menu.tsx:199 · frontend/components/ui/menubar.tsx:217 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 2 locations) REDACTED:774— REDACTED:774 · REDACTED:525 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (25 lines × 3 locations) frontend/components/ui/alert-dialog.tsx:89— frontend/components/ui/alert-dialog.tsx:89 · frontend/components/ui/drawer.tsx:90 · frontend/components/ui/sheet.tsx:96 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function AdminJobsPageContent (cyclomatic 143, cognitive 177) REDACTED:139— AdminJobsPageContent has cyclomatic complexity 143 and cognitive complexity 177; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 127, cognitive 262) frontend/e2e/production/happy-path-real-user.spec.ts:250— (anonymous) has cyclomatic complexity 127 and cognitive complexity 262; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function LyricsAnalyzer (cyclomatic 102, cognitive 79) frontend/components/lyrics-review/LyricsAnalyzer.tsx:144— LyricsAnalyzer has cyclomatic complexity 102 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function OutputLinks (cyclomatic 97, cognitive 65) frontend/components/job/OutputLinks.tsx:41— OutputLinks has cyclomatic complexity 97 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AudioEditor (cyclomatic 70, cognitive 67) frontend/components/audio-editor/AudioEditor.tsx:341— AudioEditor has cyclomatic complexity 70 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function TenantThemeEditorDialog (cyclomatic 57, cognitive 52) frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:94— TenantThemeEditorDialog has cyclomatic complexity 57 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function CustomizeStep (cyclomatic 54, cognitive 50) frontend/components/job/steps/CustomizeStep.tsx:295— CustomizeStep has cyclomatic complexity 54 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AdminUserDetailPage (cyclomatic 54, cognitive 48) REDACTED:76— AdminUserDetailPage has cyclomatic complexity 54 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Header (cyclomatic 46, cognitive 35) frontend/components/lyrics-review/Header.tsx:77— Header has cyclomatic complexity 46 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 43, cognitive 68) frontend/e2e/production/demo-recording.spec.ts:99— (anonymous) has cyclomatic complexity 43 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AppPageContent (cyclomatic 43, cognitive 37) frontend/app/[locale]/app/page.tsx:50— AppPageContent has cyclomatic complexity 43 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function JobSubmission (cyclomatic 39, cognitive 34) frontend/components/job/JobSubmission.tsx:24— JobSubmission has cyclomatic complexity 39 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RequestsBoardClient (cyclomatic 39, cognitive 33) frontend/app/[locale]/requests/client.tsx:62— RequestsBoardClient has cyclomatic complexity 39 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function LyricsReviewWrapper (cyclomatic 38, cognitive 30) frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:342— LyricsReviewWrapper has cyclomatic complexity 38 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function EditModal (cyclomatic 37, cognitive 29) frontend/components/lyrics-review/modals/EditModal.tsx:45— EditModal has cyclomatic complexity 37 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 37, cognitive 27) frontend/components/lyrics-review/shared/HighlightedText.tsx:162— (anonymous) has cyclomatic complexity 37 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function Word (cyclomatic 36, cognitive 35) · ×1
Complex function Word (cyclomatic 36, cognitive 35) frontend/components/lyrics-review/shared/Word.tsx:11— Word has cyclomatic complexity 36 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ReviewChangesModal (cyclomatic 34, cognitive 28) frontend/components/lyrics-review/modals/ReviewChangesModal.tsx:76— ReviewChangesModal has cyclomatic complexity 34 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 33, cognitive 35) frontend/e2e/production/tenant-happy-path.spec.ts:79— (anonymous) has cyclomatic complexity 33 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function BulkAlbumMode (cyclomatic 33, cognitive 29) frontend/components/job/bulk/BulkAlbumMode.tsx:208— BulkAlbumMode has cyclomatic complexity 33 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AudioSourceStep (cyclomatic 33, cognitive 21) frontend/components/job/steps/AudioSourceStep.tsx:135— AudioSourceStep has cyclomatic complexity 33 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function apiFetch (cyclomatic 32, cognitive 53) frontend/lib/api.ts:635— apiFetch has cyclomatic complexity 32 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 32, cognitive 51) frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:283— (anonymous) has cyclomatic complexity 32 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleKeyDown (cyclomatic 31, cognitive 34) frontend/lib/lyrics-review/utils/keyboardHandlers.ts:63— handleKeyDown has cyclomatic complexity 31 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function JobCard (cyclomatic 30, cognitive 21) frontend/components/job/JobCard.tsx:104— JobCard has cyclomatic complexity 30 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 29, cognitive 53) frontend/e2e/production/full-user-journey.spec.ts:139— (anonymous) has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleConfirm (cyclomatic 29, cognitive 33) frontend/components/job/GuidedJobFlow.tsx:177— handleConfirm has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getSearchConfidence (cyclomatic 28, cognitive 26) frontend/lib/audio-search-utils.ts:380— getSearchConfidence has cyclomatic complexity 28 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ReferralDashboard (cyclomatic 28, cognitive 25) frontend/components/referrals/ReferralDashboard.tsx:26— ReferralDashboard has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function categorizeResult (cyclomatic 28, cognitive 25) frontend/lib/audio-search-utils.ts:63— categorizeResult has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function InstrumentalSelector (cyclomatic 27, cognitive 28) frontend/components/instrumental-review/InstrumentalSelector.tsx:56— InstrumentalSelector has cyclomatic complexity 27 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function GuidancePanel (cyclomatic 27, cognitive 24) frontend/components/lyrics-review/GuidancePanel.tsx:32— GuidancePanel has cyclomatic complexity 27 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AdminTenantsPage (cyclomatic 26, cognitive 23) frontend/app/admin/tenants/page.tsx:126— AdminTenantsPage has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function UserEmailsCard (cyclomatic 26, cognitive 23) frontend/components/admin/user-emails-card.tsx:51— UserEmailsCard has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 26, cognitive 21) frontend/components/job/TenantBulkFlow.tsx:629— (anonymous) has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function FallbackSection (cyclomatic 26, cognitive 21) frontend/components/job/steps/AudioSourceStep.tsx:1248— FallbackSection has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SearchLyricsTab (cyclomatic 26, cognitive 19) frontend/components/lyrics-review/modals/SearchLyricsTab.tsx:21— SearchLyricsTab has cyclomatic complexity 26 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function uploadResumable (cyclomatic 25, cognitive 48) frontend/lib/resumable-upload.ts:249— uploadResumable has cyclomatic complexity 25 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function attempt (cyclomatic 25, cognitive 43) frontend/e2e/helpers/self-healing/step-runner.ts:43— attempt has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function DeleteAccountClient (cyclomatic 25, cognitive 22) frontend/app/[locale]/account/delete/client.tsx:46— DeleteAccountClient has cyclomatic complexity 25 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
frontend/lib/api.ts: 4751 lines of code frontend/lib/api.ts:1— frontend/lib/api.ts has 4751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 2274 lines of code REDACTED:1— REDACTED has 2274 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/LyricsAnalyzer.tsx · ×1
frontend/components/lyrics-review/LyricsAnalyzer.tsx: 1917 lines of code frontend/components/lyrics-review/LyricsAnalyzer.tsx:1— frontend/components/lyrics-review/LyricsAnalyzer.tsx has 1917 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/steps/AudioSourceStep.tsx · ×1
frontend/components/job/steps/AudioSourceStep.tsx: 1425 lines of code frontend/components/job/steps/AudioSourceStep.tsx:1— frontend/components/job/steps/AudioSourceStep.tsx has 1425 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/audio-editor/AudioEditor.tsx · ×1
frontend/components/audio-editor/AudioEditor.tsx: 1316 lines of code frontend/components/audio-editor/AudioEditor.tsx:1— frontend/components/audio-editor/AudioEditor.tsx has 1316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 972 lines of code REDACTED:1— REDACTED has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 891 lines of code REDACTED:1— REDACTED has 891 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/[locale]/page.tsx · ×1
frontend/app/[locale]/page.tsx: 849 lines of code frontend/app/[locale]/page.tsx:1— frontend/app/[locale]/page.tsx has 849 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx · ×1
frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx: 832 lines of code frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:1— frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx has 832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/tenant-theme/TenantThemeEditorDialog.tsx · ×1
frontend/components/tenant-theme/TenantThemeEditorDialog.tsx: 795 lines of code frontend/components/tenant-theme/TenantThemeEditorDialog.tsx:1— frontend/components/tenant-theme/TenantThemeEditorDialog.tsx has 795 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/instrumental-review/InstrumentalSelector.tsx · ×1
frontend/components/instrumental-review/InstrumentalSelector.tsx: 793 lines of code frontend/components/instrumental-review/InstrumentalSelector.tsx:1— frontend/components/instrumental-review/InstrumentalSelector.tsx has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/payments/page.tsx · ×1
frontend/app/admin/payments/page.tsx: 792 lines of code frontend/app/admin/payments/page.tsx:1— frontend/app/admin/payments/page.tsx has 792 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/tenants/page.tsx · ×1
frontend/app/admin/tenants/page.tsx: 766 lines of code frontend/app/admin/tenants/page.tsx:1— frontend/app/admin/tenants/page.tsx has 766 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/steps/CustomizeStep.tsx · ×1
frontend/components/job/steps/CustomizeStep.tsx: 749 lines of code frontend/components/job/steps/CustomizeStep.tsx:1— frontend/components/job/steps/CustomizeStep.tsx has 749 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/TenantBulkFlow.tsx · ×1
frontend/components/job/TenantBulkFlow.tsx: 738 lines of code frontend/components/job/TenantBulkFlow.tsx:1— frontend/components/job/TenantBulkFlow.tsx has 738 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx · ×1
frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx: 726 lines of code frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:1— frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx has 726 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/OutputLinks.tsx · ×1
frontend/components/job/OutputLinks.tsx: 705 lines of code frontend/components/job/OutputLinks.tsx:1— frontend/components/job/OutputLinks.tsx has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/rate-limits/page.tsx · ×1
frontend/app/admin/rate-limits/page.tsx: 694 lines of code frontend/app/admin/rate-limits/page.tsx:1— frontend/app/admin/rate-limits/page.tsx has 694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/[locale]/requests/client.tsx · ×1
frontend/app/[locale]/requests/client.tsx: 680 lines of code frontend/app/[locale]/requests/client.tsx:1— frontend/app/[locale]/requests/client.tsx has 680 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/referrals/page.tsx · ×1
frontend/app/admin/referrals/page.tsx: 677 lines of code frontend/app/admin/referrals/page.tsx:1— frontend/app/admin/referrals/page.tsx has 677 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/ui/sidebar.tsx · ×1
frontend/components/ui/sidebar.tsx: 672 lines of code frontend/components/ui/sidebar.tsx:1— frontend/components/ui/sidebar.tsx has 672 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx · ×1
frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx: 668 lines of code frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx:1— frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx has 668 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/JobSubmission.tsx · ×1
frontend/components/job/JobSubmission.tsx: 665 lines of code frontend/components/job/JobSubmission.tsx:1— frontend/components/job/JobSubmission.tsx has 665 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/edit-reviews/page.tsx · ×1
frontend/app/admin/edit-reviews/page.tsx: 649 lines of code frontend/app/admin/edit-reviews/page.tsx:1— frontend/app/admin/edit-reviews/page.tsx has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/PreviewVideoSection.tsx · ×1
frontend/components/lyrics-review/PreviewVideoSection.tsx: 593 lines of code frontend/components/lyrics-review/PreviewVideoSection.tsx:1— frontend/components/lyrics-review/PreviewVideoSection.tsx has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 585 lines of code REDACTED:1— REDACTED has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/admin/audio-edits/page.tsx · ×1
frontend/app/admin/audio-edits/page.tsx: 578 lines of code frontend/app/admin/audio-edits/page.tsx:1— frontend/app/admin/audio-edits/page.tsx has 578 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/GuidedJobFlow.tsx · ×1
frontend/components/job/GuidedJobFlow.tsx: 568 lines of code frontend/components/job/GuidedJobFlow.tsx:1— frontend/components/job/GuidedJobFlow.tsx has 568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/app/[locale]/app/page.tsx · ×1
frontend/app/[locale]/app/page.tsx: 547 lines of code frontend/app/[locale]/app/page.tsx:1— frontend/app/[locale]/app/page.tsx has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/lib/lyrics-review/types.ts · ×1
frontend/lib/lyrics-review/types.ts: 547 lines of code frontend/lib/lyrics-review/types.ts:1— frontend/lib/lyrics-review/types.ts has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/shared/HighlightedText.tsx · ×1
frontend/components/lyrics-review/shared/HighlightedText.tsx: 544 lines of code frontend/components/lyrics-review/shared/HighlightedText.tsx:1— frontend/components/lyrics-review/shared/HighlightedText.tsx has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/TimelineEditor.tsx · ×1
frontend/components/lyrics-review/TimelineEditor.tsx: 542 lines of code frontend/components/lyrics-review/TimelineEditor.tsx:1— frontend/components/lyrics-review/TimelineEditor.tsx has 542 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/job/bulk/BulkAlbumMode.tsx · ×1
frontend/components/job/bulk/BulkAlbumMode.tsx: 525 lines of code frontend/components/job/bulk/BulkAlbumMode.tsx:1— frontend/components/job/bulk/BulkAlbumMode.tsx has 525 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/hooks/useManualSync.ts · ×1
frontend/hooks/useManualSync.ts: 516 lines of code frontend/hooks/useManualSync.ts:1— frontend/hooks/useManualSync.ts has 516 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/modals/EditModal.tsx · ×1
frontend/components/lyrics-review/modals/EditModal.tsx: 514 lines of code frontend/components/lyrics-review/modals/EditModal.tsx:1— frontend/components/lyrics-review/modals/EditModal.tsx has 514 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/referrals/ReferralDashboard.tsx · ×1
frontend/components/referrals/ReferralDashboard.tsx: 492 lines of code frontend/components/referrals/ReferralDashboard.tsx:1— frontend/components/referrals/ReferralDashboard.tsx has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx · ×1
frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx: 462 lines of code frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx:1— frontend/components/lyrics-review/modals/ReplaceAllLyricsModal.tsx has 462 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/lib/audio-search-utils.ts · ×1
frontend/lib/audio-search-utils.ts: 461 lines of code frontend/lib/audio-search-utils.ts:1— frontend/lib/audio-search-utils.ts has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
frontend/lib/job-status.ts: 459 lines of code frontend/lib/job-status.ts:1— frontend/lib/job-status.ts has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· frontend/components/audio-search/AudioSearchDialog.tsx · ×1
frontend/components/audio-search/AudioSearchDialog.tsx: 458 lines of code frontend/components/audio-search/AudioSearchDialog.tsx:1— frontend/components/audio-search/AudioSearchDialog.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
No typecheck script — test ✓ · lint ✓ · typecheck ✗ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R6 · Tooling· Type errors in this package cannot fail any build or CI step · ×1
Type errors in this package cannot fail any build or CI step frontend/next.config.mjs:35— `frontend` is TypeScript, but a type error in it cannot fail anything this repository runs: its Next.js config sets `typescript.ignoreBuildErrors: true`, so `next build` — the one step that would run the type checker — passes over type errors, and no script, config or CI step of the package runs `tsc` instead. Add a type check that can fail — a `typecheck` script running `tsc --noEmit` (or `vue-tsc`/`svelte-check`) that CI or the workspace pipeline runs, or a build step that checks before it bundles.
Dead file (~715 LoC) frontend/components/job/JobSubmission.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~276 LoC) frontend/components/ui/menubar.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~260 LoC) frontend/components/push-settings.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~252 LoC) frontend/components/ui/context-menu.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~244 LoC) frontend/components/ui/field.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~241 LoC) frontend/components/ui/carousel.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~231 LoC) frontend/components/ui/autocomplete-input.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (frontend/components/job/JobSubmission.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~213 LoC) frontend/components/ui/calendar.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~196 LoC) frontend/components/job/ColorOverrides.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~193 LoC) frontend/components/ui/item.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~191 LoC) frontend/components/ui/use-toast.ts— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~190 LoC) frontend/components/job/ThemeSelector.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~169 LoC) frontend/components/ui/input-group.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~167 LoC) frontend/components/ui/form.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~166 LoC) frontend/components/ui/navigation-menu.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~156 LoC) frontend/test-brand-screenshots.mjs— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~152 LoC) REDACTED— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~127 LoC) frontend/components/ui/pagination.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~106 LoC) frontend/components/auth-banner.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~104 LoC) frontend/components/ui/empty.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~101 LoC) frontend/jest.setup.js— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~83 LoC) frontend/components/ui/button-group.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~79 LoC) frontend/functions/[[path]].ts— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~78 LoC) REDACTED— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~57 LoC) frontend/components/status-badge.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~56 LoC) frontend/components/ui/resizable.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~53 LoC) frontend/components/ui/avatar.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~45 LoC) frontend/components/ui/radio-group.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~43 LoC) infrastructure/cloudflare/kjbox-cc-well-known/worker.js— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~30 LoC) frontend/components/protected-route.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~28 LoC) frontend/components/ui/kbd.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~19 LoC) frontend/components/ui/use-mobile.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~16 LoC) frontend/lib/lyrics-review/index.ts— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~11 LoC) frontend/components/ui/aspect-ratio.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~5 LoC) frontend/components/logo.tsx— no import path from any entry point (165 application, 20 tooling, 236 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@hookform/resolvers' REDACTED:36— Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@vercel/analytics' REDACTED:65— Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'date-fns' REDACTED:70— Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'tailwindcss-animate' REDACTED:89— Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X1 · Async correctness· Task from `loop.create_task` is not kept · ×1
Task from `loop.create_task` is not kept backend/api/routes/rate_limits.py:339— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X1 · Async correctness· Task from `asyncio.create_task` is not kept · ×1
Task from `asyncio.create_task` is not kept REDACTED:3560— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X25 · Inert configuration knob· Option is kept and never read · ×1
Option is kept and never read frontend/hooks/use-review-session-autosave.ts:54— `useReviewSessionAutoSave` accepts `jobId` from the caller and keeps it in `jobId` on line 54, where only it can read the value — but nothing ever reads `jobId`. Setting `jobId` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `jobId` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `jobId` from the accepted options so callers stop setting a knob that does nothing.
redundant comment frontend/__tests__/DurationCostConfirm.test.tsx:115— "t('estimatedLabel') → "Estimated — final cost confirmed after download"" repeats the code it sits on: 5 of its 6 words (estimated, final, cost, confirmed, download) are already in `expect(screen.getByText('Estimated — final cost confirmed after download')).toBeInTheDocument()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/__tests__/tenant-job-flow.test.tsx:215— "The component checks: find(u => u.file_type === "audio")" repeats the code it sits on: 5 of its 6 words (checks, find, file, type, audio) are already in `const audioUrl = response.upload_urls.find((u: any) => u.file_type === 'audio')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:100— "Create mock job for local mode" repeats the code it sits on: 4 of its 5 words (create, job, local, mode) are already in `const localJob = createLocalModeJob({ routeType: localRouteType }) as Job`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/app/[locale]/app/jobs/[[...slug]]/client.tsx:360— "Create the API client for this job" repeats the code it sits on: 4 of its 4 words (create, api, client, job) are already in `const apiClient = createLyricsReviewApiClient(job.job_id)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/app/[locale]/page.tsx:69— "Auth dialog state" repeats the code it sits on: 3 of its 3 words (auth, dialog, state) are already in `const [showAuthDialog, setShowAuthDialog] = useState(false);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/app/admin/audio-edits/page.tsx:223— "Detail dialog state" repeats the code it sits on: 3 of its 3 words (detail, dialog, state) are already in `const [detailDialogOpen, setDetailDialogOpen] = useState(false)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment REDACTED:162— 8 comments in this file only repeat the code they sit on (lines 162, 187, 322, 370, 442, 605, 790, 808), for example "Logs modal state". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment REDACTED:95— "Credit dialog state" repeats the code it sits on: 3 of its 3 words (credit, dialog, state) are already in `const [creditDialogOpen, setCreditDialogOpen] = useState(false)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/audio-editor/__tests__/AudioEditor.test.tsx:12— "Mock next/link" repeats the code it sits on: 3 of its 3 words (mock, next, link) are already in `jest.mock("next/link", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/audio-editor/__tests__/AudioEditor.test.tsx:19— "Mock next/image" repeats the code it sits on: 3 of its 3 words (mock, next, image) are already in `jest.mock("next/image", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/audio-editor/__tests__/AudioEditor.test.tsx:25— "Mock ThemeToggle" repeats the code it sits on: 3 of its 3 words (mock, theme, toggle) are already in `jest.mock("@/components/ThemeToggle", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/audio-editor/__tests__/AudioEditor.test.tsx:30— "Mock auto-save hook" repeats the code it sits on: 4 of its 4 words (mock, auto, save, hook) are already in `jest.mock("@/hooks/use-audio-edit-autosave", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/instrumental-review/InstrumentalSelector.tsx:39— "Map audio type to stem type for API" repeats the code it sits on: 4 of its 5 words (map, audio, type, stem) are already in `const STEM_TYPE_MAP: Record<AudioType, string> = {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/instrumental-review/InstrumentalSelector.tsx:307— "Handle audio type change" repeats the code it sits on: 4 of its 4 words (handle, audio, type, change) are already in `const handleAudioChange = useCallback(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/instrumental-review/WaveformViewer.tsx:107— "Check if in mute region" repeats the code it sits on: 3 of its 3 words (check, mute, region) are already in `const inMuteRegion = muteRegions.some(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/instrumental-review/__tests__/InstrumentalGuidancePanel.test.tsx:6— "Mock localStorage" repeats the code it sits on: 3 of its 3 words (mock, local, storage) are already in `const localStorageMock = (() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/job/GuidedJobFlow.tsx:212— "Search path — create job from search session" repeats the code it sits on: 4 of its 5 words (search, create, job, session) are already in `const response = await api.createJobFromSearch({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/job/__tests__/AudioSourceStep.test.tsx:42— "Mock BuyCreditsDialog" repeats the code it sits on: 4 of its 4 words (mock, buy, credits, dialog) are already in `jest.mock("@/components/credits/BuyCreditsDialog", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/job/steps/CustomizeStep.tsx:373— "Generate solid color blob" repeats the code it sits on: 4 of its 4 words (generate, solid, color, blob) are already in `generateSolidColorBlob(karaokeSolidColor).then(onKaraokeBackgroundChange)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/CorrectionDetailCard.tsx:57— "Get confidence variant" repeats the code it sits on: 3 of its 3 words (get, confidence, variant) are already in `const getConfidenceVariant = (confidence: number): 'destructive' | 'secondary' | 'default' =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/LyricsAnalyzer.tsx:216— "Edit log state" repeats the code it sits on: 3 of its 3 words (edit, log, state) are already in `const [editLog] = useState<EditLog>(() => createEditLog(jobId ?? 'unknown', audioHash))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/LyricsAnalyzer.tsx:224— "Session restore state" repeats the code it sits on: 3 of its 3 words (session, restore, state) are already in `const [sessionRestoreOpen, setSessionRestoreOpen] = useState(false)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/LyricsAnalyzer.tsx:761— "Show correction detail" repeats the code it sits on: 3 of its 3 words (show, correction, detail) are already in `const handleShowCorrectionDetail = useCallback(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/LyricsAnalyzer.tsx:1374— "Modal spacebar handler" repeats the code it sits on: 3 of its 3 words (modal, spacebar, handler) are already in `const handleSetModalSpacebarHandler = useCallback(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/components/lyrics-review/__tests__/GuidancePanel.test.tsx:6— "Mock localStorage" repeats the code it sits on: 3 of its 3 words (mock, local, storage) are already in `const localStorageMock = (() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Duplicated predicate REDACTED:162— `!Number.isInteger(amount) || amount < 1 || amount > 100000` appears character-identically in 2 files — REDACTED, REDACTED. 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 frontend/components/lyrics-review/EditActionBar.tsx:77— `!editedSegment || editedSegment.words.length === 0` appears character-identically in 2 files — frontend/components/lyrics-review/EditActionBar.tsx, frontend/components/lyrics-review/modals/EditModal.tsx. 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 frontend/components/lyrics-review/GuidancePanel.tsx:97— `!gapCorrections[gap.id] && gap.transcribed_word_ids.length > 0` appears character-identically in 2 files — frontend/components/lyrics-review/GuidancePanel.tsx, frontend/components/lyrics-review/LyricsAnalyzer.tsx. 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 frontend/components/job/KaraokeBackgroundPreview.tsx:64— `(typeof window !== "undefined" && window.devicePixelRatio) || 1` appears character-identically in 2 files — frontend/components/job/KaraokeBackgroundPreview.tsx, frontend/components/job/TitleCardPreview.tsx. 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 frontend/components/lyrics-review/TranscriptionView.tsx:286— `c.corrected_word_id === word.id || c.word_id === word.id` appears character-identically in 2 files — frontend/components/lyrics-review/TranscriptionView.tsx, frontend/components/lyrics-review/shared/HighlightedText.tsx. 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 frontend/components/lyrics-review/LyricsAnalyzer.tsx:765— `c.corrected_word_id === wordId || c.word_id === wordId` appears character-identically in 3 files — frontend/components/lyrics-review/LyricsAnalyzer.tsx, frontend/components/lyrics-review/shared/useWordClick.ts, frontend/lib/lyrics-review/utils/wordDecorations.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/public/sw.js:143— `client.url === fullUrl && 'focus' in client` appears character-identically in 2 files — frontend/public/sw.js, karaoke_gen/nextjs_frontend/sw.js. 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 frontend/public/sw.js:150— `client.url.startsWith(self.location.origin) && 'focus' in client` appears character-identically in 2 files — frontend/public/sw.js, karaoke_gen/nextjs_frontend/sw.js. 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 frontend/components/audio-editor/AudioEditor.tsx:545— `e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement` appears character-identically in 3 files — frontend/components/audio-editor/AudioEditor.tsx, frontend/components/instrumental-review/InstrumentalSelector.tsx, frontend/lib/lyrics-review/utils/keyboardHandlers.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/job/JobSubmission.tsx:191— `err instanceof ApiError && err.status === 402` appears character-identically in 2 files — frontend/components/job/JobSubmission.tsx, frontend/components/job/steps/AudioSourceStep.tsx. 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 frontend/components/job/steps/AudioSourceStep.tsx:230— `err instanceof DOMException && err.name === 'AbortError'` appears character-identically in 2 files — frontend/components/job/steps/AudioSourceStep.tsx, frontend/lib/auth.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/job/TenantBulkFlow.tsx:399— `err instanceof ResumableUploadError && err.permanent` appears character-identically in 2 files — frontend/components/job/TenantBulkFlow.tsx, frontend/lib/resumable-upload.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:268— `err.message || "Failed to impersonate user"` appears character-identically in 2 files — REDACTED, REDACTED. 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 frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx:252— `firstUnsyncedIndex !== -1 && firstUnsyncedIndex !== syncWordIndex` appears character-identically in 2 files — frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx, frontend/hooks/useManualSync.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/lib/crash-reporter.ts:161— `h === 'localhost' || h === '127.0.0.1' || h === '[::1]' || h === '::1'` appears character-identically in 2 files — frontend/lib/crash-reporter.ts, frontend/lib/degradation-events.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/job/JobCard.tsx:311— `modalState.phase === "open" || modalState.phase === "confirming"` appears character-identically in 2 files — frontend/components/job/JobCard.tsx, frontend/hooks/use-duration-confirm.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/public/sw.js:43— `name.startsWith('karaoke-gen-') && name !== STATIC_CACHE` appears character-identically in 2 files — frontend/public/sw.js, karaoke_gen/nextjs_frontend/sw.js. 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 frontend/lib/api.ts:26— `process.env.NEXT_PUBLIC_API_URL || 'https://api.nomadkaraoke.com'` appears character-identically in 2 files — frontend/lib/api.ts, frontend/lib/degradation-events.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/system-status-modal.tsx:232— `process.env.NEXT_PUBLIC_APP_VERSION || "dev"` appears character-identically in 2 files — frontend/components/system-status-modal.tsx, frontend/components/version-footer.tsx. 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 frontend/lib/degradation-events.ts:192— `process.env.NEXT_PUBLIC_COMMIT_SHA || ''` appears character-identically in 2 files — frontend/lib/degradation-events.ts, frontend/next.config.mjs. 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 frontend/hooks/use-audio-edit-autosave.ts:70— `result.status === 'saved' || result.status === 'skipped'` appears character-identically in 2 files — frontend/hooks/use-audio-edit-autosave.ts, frontend/hooks/use-review-session-autosave.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/job/steps/AudioSourceStep.tsx:80— `seeders === undefined || seeders === null` appears character-identically in 2 files — frontend/components/job/steps/AudioSourceStep.tsx, frontend/lib/audio-search-utils.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:633— `status === "complete" || status === "prep_complete"` appears character-identically in 2 files — REDACTED, frontend/app/admin/searches/page.tsx. 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 frontend/components/ui/use-toast.ts:106— `t.id === toastId || toastId === undefined` appears character-identically in 2 files — frontend/components/ui/use-toast.ts, frontend/hooks/use-toast.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/components/lyrics-review/CorrectionDetailCard.tsx:79— `typeof window !== 'undefined' && window.innerWidth < 640` appears character-identically in 6 files — frontend/components/lyrics-review/CorrectionDetailCard.tsx, frontend/components/lyrics-review/EditActionBar.tsx, frontend/components/lyrics-review/EditTimelineSection.tsx, frontend/components/lyrics-review/EditWordList.tsx. 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.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:348— `info` at line 348 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:353— `info` at line 353 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:364— `info` at line 364 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:369— `warning` at line 369 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:372— `warning` at line 372 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:374— `info` at line 374 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:400— `info` at line 400 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:406— `warning` at line 406 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:457— `info` at line 457 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:486— `info` at line 486 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:518— `info` at line 518 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:531— `info` at line 531 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:574— `warning` at line 574 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:613— `info` at line 613 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:621— `info` at line 621 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:626— `info` at line 626 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:643— `info` at line 643 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:657— `info` at line 657 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:738— `info` at line 738 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:752— `info` at line 752 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:926— `info` at line 926 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:931— `debug` at line 931 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:999— `info` at line 999 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:1056— `info` at line 1056 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging karaoke_gen/audio_fetcher.py:1077— `debug` at line 1077 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
+ 15 more in this group — see findings.md.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×17
Diagnostic log message is built whether or not it is wanted REDACTED:79— `debug` at line 79 is called with an argument built by `json.dumps(response_json, indent = 2)` (line 79), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdg.py:674— `debug` at line 674 is called with an argument built by `"…".join(current_line)` (line 674), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdg.py:680— `debug` at line 680 is called with an argument built by `"…".join(current_line)` (line 680), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/countdown_processor.py:206— `debug` at line 206 is called with an argument built by `"…".join(cmd)` (line 206), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/video.py:78— `debug` at line 78 is called with an argument built by `[e.strip() for e in nvenc_encoders]` (line 78), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/video.py:92— `debug` at line 92 is called with an argument built by `"…".join(test_cmd)` (line 92), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/video.py:516— `debug` at line 516 is called with an argument built by `"…".join(cmd)` (line 516), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1496— `debug` at line 1496 is called with an argument built by `list(it.chain(* packets.values()))` (line 1496), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1690— `debug` at line 1690 is called with an argument built by `list(it.chain(* packets.values()))` (line 1690), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1808— `debug` at line 1808 is called with an argument built by `list(it.chain(* packets.values()))` (line 1808), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/output/cdgmaker/composer.py:1873— `debug` at line 1873 is called with an argument built by `list(batched(image.getpalette(), 3))` (line 1873), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted REDACTED:175— `debug` at line 175 is called with an argument built by `"…".join(ngram)` (line 175), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted REDACTED:188— `debug` at line 188 is called with an argument built by `"…".join(ngram)` (line 188), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted REDACTED:654— `debug` at line 654 is called with an argument built by `"…".join(words)` (line 654), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted karaoke_gen/lyrics_transcriber/correction/corrector.py:726— `debug` at line 726 is called with an argument built by `"…".join(w.text for w in gap_words)` (line 726), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted backend/services/firestore_service.py:77— `debug` at line 77 is called with an argument built by `list(data.keys())` (line 77), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted backend/services/local_preview_encoding_service.py:351— `debug` at line 351 is called with an argument built by `"…".join(cmd)` (line 351), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
X7 · Silent fallback defaults· Pending state with no failure state · ×16
Pending state with no failure state frontend/components/job/JobActions.tsx:131— The view draws `<Loader2 class="w-3 h-3 mr-1 animate-spin"/>` under `isDeleting`, but `isDeleting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/job/JobActions.tsx:149— The view draws `<Loader2 class="w-3 h-3 mr-1 animate-spin"/>` under `isRetrying`, but `isRetrying` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/job/KaraokeBackgroundPreview.tsx:169— The view draws `<div class="absolute inset-0 flex flex-col items-center justify-center gap-2 rounded-lg" style= data-testid="karaoke-background-preview-loading">` under `! ready`, but `ready` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/job/StalledDownloadNotice.tsx:81— The view draws `<Loader2 class="w-3 h-3 mr-1 animate-spin"/>` under `busy === "retry"`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/job/StalledDownloadNotice.tsx:95— The view draws `<Loader2 class="w-3 h-3 mr-1 animate-spin"/>` under `busy === "choose"`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/audio-editor/AudioEditRestoreDialog.tsx:90— The view draws `<div class="fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4">` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/audio-editor/AudioEditRestoreDialog.tsx:159— The view draws `<div class="flex items-center justify-center py-8">` under `isLoadingDetail`, but `isLoadingDetail` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/components/admin/refund-dialog.tsx:179— The view draws `<Loader2 class="w-4 h-4 mr-2 animate-spin"/>` under `processing`, but `processing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/app/admin/layout.tsx:141— The view draws `<div class="min-h-screen flex items-center justify-center" style= >` under `isChecking || ! user`, but `user` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/app/admin/feedback/page.tsx:190— The view draws `<div class="flex items-center justify-center py-12">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state REDACTED:212— The view draws `<Loader2 class="w-4 h-4 animate-spin"/>` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state REDACTED:221— The view draws `<div class="flex justify-center py-8">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state REDACTED:535— The view draws `<div class="flex justify-center py-12">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state REDACTED:643— The view draws `<div class="flex justify-center py-12">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state REDACTED:901— The view draws `<Loader2 class="w-4 h-4 animate-spin"/>` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/app/[locale]/payment/success/page.tsx:43— The view draws `<div class="flex items-center justify-center gap-2 text-muted-foreground mb-6">` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Silent fallback default on parse failure backend/services/custom_lyrics/service.py:342— `_segment_duration` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure backend/services/custom_lyrics/validator.py:50— `_segment_duration` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure backend/services/input_recovery.py:86— `_countdown_padding_seconds` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure backend/services/parse_titles/ai.py:86— `_conf` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure backend/workers/audio_download_worker.py:108— `_current_task_attempt` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure backend/workers/supersede.py:36— `capture_generation` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure infrastructure/functions/gdrive_validator/main.py:51— `_grace_minutes` returns `30` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure karaoke_gen/lyrics_transcriber/output/ass/formatters.py:40— `str_to_n1bool` returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure karaoke_gen/lyrics_transcriber/output/ass/formatters.py:52— `str_to_integer` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure karaoke_gen/lyrics_transcriber/output/ass/formatters.py:66— `str_to_number` returns `0.0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default on parse failure karaoke_gen/lyrics_transcriber/output/countdown_processor.py:113— `padding_for_segments_data` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Silent fallback default in catch backend/services/gdrive_service.py:43— `_http_error_reasons` swallows every exception into `return set()` — 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.
Silent fallback default in catch backend/services/match_judge/ai.py:74— `_model` swallows every exception into `return 'gemini-3.8-flash'` — 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.
Silent fallback default in catch backend/services/parse_titles/ai.py:63— `_model` swallows every exception into `return 'gemini-3.8-flash'` — 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.
Silent fallback default in catch backend/services/tenant_bulk/analyze.py:498— `_default_model` swallows every exception into `return 'gemini-3.8-flash'` — 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.
Silent fallback default in catch backend/workers/auto_correct_worker.py:52— `_precondition_failed` 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.
Silent fallback default in catch karaoke_gen/audio_processor.py:46— `_separator_kwargs` 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.
Silent fallback default in catch frontend/lib/local-host.ts:32— `localApiOverride` 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.
Silent fallback default in catch frontend/lib/degradation-events.ts:161— `sanitizedHref` 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.
Silent fallback default in catch frontend/lib/lyrics-review/utils/localSessionStore.ts:28— `readStore` 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.
Silent fallback default in catch REDACTED:80— `getDuration` swallows every exception into `return 0` — 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.
Mock-dominated test: warns before unload only while an upload is running frontend/hooks/__tests__/useUploadTask.test.tsx:26— This test sets up 3 test doubles (for example `jest.spyOn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: selects "Instrumental + backing vocals" and auditions it from the clicked time frontend/components/lyrics-review/__tests__/ReviewChangesModal.waveformSelect.test.tsx:50— This test sets up 5 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: calls onChange with null when remove button is clicked frontend/components/job/__tests__/ImageUploadField.test.tsx:54— This test sets up 3 test doubles (for example `jest.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: calls sendMagicLink when form is submitted frontend/components/__tests__/AuthStatus.test.tsx:172— This test sets up 5 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: calls loginWithToken when token is submitted frontend/components/__tests__/AuthStatus.test.tsx:203— This test sets up 5 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: calls onSuccess after successful token login frontend/components/__tests__/AuthStatus.test.tsx:228— This test sets up 5 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: Keep trying retries with keepTrying and refreshes frontend/components/__tests__/StalledDownloadNotice.test.tsx:63— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: Choose different audio reopens selection and opens the picker frontend/components/__tests__/StalledDownloadNotice.test.tsx:72— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shows an error toast and does not open the picker when the call fails frontend/components/__tests__/StalledDownloadNotice.test.tsx:81— This test sets up 4 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
README/code drift backend/workers/README.md:600— backend/workers/README.md links to `../docs/01-reference/API-MANUAL-TESTING.md`, but `backend/docs/01-reference/API-MANUAL-TESTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift backend/workers/README.md:601— backend/workers/README.md links to `../docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md`, but `backend/docs/01-reference/KARAOKE-GEN-CLI-WORKFLOW.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift backend/workers/README.md:602— backend/workers/README.md links to `../docs/03-deployment/TESTING-BACKEND.md`, but `backend/docs/03-deployment/TESTING-BACKEND.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift backend/workers/README.md:603— backend/workers/README.md links to `../docs/03-deployment/INFRASTRUCTURE-AS-CODE.md`, but `backend/docs/03-deployment/INFRASTRUCTURE-AS-CODE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×3
Projects may be oversized for their cohesion backend/pyproject.toml:1— `backend` (90087 LoC, 791 module-visible types across 19 directories) overshoots its size bounds. 3 of 16 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion REDACTED:1— `frontend` (70594 LoC, 658 module-visible types across 70 directories) overshoots its size bounds. 3 of 16 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion pyproject.toml:1— `(repository root)` (52731 LoC, 328 module-visible types across 37 directories) overshoots its size bounds. 3 of 16 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Fat interface: LyricsReviewApiClient (19 required operations) frontend/lib/api.ts:4274— `LyricsReviewApiClient` declares 19 required operations: `submitCorrections`, `submitAnnotations`, `submitEditLog`, `updateHandlers`, `addLyrics`, `searchLyrics`, `getAudioUrl`, `getVocalsAudioUrl`, `getVocalsPeaksUrl`, `generatePreviewVideo`, `getPreviewVideoStatus`, `getPreviewVideoUrl`, `getWaveformData`, `refreshInstrumentalUrls`, `completeReview`, `saveReviewSession`, `listReviewSessions`, `getReviewSession`, `deleteReviewSession`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
No ADRs found pyproject.toml:168— 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 `pyproject.toml` makes this repository a deployable product (line 168).
D21 · Naming Consistency· `do_GET` spells `GET` where 528 names in the project spell it `get` · ×1
`do_GET` spells `GET` where 528 names in the project spell it `get` scripts/review_reference_relevance.py:936— 528 of 529 names in project python spell the token `get` (528 of 529; unit: names in project python containing `get`). Peers: dependencies.get_review_token_expiry (backend/api/dependencies.py:23); dependencies.get_token_from_request (backend/api/dependencies.py:32); admin.get_admin_stats_overview (backend/api/routes/admin.py:161); admin.get_flacfetch_cache_stats (backend/api/routes/admin.py:749); admin.get_job_files (backend/api/routes/admin.py:886). Rename to `do_get`. [rule N6]
D21 · Naming Consistency· `do_POST` spells `POST` where 21 names in the project spell it `post` · ×1
`do_POST` spells `POST` where 21 names in the project spell it `post` scripts/review_reference_relevance.py:943— 21 of 22 names in project python spell the token `post` (21 of 22; unit: names in project python containing `post`). Peers: review._reconstruct_post_ai_segments (REDACTED:679); DiscordNotificationService.post_message (backend/services/discord_service.py:78); DiscordNotificationService.post_video_notification (backend/services/discord_service.py:126); PostmarkEmailProvider._post_with_retry (REDACTED:225); ExpoPushService.__init__(http_post) (REDACTED:46). Rename to `do_post`. [rule N6]
Scattered collaborators — 100 % of calls cross a namespace and only 34 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
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.
Logging is not universal — Only 10/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `frontend`, `infrastructure/aws`, `infrastructure/cloudflare`.
No dependency-update automation REDACTED:34— `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
No security response headers detected frontend/public/_headers:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `_headers` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
S1 · Web-Security Posture· Information-disclosure response header set · ×1
Information-disclosure response header set karaoke_gen/nextjs_frontend/_next/static/chunks/5997132b61dec430.js:1— `Server` is set explicitly here. The OWASP Secure Headers Project lists it among the response headers to REMOVE: it names the server, framework or tooling behind the application, which is exactly what an attacker looks up known exploits for. (No deduction on this card.)
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 1/6 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Null assertions (`!`) override strict null checking — ~1.1 `!` null assertions per 1k TypeScript source lines — 84 assertion(s) across the 76577 source line(s) of the 344 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: frontend/components/tenant-theme/TenantThemeEditorDialog.tsx (39), frontend/components/lyrics-review/synchronizer/LyricsSynchronizer.tsx (10), frontend/components/lyrics-review/synchronizer/TimelineCanvas.tsx (8). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Outdated: google-auth-httplib2 — `google-auth-httplib2` is pinned to 0.3.0, but 0.4.4 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.3.0 until the declaration is edited.
Outdated: google-auth-oauthlib — `google-auth-oauthlib` is pinned to 1.3.0, but 1.5.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.3.0 until the declaration is edited.
Outdated: google-cloud-monitoring — `google-cloud-monitoring` is pinned to 2.29.1, but 2.32.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 2.29.1 until the declaration is edited.
Outdated: pulumi-cloudflare — `pulumi-cloudflare` is pinned to 6.22.1, but 6.24.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 6.22.1 until the declaration is edited.
Outdated: pulumi-gcp — `pulumi-gcp` is pinned to 9.22.0, but 10.3.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 9.22.0 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.
doc comments repeat the names frontend/e2e/fixtures/mock-server.ts:104— 1 of 58 documented parameters and 14 of 970 summaries in `karaoke-gen-frontend` only repeat the member or parameter name (e.g. "Load all approved fixtures" for `loadApprovedFixtures`). Delete the restating tags, or add what the name does not say.
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.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1eab4-3607-73d3-8f6a-c8a5493081a5 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 289 · Warnings: 1977 · Recommendations: 267 · Info: 6 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 18:10 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.