Public report of IIIIIllllIIIIIlllll/llama.cpp-hub, published 16 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 16 November 2026, 23:35 UTC · Survey ID cd_29356895e41a4081910effc20679c7fc
IIIIIllllIIIIIlllll/llama.cpp-hub
Measured 16 November 2026, 23:34 UTC, at code version 32ccbdd
Code coverage is not measured: Suite not runnable in-image.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 52,927 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Code Health, 16.2
Findings by how serious they are
67 critical1674 serious113 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
16 November 2026, 23:34 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
71of 71 dimensions measured by tools.
1833of 1854 findings point to an exact file and line, so you can open each one in the code. The other 21 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 52,927 lines of product code in 2 projects.
IIIIIllllIIIIIlllll/llama.cpp-hub falls short of our standard for a preview release, held back most by its Code Health lens, the quality of the code itself. It scores 30.7 out of 100 and is rated Weak, and 19 of its 67 critical findings are security problems.
Code Health, at 16.2, is the weakest lens and counts most in the score. The best first steps are adding type checking and simplifying the most tangled functions, each worth about 3.0 points. Raising Code Health to 67 would lift the score to about 42.4.
Ten weaknesses in the code could be used by an attacker. Four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and eighteen form fields can't be read by a screen reader. Fixing the weaknesses the scanner points to, pinning each tool to an exact version and labelling the form fields would close these risks. Updating the vulnerable packages would fix the package with a known security hole, and the two pipeline steps that run downloads without checking them need each download checked against a known checksum first. The 17 labels or groups of fields with no name need connecting to their fields or naming.
The product code is 52,927 lines, about €47,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 Code Health rose from 16.2 to 67, the lowest score rated Strong, the score would rise from 30.7 to about 42.4.
Code composition: what the lines of code are
Product code 95%Tests 5%
Rebuild cost: about €47,000 · Estimate
Cost to rebuild
€16,000 to €79,000, for 262 to 833 hours of work, about 0.3 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 31. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 52,927 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
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 3.0 points · Medium effort · Type Safety
2
Resolve the 40 finding(s) in Cyclomatic Complexity.
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 3.0 points · Medium effort · Large Files
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 €47,000 to build again, about 0.3 person-years of work. Its weakest lens is Code Health, at 16.2 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
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 3.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 10% to 23% on every change. The history of the code shows how much it changes: about 995 lines over the last 90 days, which is about 4,035 lines a year. At that pace, the extra work comes to an estimated 1 to 6.1 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.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 3.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.
28 modules, with 17 dependencies between them. Every module uses only modules listed above it, so there are no loops.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
org.mark.file.downloader uses org.mark.llamacpp.crawler, so a change to org.mark.llamacpp.crawler can break org.mark.file.downloader, while a change to org.mark.file.downloader can't break org.mark.llamacpp.crawler.
Position
Below the diagonal: org.mark.file.downloader uses a module listed above it, which is the healthy direction.
org.mark.file.downloader uses org.mark.llamacpp.server.websocket, so a change to org.mark.llamacpp.server.websocket can break org.mark.file.downloader, while a change to org.mark.file.downloader can't break org.mark.llamacpp.server.websocket.
Position
Below the diagonal: org.mark.file.downloader uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server uses org.mark.llamacpp.gguf, so a change to org.mark.llamacpp.gguf can break org.mark.llamacpp.server, while a change to org.mark.llamacpp.server can't break org.mark.llamacpp.gguf.
Position
Below the diagonal: org.mark.llamacpp.server uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server uses org.mark.llamacpp.server.struct, so a change to org.mark.llamacpp.server.struct can break org.mark.llamacpp.server, while a change to org.mark.llamacpp.server can't break org.mark.llamacpp.server.struct.
Position
Below the diagonal: org.mark.llamacpp.server uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server uses org.mark.llamacpp.server.websocket, so a change to org.mark.llamacpp.server.websocket can break org.mark.llamacpp.server, while a change to org.mark.llamacpp.server can't break org.mark.llamacpp.server.websocket.
Position
Below the diagonal: org.mark.llamacpp.server uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.tools uses org.mark.llamacpp.gguf, so a change to org.mark.llamacpp.gguf can break org.mark.llamacpp.server.tools, while a change to org.mark.llamacpp.server.tools can't break org.mark.llamacpp.gguf.
Position
Below the diagonal: org.mark.llamacpp.server.tools uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.service uses org.mark.llamacpp.record, so a change to org.mark.llamacpp.record can break org.mark.llamacpp.server.service, while a change to org.mark.llamacpp.server.service can't break org.mark.llamacpp.record.
Position
Below the diagonal: org.mark.llamacpp.server.service uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.service uses org.mark.llamacpp.server.struct, so a change to org.mark.llamacpp.server.struct can break org.mark.llamacpp.server.service, while a change to org.mark.llamacpp.server.service can't break org.mark.llamacpp.server.struct.
Position
Below the diagonal: org.mark.llamacpp.server.service uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.service uses org.mark.llamacpp.server.websocket, so a change to org.mark.llamacpp.server.websocket can break org.mark.llamacpp.server.service, while a change to org.mark.llamacpp.server.service can't break org.mark.llamacpp.server.websocket.
Position
Below the diagonal: org.mark.llamacpp.server.service uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.service uses org.mark.llamacpp.server, so a change to org.mark.llamacpp.server can break org.mark.llamacpp.server.service, while a change to org.mark.llamacpp.server.service can't break org.mark.llamacpp.server.
Position
Below the diagonal: org.mark.llamacpp.server.service uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.controller uses org.mark.llamacpp.server.mcp, so a change to org.mark.llamacpp.server.mcp can break org.mark.llamacpp.server.controller, while a change to org.mark.llamacpp.server.controller can't break org.mark.llamacpp.server.mcp.
Position
Below the diagonal: org.mark.llamacpp.server.controller uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.controller uses org.mark.llamacpp.server.struct, so a change to org.mark.llamacpp.server.struct can break org.mark.llamacpp.server.controller, while a change to org.mark.llamacpp.server.controller can't break org.mark.llamacpp.server.struct.
Position
Below the diagonal: org.mark.llamacpp.server.controller uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.controller uses org.mark.llamacpp.server, so a change to org.mark.llamacpp.server can break org.mark.llamacpp.server.controller, while a change to org.mark.llamacpp.server.controller can't break org.mark.llamacpp.server.
Position
Below the diagonal: org.mark.llamacpp.server.controller uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.controller uses org.mark.llamacpp.server.service, so a change to org.mark.llamacpp.server.service can break org.mark.llamacpp.server.controller, while a change to org.mark.llamacpp.server.controller can't break org.mark.llamacpp.server.service.
Position
Below the diagonal: org.mark.llamacpp.server.controller uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.channel uses org.mark.file.downloader, so a change to org.mark.file.downloader can break org.mark.llamacpp.server.channel, while a change to org.mark.llamacpp.server.channel can't break org.mark.file.downloader.
Position
Below the diagonal: org.mark.llamacpp.server.channel uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.channel uses org.mark.llamacpp.server.service, so a change to org.mark.llamacpp.server.service can break org.mark.llamacpp.server.channel, while a change to org.mark.llamacpp.server.channel can't break org.mark.llamacpp.server.service.
Position
Below the diagonal: org.mark.llamacpp.server.channel uses a module listed above it, which is the healthy direction.
org.mark.llamacpp.server.channel uses org.mark.llamacpp.server.controller, so a change to org.mark.llamacpp.server.controller can break org.mark.llamacpp.server.channel, while a change to org.mark.llamacpp.server.channel can't break org.mark.llamacpp.server.controller.
Position
Below the diagonal: org.mark.llamacpp.server.channel uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 16.2 · Critical · gated by D1, D2, D4, R1, R10, R2, R3, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
31
High / Critical
A03:2025 — Software Supply Chain Failures
9
High / Critical
A07:2025 — Authentication Failures
2
High / Critical
Roadmap
Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Resolve the 40 finding(s) in Cyclomatic Complexity; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 67
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 1674
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 — 113
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 71 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 — 71 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, 1833 of 1854 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the test suite could not be built/run in-image (commonly external-service dependencies — a database, a broker — we won't provision). To have it measured, make the suite runnable without them. For context only, test code is ≈ 5% of production LoC (2,771 test / 52,927 production) — a rough proxy, NOT a coverage measurement, so it is excluded from the score. You can widen what we reach: optional: make the suite runnable without a database, broker or other service we do not provision, and real coverage is measured on the next scan.
D12 Dependency Hygiene — 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. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Maven tree, and its score reflects currency alone.
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 (3 contributor(s) across 1305 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 2 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.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
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 a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
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.
D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (71866 LoC, 213 module-visible types across 27 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
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. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
AC6 Visual & motion safety — 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. 80 further occurrence(s) are not listed individually; the score already reflects all 120.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 39 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — 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 data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
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.
P1 CI/CD gates — 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. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
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. 87 further occurrence(s) are not listed individually; the score already reflects all 127.
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. 117 further occurrence(s) are not listed individually; the score already reflects all 157.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check'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.
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. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
X24 Document value interpolated into markup unescaped — 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. 307 further occurrence(s) are not listed individually; the score already reflects all 347.
X26 Unsynchronised callback handoff — 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.
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.
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. 239 further occurrence(s) are not listed individually; the score already reflects all 279.
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.
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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
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.
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.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
425 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was index.html.bindEvents at 171. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being GGUFMetaData.fileTypeToQuantizationName at 33 — they are counted neither in the figure above nor in this dimension's score.
+ 331 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 17 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with index.html.bindEvents (cyclomatic 171), EasyChatService.handleStreamChat (cyclomatic 130), model-detail.extractSamplingSettingsFromConfig (cyclomatic 126). — 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 17 together lifts Cyclomatic Complexity from 2.0 to about 3.2/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.
+ 439 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 46 bodies over 60 down to 60 or less in Cognitive Complexity — start with EasyChatService.handleStreamChat (cognitive 228), index.html.requestAssistantResponse (cognitive 207), EasyChatService.handleStreamChatHistory (cognitive 173). — 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 46 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes4.9 / 10Weak✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 39 FileTooLong finding(s) in God Classes — start with index.html (2), LlamaServerManager.java, model-action-modal.js. — One of this dimension's main actionable groups (39 warning-level).
Resolve the 28 ClassTooLong finding(s) in God Classes — start with LlamaServerManager.java, ModelActionController.java, SystemController.java. — One of this dimension's main actionable groups (28 warning-level).
Resolve the 22 TooManyMethods finding(s) in God Classes — start with LlamaServerManager.java, LlamaServer.java, EasyChatService.java. — One of this dimension's main actionable groups (22 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.
337 duplicated block group(s) detected. 20.2 % of the production lines (10,684 of 52,927) are in a reported copy. A further 135 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 171 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 26 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with NettyHttpDownloader.java (3), LlamaServerManager.java (2), LlamacppController.java (2). — One of this dimension's main actionable groups (26 warning-level).
Resolve the 24 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with NettyHttpUtils.java (2), LlamaRouterHandler.java (2), ChatTemplateKwargsService.java (2). — One of this dimension's main actionable groups (24 warning-level).
Resolve the 23 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with NettyHttpDownloader.java (6), ConfigManager.java (2), LlamacppController.java (2). — One of this dimension's main actionable groups (23 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 (Maven+CMake), 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, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
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 NettySseMcpServer.java. — 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.
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.
6 outdated artifact(s) of 6 resolved by the build, graded against Maven Central. Whether any of these is DEPRECATED is not graded — Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Known CVEs in this graph are D30's question, read from the manifest there.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 6 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 1 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 3 Hotspot finding(s) in Churn × Complexity Hotspots — start with LlamaServer.java, settings.js, SystemController.java. — One of this dimension's main actionable groups (3 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.
1 deducted task-comment markers across 52927 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 1 TodoComment finding(s) in Explicit Debt — start with LlamaServerManager.java. — One of this dimension's main actionable groups (1 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. 19 document(s) read across 1 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 REDACTED. — 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.
2 naming inconsistencies among 22 declarations measured against a convention their peers follow.
`buildAiMessage` spells `Ai` where 20 names in the project spell it `AI`src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1965
`openAiErrorCode` spells `Ai` where 20 names in the project spell it `AI`src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1792
What to do
Resolve the 1 `buildAiMessage` spells `Ai` where 20 names in the project spell it `AI` finding(s) in Naming Consistency — start with EasyChatService.java. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `openAiErrorCode` spells `Ai` where 20 names in the project spell it… finding(s) in Naming Consistency — start with OpenAIService.java. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
9 % of calls cross a namespace and 1 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
31 finding(s): 0 critical, 17 high, 8 medium, 6 low. 4 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 3 file(s) — `REDACTED` (line 49, line 156, line 157, …), `src/main/resources/web/chat/index.html` (line 650), `src/main/resources/web/js/benchmark-v3.js` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 4 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 (4 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
1 of 101 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is REDACTED. Counted over 101 of the 142 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned files with no living knowledge
Orphaned fileREDACTED:1
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 4 Change coupling finding(s) in Change Coupling — start with UsageReportService.java, BasicRouterHandler.java, FileDownloadRouterHandler.java. — One of this dimension's main actionable groups (4 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.
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 1 platform declaration(s) and 6 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 alternatives3.9 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
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. — src/main/resources/web/js/html2canvas.min.js:3133
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — src/main/resources/web/js/html2canvas.min.js:3802, src/main/resources/web/js/html2canvas.min.js:3897
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels4.7 / 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 no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×12) — src/main/resources/web/audio-transcription.html:539, src/main/resources/web/index-new.html:543, src/main/resources/web/index-new.html:548, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×6) — src/main/resources/web/chat/index.html:43, src/main/resources/web/chat/index.html:127, src/main/resources/web/index-new.html:612, …
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). (×5) — src/main/resources/web/index-new.html:530, src/main/resources/web/index-new.html:630, src/main/resources/web/index-new.html:646, …
This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×17) — src/main/resources/web/index-new.html:542, src/main/resources/web/index-new.html:546, src/main/resources/web/index-new.html:554, …
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>. (×11) — src/main/resources/web/audio-transcription.html:2, src/main/resources/web/index-new.html:2, src/main/resources/web/tools/benchmark-v2.html:2, …
With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled. — src/main/resources/web/index-new.html:2
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="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. (×3) — src/main/resources/web/chat/index.html:205, src/main/resources/web/chat/index.html:673, src/main/resources/web/chat/index.html:677
An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action. (×9) — src/main/resources/web/index.html:2421, src/main/resources/web/index.html:2429, src/main/resources/web/index.html:2433, …
The repo's own CSS styles .download-name with `cursor: pointer`, so this <div> 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. — src/main/resources/web/js/download.js:338
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. — src/main/resources/web/js/newui/hf.js:224
The repo's own CSS styles .set-link with `cursor: pointer`, so this <div> 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. — src/main/resources/web/js/newui/settings.js:298
The repo's own CSS styles .model-name with `cursor: pointer`, so this <div> 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. (×2) — src/main/resources/web/js/settings.js:1566, src/main/resources/web/js/settings.js:1748
The repo's own CSS styles .toast with `cursor: pointer`, so this <div> 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. — src/main/resources/web/tools/cert-gen.html:128
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 · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.submit-btn .spinner` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/audio-transcription.html:361
`.toast` moves (`animation: toastIn 0.2s var(--ease-spring) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/audio-transcription.html:452
`.toast.exiting` moves (`animation: toastOut 0.2s ease both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/audio-transcription.html:460
`.audio-preview audio` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/main/resources/web/audio-transcription.html:267
`.sidebar-quick-links-chevron` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:166
`.sidebar-quick-links-list` moves (`transition: max-height 0.3s ease, opacity 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:180
`#main-benchmark-v3 .param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:929
`#benchParamsModal .param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:1112
`#main-settings .llamacpp-asset-progress .update-progress-bar-inner` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:1905
`#main-sysinfo .ff-progress-fill` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/index.html:2046
`#benchParamsModal .param-field:has(.param-enable-toggle:not(:checked)) .form-control` sets color: #9ca3af on background-color: #f3f4f6 — 2.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — src/main/resources/web/index.html:1162, src/main/resources/web/tools/benchmark-v3.html:191
`.param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/benchmark-v3.html:78
`.spinner` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/main/resources/web/tools/cert-gen.html:45, src/main/resources/web/tools/gguf-mem-test.html:393
`.toast.show` moves (`animation: fadeInOut 2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/cert-gen.html:48
`.btn-success` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — src/main/resources/web/tools/cert-gen.html:32, src/main/resources/web/tools/llama-build.html:192
`.toast-success` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/main/resources/web/tools/cert-gen.html:50
`.toast-error` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/main/resources/web/tools/cert-gen.html:51
`.param-section-header .chevron` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/gguf-mem-test.html:205
`.param-section-body` moves (`transition: max-height 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/gguf-mem-test.html:216
`.toggle-track::after` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/gguf-mem-test.html:293
`.toast` moves (`animation: slideIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — src/main/resources/web/tools/gguf-mem-test.html:422, src/main/resources/web/tools/llama-build.html:320, src/main/resources/web/tools/upload-test.html:355
`.device-tag` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/main/resources/web/tools/gguf-mem-test.html:231
`.btn-primary` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×3) — src/main/resources/web/tools/gguf-mem-test.html:325, src/main/resources/web/tools/llama-build.html:182, src/main/resources/web/tools/upload-test.html:187
`.progress-bar-fill` moves (`transition: width 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/main/resources/web/tools/llama-build.html:287, src/main/resources/web/tools/upload-test.html:156
`.preset-btn.active` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/main/resources/web/tools/llama-build.html:163
`.btn-danger` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — src/main/resources/web/tools/llama-build.html:190, src/main/resources/web/tools/upload-test.html:211
`.dlg-body input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/main/resources/web/tools/mcp-manager.html:348
`.progress-bar .fill` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/main/resources/web/tools/mtp-bench.html:57, src/main/resources/web/tools/perplexity.html:40
`#perplexityParamsModal .param-group-summary::after` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/main/resources/web/tools/perplexity.html:89
`[data-theme="dark"] .settings-tab.active` sets color: #ffffff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/main/resources/web/css/index.css:178
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Code Health — Unreviewed-generation residue in this repository's Java: methods whose whole body only throws a "not implemented" or bare unsupported-operation exception, or returns a default value (or nothing) under a TODO/FIXME marker, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`main` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/main/java/org/mark/audiocpp/AudioServer.java:11
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
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.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Exemplary✓ Tool-verified
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.
What to do
Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`REDACTED` 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:20
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:676
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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 · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
0 typed · 28 plain JS — the untyped files are src/main/resources/web/chat/audio-recorder.js, src/main/resources/web/chat/chat-mcp.js, src/main/resources/web/js/console-modal.js, src/main/resources/web/js/download.js, src/main/resources/web/js/hf.js, src/main/resources/web/js/i18n.js (+22 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Do you agree with this assessment?
R10 · Code Duplication2.8 / 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.
src/main/resources/web/js/lz-string.js:135 · src/main/resources/web/js/lz-string.js:220 — 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. — src/main/resources/web/js/lz-string.js:135
src/main/resources/web/js/settings.js:1512 · src/main/resources/web/js/settings.js:1693 — 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. — src/main/resources/web/js/settings.js:1512
src/main/resources/web/js/model-action-modal.js:268 · src/main/resources/web/js/model-action-modal.js:414 — the two spans are one implementation copied and then locally edited — 347 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. — src/main/resources/web/js/model-action-modal.js:268
src/main/resources/web/js/newui/usage-report.js:478 · src/main/resources/web/js/usage-report.js:198 — 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. — src/main/resources/web/js/newui/usage-report.js:478
REDACTED:100 · REDACTED:220 — 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:100
src/main/resources/web/js/newui/usage-report.js:410 · src/main/resources/web/js/usage-report.js:531 — the two spans are one implementation copied and then locally edited — 283 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. — src/main/resources/web/js/newui/usage-report.js:410
src/main/resources/web/js/model-action-modal.js:2124 · REDACTED:245 — the two spans are one implementation copied and then locally edited — 218 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. — src/main/resources/web/js/model-action-modal.js:2124
src/main/resources/web/js/hf.js:496 · src/main/resources/web/js/hf.js:537 — the two spans are one implementation copied and then locally edited — 184 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. — src/main/resources/web/js/hf.js:496
src/main/resources/web/js/hf.js:52 · src/main/resources/web/js/newui/hf.js:435 — 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. — src/main/resources/web/js/hf.js:52
src/main/resources/web/js/settings.js:1674 · src/main/resources/web/js/settings.js:1855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/settings.js:1674
src/main/resources/web/js/newui/hf.js:31 · src/main/resources/web/js/newui/hf.js:73 — the two spans are one implementation copied and then locally edited — 164 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. — src/main/resources/web/js/newui/hf.js:31
src/main/resources/web/js/newui/usage-report.js:371 · src/main/resources/web/js/newui/usage-report.js:445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/newui/usage-report.js:371
src/main/resources/web/js/usage-report.js:430 · src/main/resources/web/js/usage-report.js:540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/usage-report.js:430
src/main/resources/web/js/usage-report.js:458 · src/main/resources/web/js/usage-report.js:575 — 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. — src/main/resources/web/js/usage-report.js:458
src/main/resources/web/chat/chat-mcp.js:894 · src/main/resources/web/chat/chat-mcp.js:914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/chat/chat-mcp.js:894
src/main/resources/web/js/download.js:373 · src/main/resources/web/js/download.js:401 — 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. — src/main/resources/web/js/download.js:373
src/main/resources/web/js/lz-string.js:355 · src/main/resources/web/js/lz-string.js:413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/lz-string.js:355
src/main/resources/web/js/model-action-modal.js:1879 · src/main/resources/web/js/model-action-modal.js:1928 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/model-action-modal.js:1879
src/main/resources/web/js/model-list.js:664 · src/main/resources/web/js/model-list.js:742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/model-list.js:664
src/main/resources/web/js/newui/usage-report.js:546 · src/main/resources/web/js/usage-report.js:269 — 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. — src/main/resources/web/js/newui/usage-report.js:546
src/main/resources/web/js/usage-report.js:402 · src/main/resources/web/js/usage-report.js:500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/usage-report.js:402
src/main/resources/web/js/download.js:14 · src/main/resources/web/js/hf.js:19 — 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. — src/main/resources/web/js/download.js:14
src/main/resources/web/js/download.js:626 · src/main/resources/web/js/download.js:642 — 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. — src/main/resources/web/js/download.js:626
src/main/resources/web/js/model-list.js:701 · src/main/resources/web/js/model-list.js:725 — 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. — src/main/resources/web/js/model-list.js:701
src/main/resources/web/js/settings.js:1217 · src/main/resources/web/js/settings.js:1457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/settings.js:1217
src/main/resources/web/js/download.js:570 · src/main/resources/web/js/settings.js:55 — the two spans are one implementation copied and then locally edited — 112 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. — src/main/resources/web/js/download.js:570
src/main/resources/web/js/newui/usage-report.js:569 · src/main/resources/web/js/usage-report.js:292 — 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. — src/main/resources/web/js/newui/usage-report.js:569
src/main/resources/web/js/lz-string.js:429 · src/main/resources/web/js/lz-string.js:448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/lz-string.js:429
src/main/resources/web/js/model-action-modal.js:816 · src/main/resources/web/js/model-action-modal.js:837 — 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. — src/main/resources/web/js/model-action-modal.js:816
src/main/resources/web/js/model-action-modal.js:1090 · src/main/resources/web/js/model-action-modal.js:1195 — 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. — src/main/resources/web/js/model-action-modal.js:1090
src/main/resources/web/js/newui/usage-report.js:347 · src/main/resources/web/js/newui/usage-report.js:419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/newui/usage-report.js:347
src/main/resources/web/js/settings.js:523 · src/main/resources/web/js/settings.js:814 — 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. — src/main/resources/web/js/settings.js:523
src/main/resources/web/chat/chat-mcp.js:936 · src/main/resources/web/chat/chat-mcp.js:950 — 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. — src/main/resources/web/chat/chat-mcp.js:936
src/main/resources/web/js/model-action-modal.js:1631 · src/main/resources/web/js/model-action-modal.js:1689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/main/resources/web/js/model-action-modal.js:1631
src/main/resources/web/js/model-detail.js:196 · src/main/resources/web/js/model-detail.js:229 — 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. — src/main/resources/web/js/model-detail.js:196
src/main/resources/web/js/model-detail.js:917 · src/main/resources/web/js/model-detail.js:1006 — 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. — src/main/resources/web/js/model-detail.js:917
src/main/resources/web/js/model-detail.js:1095 · src/main/resources/web/js/model-detail.js:1119 — 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. — src/main/resources/web/js/model-detail.js:1095
src/main/resources/web/js/newui/usage-report.js:161 · src/main/resources/web/js/usage-report.js:137 — 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. — src/main/resources/web/js/newui/usage-report.js:161
src/main/resources/web/js/newui/usage-report.js:585 · src/main/resources/web/js/usage-report.js:308 — 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. — src/main/resources/web/js/newui/usage-report.js:585
src/main/resources/web/js/settings.js:498 · src/main/resources/web/js/settings.js:550 — 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. — src/main/resources/web/js/settings.js:498
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.
extractSamplingSettingsFromConfig has cyclomatic complexity 93 and cognitive complexity 105; 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. — src/main/resources/web/js/model-detail.js:405
applyCmdToDynamicFields has cyclomatic complexity 81 and cognitive complexity 150; 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. — src/main/resources/web/js/model-action-modal.js:309
checkUpdate has cyclomatic complexity 73 and cognitive complexity 98; 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. — src/main/resources/web/js/settings.js:1096
buildLoadModelPayload has cyclomatic complexity 62 and cognitive complexity 129; 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. — src/main/resources/web/js/model-action-modal.js:1497
updateDownloadProgress has cyclomatic complexity 62 and cognitive complexity 114; 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. — src/main/resources/web/js/download.js:404
(anonymous) has cyclomatic complexity 58 and cognitive complexity 62; 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. — src/main/resources/web/js/model-list.js:332
(anonymous) has cyclomatic complexity 56 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. — src/main/resources/web/js/download.js:256
token has cyclomatic complexity 51 and cognitive complexity 136; 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:65
submitModelAction has cyclomatic complexity 47 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 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. — src/main/resources/web/js/model-action-modal.js:1617
createHfDownloadTasks has cyclomatic complexity 40 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. — src/main/resources/web/js/hf.js:402
generateHttpsCert has cyclomatic complexity 39 and cognitive complexity 45; 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. — src/main/resources/web/js/settings.js:672
_compress has cyclomatic complexity 38 and cognitive complexity 150; 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. — src/main/resources/web/js/lz-string.js:109
restoreUpdateStatus has cyclomatic complexity 38 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 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. — src/main/resources/web/js/settings.js:1421
onMsg has cyclomatic complexity 37 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. — src/main/resources/web/js/newui/app.js:166
_decompress has cyclomatic complexity 32 and cognitive complexity 69; 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. — src/main/resources/web/js/lz-string.js:332
calculateModelTokens has cyclomatic complexity 31 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. — src/main/resources/web/js/model-detail.js:1195
card has cyclomatic complexity 31 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. — src/main/resources/web/js/newui/models.js:146
handleWebSocketMessage has cyclomatic complexity 30 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. — src/main/resources/web/js/websocket.js:86
render has cyclomatic complexity 30 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. — src/main/resources/web/js/newui/misc-pages.js:132
output has cyclomatic complexity 29 and cognitive complexity 57; 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:336
handleAppUpdateEvent 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. — src/main/resources/web/js/settings.js:1350
populate has cyclomatic complexity 29 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. — src/main/resources/web/js/settings.js:340
downloadUpdate has cyclomatic complexity 28 and cognitive complexity 36; 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. — src/main/resources/web/js/settings.js:1252
setModelActionMode has cyclomatic complexity 27 and cognitive complexity 39; 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. — src/main/resources/web/js/model-action-modal.js:1354
showModelDetailModal has cyclomatic complexity 27 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. — src/main/resources/web/js/model-detail.js:29
loadModel has cyclomatic complexity 25 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 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. — src/main/resources/web/js/model-action-modal.js:1398
loadLlamaCppReleases has cyclomatic complexity 24 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 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. — src/main/resources/web/js/settings.js:105
(anonymous) has cyclomatic complexity 24 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 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. (×2) — src/main/resources/web/js/model-list.js:748, src/main/resources/web/js/newui/settings-update.js:35
tok has cyclomatic complexity 23 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. — REDACTED:608
(anonymous) has cyclomatic complexity 23 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. — src/main/resources/web/js/newui/model-detail.js:57
enforceModelCapabilitiesRules has cyclomatic complexity 22 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/main/resources/web/js/model-action-modal.js:931
init has cyclomatic complexity 22 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. — src/main/resources/web/js/settings.js:2032
(anonymous) has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/main/resources/web/js/model-list.js:670
fetchDetailReadme has cyclomatic complexity 21 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 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. — src/main/resources/web/js/hf.js:737
(anonymous) has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/main/resources/web/js/usage-report.js:338
extractToolResultText has cyclomatic complexity 21 and cognitive complexity 17; 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. — src/main/resources/web/chat/chat-mcp.js:217
renderLlamaCppRelease has cyclomatic complexity 20 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. — src/main/resources/web/js/settings.js:156
onclick has cyclomatic complexity 20 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 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. — src/main/resources/web/js/model-detail.js:669
handleWebSocketMessage has cyclomatic complexity 19 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. — src/main/resources/web/js/download.js:139
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ 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.
src/main/resources/web/js/model-action-modal.js has 2099 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/model-action-modal.js:1
src/main/resources/web/js/settings.js has 2086 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/settings.js:1
src/main/resources/web/js/model-detail.js has 1292 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/model-detail.js:1
src/main/resources/web/chat/chat-mcp.js has 1076 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/chat/chat-mcp.js:1
src/main/resources/web/js/hf.js has 934 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/hf.js:1
REDACTED 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. — REDACTED:1
src/main/resources/web/js/model-list.js has 750 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/model-list.js:1
REDACTED 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. — REDACTED:1
src/main/resources/web/js/download.js has 674 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/download.js:1
src/main/resources/web/js/usage-report.js has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/usage-report.js:1
src/main/resources/web/js/newui/usage-report.js has 546 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/newui/usage-report.js:1
src/main/resources/web/js/newui/hf.js has 463 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/resources/web/js/newui/hf.js:1
src/main/resources/web/js/lz-string.js 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. — src/main/resources/web/js/lz-string.js: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 Coverage0.0 / 10Critical✓ 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.
0% of 27 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
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.
Do you agree with this assessment?
X13 · Undrained process stream5.2 / 10Adequate✓ Tool-verified
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.
The JDK merges `stderr` into `stdout` here (`redirectErrorStream(true)`), and that one stream is still a pipe — and `p.waitFor(…)` is written before stdout is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the bounded wait then times out on a command that was only waiting to be read, and the output is lost. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file). — src/main/java/org/mark/llamacpp/server/tools/JsoupCliHelper.java:110
The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and the parent waits on `process.waitFor()` while nothing in this scope ever reads stderr. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file). — src/main/java/org/mark/llamacpp/server/service/ComputerService.java:113
What to do
Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 5/47 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.
`fetchConsole` 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 })`. — src/main/resources/web/js/console-modal.js:163
`fetchRemoteConsole` 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 })`. — src/main/resources/web/js/console-modal.js:294
`fetchHitsPage` 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 })`. — src/main/resources/web/js/hf.js:174
`createHfDownloadTasks` 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 })`. — src/main/resources/web/js/hf.js:402
`selectRepo` 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 })`. — src/main/resources/web/js/hf.js:896
`loadBundle` 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 })`. — src/main/resources/web/js/i18n.js:46
`calculateModelTokens` 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 })`. — src/main/resources/web/js/model-detail.js:1195
`fetchFromNetwork` 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 })`. — src/main/resources/web/js/node-cache.js:59
`loadLlamaCppReleases` 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 })`. — src/main/resources/web/js/settings.js:105
`downloadLlamaCppAsset` 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 })`. — src/main/resources/web/js/settings.js:238
`loadSettings` 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 })`. — src/main/resources/web/js/settings.js:328
`loadHttpsCertStatus` 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 })`. — src/main/resources/web/js/settings.js:420
`saveServerPorts` 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 })`. — src/main/resources/web/js/settings.js:494
`saveListenAddress` 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 })`. — src/main/resources/web/js/settings.js:520
`saveHttpOnlyPort` 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 })`. — src/main/resources/web/js/settings.js:545
`saveNodeRole` 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 })`. — src/main/resources/web/js/settings.js:572
`setMcpServer` 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 })`. — src/main/resources/web/js/settings.js:599
`saveSecurity` 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 })`. — src/main/resources/web/js/settings.js:624
`saveHttps` 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 })`. — src/main/resources/web/js/settings.js:648
`generateHttpsCert` 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 })`. — src/main/resources/web/js/settings.js:672
`saveLogging` 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 })`. — src/main/resources/web/js/settings.js:784
`saveDownload` 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 })`. — src/main/resources/web/js/settings.js:812
`loadNodes` 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 })`. — src/main/resources/web/js/settings.js:877
`saveNodeForm` 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 })`. — src/main/resources/web/js/settings.js:972
`removeNode` 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 })`. — src/main/resources/web/js/settings.js:1026
`testNode` 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 })`. — src/main/resources/web/js/settings.js:1047
`toggleNode` 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 })`. — src/main/resources/web/js/settings.js:1084
`checkUpdate` 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 })`. — src/main/resources/web/js/settings.js:1096
`downloadUpdate` 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 })`. — src/main/resources/web/js/settings.js:1252
`applyUpdate` 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 })`. — src/main/resources/web/js/settings.js:1320
`cancelUpdateDownload` 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 })`. — src/main/resources/web/js/settings.js:1409
`restoreUpdateStatus` 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 })`. — src/main/resources/web/js/settings.js:1421
`addModelPath` 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 })`. — src/main/resources/web/js/settings.js:1613
`addLlamaCpp` 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 })`. — src/main/resources/web/js/settings.js:1798
`testLlamaCpp` 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 })`. — src/main/resources/web/js/settings.js:1996
`fetchTokenSummary` 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 })`. — src/main/resources/web/js/usage-report.js:48
`deleteModelRecords` 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 })`. — src/main/resources/web/js/usage-report.js:64
`fetchDailyTokens` 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 })`. — src/main/resources/web/js/usage-report.js:87
`initMonthSelectors` 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 })`. — src/main/resources/web/js/usage-report.js:109
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 an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped4.4 / 10Weak✓ 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.
`window.I18N.t('page.chat.main.mcp.no_servers','暂无已连接的 MCP 服务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/chat/chat-mcp.js:489
`entries.map(function(server){const isServerEnabled=enabledUrls.has(server.url);const isCollapsed=isServerCollapsed(se…` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/chat/chat-mcp.js:491
`nid` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` 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. — src/main/resources/web/js/console-modal.js:259
`type` is text this program did not author, and it is written into a quoted attribute value through `insertAdjacentHTML` 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. (×2) — src/main/resources/web/js/download.js:64, src/main/resources/web/js/hf.js:45
`title` is text this program did not author, and it is written into the text of an element through `insertAdjacentHTML` 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. (×2) — src/main/resources/web/js/download.js:66, src/main/resources/web/js/hf.js:47
`id` is text this program did not author, and it is written into a script or style context through `insertAdjacentHTML` 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — src/main/resources/web/js/download.js:67, src/main/resources/web/js/hf.js:48
`t('common.load_failed','加载失败')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:206
`error.message||t('common.network_error','网络错误')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:207
`t('common.retry','重试')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:208
`t('download.empty.title','没有下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:222
`t('download.empty.desc','点击“创建下载任务”按钮添加新的下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:223
`t('page.download.create_task','创建下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/download.js:224
`taskId` is text this program did not author, and it is written into a quoted attribute value through markup built here 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. — src/main/resources/web/js/download.js:333
`statusText` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/download.js:366
`t('common.no_results','未找到结果')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:107
`hit.downloads` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:112
`hit.likes` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:113
`hit.parameters` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:114
`hit.pipelineTag` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:115
`escapeHtmlAttr(hit.repoId)` is text this program did not author, and it is written into a script or style context through markup built here 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — src/main/resources/web/js/hf.js:121
`t('hf.gguf.select_repo','选择一个模型以列出 GGUF 文件')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:191
`t('hf.gguf.not_found','未找到 GGUF 文件')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. (×2) — src/main/resources/web/js/hf.js:195, src/main/resources/web/js/hf.js:817
`tf('hf.gguf.shard',{count:group.partCount,total:group.partTotal},'分片 {count}/{total}')` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:203
`t('hf.gguf.copy_links','复制链接')` is text this program did not author, and it is written into the text of an element through markup built here 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. (×2) — src/main/resources/web/js/hf.js:215, src/main/resources/web/js/hf.js:840
`t('hf.gguf.create_download','创建下载')` is text this program did not author, and it is written into the text of an element through markup built here 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. (×2) — src/main/resources/web/js/hf.js:218, src/main/resources/web/js/hf.js:843
`t('hf.search.searching','正在搜索...')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:505
`t('hf.search.failed','搜索失败')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:524
`html` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:631
`t('hf.readme.empty','README 为空')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:644
`html==null?'':String(html)` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:668
`tf('hf.gguf.shard',{count:g.partCount,total:g.partTotal},'分片 {count}/{total}')` is text this program did not author, and it is written into the text of an element through markup built here 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. — src/main/resources/web/js/hf.js:830
`index` is text this program did not author, and it is written into a script or style context through markup built here 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — src/main/resources/web/js/hf.js:839, src/main/resources/web/js/hf.js:842
`t('hf.gguf.parsing','正在解析 GGUF 文件...')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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. — src/main/resources/web/js/hf.js:856
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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
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. (×33) — src/main/resources/web/js/benchmark-v3.js:369, src/main/resources/web/js/console-modal.js:304, src/main/resources/web/js/download.js:698, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×3) — src/main/resources/web/js/download.js:583, src/main/resources/web/js/model-action-modal.js:876, src/main/resources/web/js/model-detail.js:1073
`.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×3) — src/main/resources/web/js/node-cache.js:76, src/main/resources/web/js/settings.js:70, src/main/resources/web/js/settings.js:1820
`catch (e)` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — src/main/resources/web/js/newui/app.js:167
What to do
Swallowed exception (empty catch)
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 `package.json` 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 724 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/ConfigManager.java:724
`info` at line 81 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/LlamaServer.java:81
`info` at line 85 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/LlamaServer.java:85
`info` at line 90 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/LlamaServer.java:90
`info` at line 1815 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1815
`info` at line 2313 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2313
`info` at line 205 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/NettyWebServer.java:205
`info` at line 527 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:527
Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/30 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
What to do
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 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.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 31 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 48 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.
AX1 Captive dependencies — Not applicable: this repository's Java 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 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.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
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
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~2771 lines of test code exist on disk but weren't loaded from the analyzed solution (excluded from the .sln, or co-located/using a test attribute not loaded here), so test quality couldn't be assessed. Include the tests in the analyzed solution to enable this check.
D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
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
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (25 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
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, REDACTED, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — X1 reached only 39% of this repository's production lines — java (52,927 lines), c (611 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 39% of this repository's production lines — java (52,927 lines), c (611 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
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.
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.
Critical — 67 finding(s)
AC2 · Forms & labels· <label> that labels no control · ×17
<label> that labels no control src/main/resources/web/index-new.html:542— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:546— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:554— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:558— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:563— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:576— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:580— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:584— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:605— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:610— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:632— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:633— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:635— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:710— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:711— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:712— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/main/resources/web/index-new.html:713— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <input> without a programmatic label · ×12
<input> without a programmatic label src/main/resources/web/audio-transcription.html:539— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/chat/index.html:43— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/main/resources/web/index-new.html:543— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/index-new.html:581— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/index-new.html:612— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/main/resources/web/index-new.html:634— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/main/resources/web/index-new.html:635— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/main/resources/web/index-new.html:648— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/index-new.html:710— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/index-new.html:711— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label src/main/resources/web/index-new.html:712— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/main/resources/web/index-new.html:713— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <button> with no accessible text · ×5
<button> with no accessible text src/main/resources/web/index-new.html:530— 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 src/main/resources/web/index-new.html:630— 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 src/main/resources/web/index-new.html:646— 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 src/main/resources/web/index-new.html:661— 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 src/main/resources/web/index-new.html:708— 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· Clickable element isn't keyboard-operable · ×5
Clickable element isn't keyboard-operable src/main/resources/web/js/download.js:338— The repo's own CSS styles .download-name with `cursor: pointer`, so this <div> 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.
Clickable element isn't keyboard-operable src/main/resources/web/js/newui/settings.js:298— The repo's own CSS styles .set-link with `cursor: pointer`, so this <div> 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.
Clickable element isn't keyboard-operable src/main/resources/web/js/settings.js:1566— The repo's own CSS styles .model-name with `cursor: pointer`, so this <div> 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.
Clickable element isn't keyboard-operable src/main/resources/web/js/settings.js:1748— The repo's own CSS styles .model-name with `cursor: pointer`, so this <div> 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.
Clickable element isn't keyboard-operable src/main/resources/web/tools/cert-gen.html:128— The repo's own CSS styles .toast with `cursor: pointer`, so this <div> 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.
AC2 · Forms & labels· <select> without a programmatic label · ×4
<select> without a programmatic label src/main/resources/web/index-new.html:548— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label src/main/resources/web/index-new.html:555— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label src/main/resources/web/index-new.html:564— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label src/main/resources/web/index-new.html:632— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC1 · Text alternatives· <img> without a text alternative · ×2
<img> without a text alternative src/main/resources/web/js/html2canvas.min.js:3802— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative src/main/resources/web/js/html2canvas.min.js:3897— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label src/main/resources/web/chat/index.html:127— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label src/main/resources/web/index-new.html:577— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×1
Click handler on a non-interactive <span> src/main/resources/web/js/newui/hf.js:224— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×40
Untrusted text written into markup unescaped src/main/resources/web/chat/chat-mcp.js:489— `window.I18N.t('page.chat.main.mcp.no_servers','暂无已连接的 MCP 服务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/chat/chat-mcp.js:491— `entries.map(function(server){const isServerEnabled=enabledUrls.has(server.url);const isCollapsed=isServerCollapsed(se…` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/console-modal.js:259— `nid` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` 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 src/main/resources/web/js/download.js:64— `type` is text this program did not author, and it is written into a quoted attribute value through `insertAdjacentHTML` 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 src/main/resources/web/js/download.js:66— `title` is text this program did not author, and it is written into the text of an element through `insertAdjacentHTML` 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 src/main/resources/web/js/download.js:67— `id` is text this program did not author, and it is written into a script or style context through `insertAdjacentHTML` 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped src/main/resources/web/js/download.js:206— `t('common.load_failed','加载失败')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:207— `error.message||t('common.network_error','网络错误')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:208— `t('common.retry','重试')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:222— `t('download.empty.title','没有下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:223— `t('download.empty.desc','点击“创建下载任务”按钮添加新的下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:224— `t('page.download.create_task','创建下载任务')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/download.js:333— `taskId` is text this program did not author, and it is written into a quoted attribute value through markup built here 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 src/main/resources/web/js/download.js:366— `statusText` is text this program did not author, and it is written into the text of an element through markup built here 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 src/main/resources/web/js/hf.js:45— `type` is text this program did not author, and it is written into a quoted attribute value through `insertAdjacentHTML` 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 src/main/resources/web/js/hf.js:47— `title` is text this program did not author, and it is written into the text of an element through `insertAdjacentHTML` 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 src/main/resources/web/js/hf.js:48— `id` is text this program did not author, and it is written into a script or style context through `insertAdjacentHTML` 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped src/main/resources/web/js/hf.js:107— `t('common.no_results','未找到结果')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/hf.js:112— `hit.downloads` is text this program did not author, and it is written into the text of an element through markup built here 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 src/main/resources/web/js/hf.js:113— `hit.likes` is text this program did not author, and it is written into the text of an element through markup built here 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 src/main/resources/web/js/hf.js:114— `hit.parameters` is text this program did not author, and it is written into the text of an element through markup built here 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 src/main/resources/web/js/hf.js:115— `hit.pipelineTag` is text this program did not author, and it is written into the text of an element through markup built here 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 src/main/resources/web/js/hf.js:121— `escapeHtmlAttr(hit.repoId)` is text this program did not author, and it is written into a script or style context through markup built here 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped src/main/resources/web/js/hf.js:191— `t('hf.gguf.select_repo','选择一个模型以列出 GGUF 文件')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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 src/main/resources/web/js/hf.js:195— `t('hf.gguf.not_found','未找到 GGUF 文件')` is text this program did not author, and it is written into the text of an element through `innerHTML` 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.
FileTooLong: chat/index.html src/main/resources/web/chat/index.html— FileTooLong — 8097 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7597 over it, 16.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: server/LlamaServerManager.java src/main/java/org/mark/llamacpp/server/LlamaServerManager.java— FileTooLong — 2091 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: LlamaServerManager (72-3677). The bar is 500 significant lines; this is 1591 over it, 4.18× 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: js/model-action-modal.js src/main/resources/web/js/model-action-modal.js— FileTooLong — 1741 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1241 over it, 3.48× 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: js/settings.js src/main/resources/web/js/settings.js— FileTooLong — 1734 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 234 over it, 1.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: service/EasyChatService.java src/main/java/org/mark/llamacpp/server/service/EasyChatService.java— FileTooLong — 1660 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1160 over it, 3.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: web/index.html src/main/resources/web/index.html— FileTooLong — 1657 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1157 over it, 3.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: controller/ModelActionController.java src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java— FileTooLong — 1351 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ModelActionController (50-1984). The bar is 500 significant lines; this is 851 over it, 2.70× 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: controller/SystemController.java src/main/java/org/mark/llamacpp/server/controller/SystemController.java— FileTooLong — 1333 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SystemController (48-2164). The bar is 500 significant lines; this is 833 over it, 2.67× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: service/OpenAIService.java src/main/java/org/mark/llamacpp/server/service/OpenAIService.java— FileTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: OpenAIService (66-1892). The bar is 500 significant lines; this is 737 over it, 2.47× 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: js/benchmark-v3.js src/main/resources/web/js/benchmark-v3.js— FileTooLong — 1211 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 711 over it, 2.42× 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: server/LlamaServer.java src/main/java/org/mark/llamacpp/server/LlamaServer.java— FileTooLong — 1115 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: LlamaServer (75-1917). The bar is 500 significant lines; this is 615 over it, 2.23× 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: js/model-detail.js src/main/resources/web/js/model-detail.js— FileTooLong — 1111 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 611 over it, 2.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: controller/ModelInfoController.java src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java— FileTooLong — 990 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ModelInfoController (42-1473). The bar is 500 significant lines; this is 490 over it, 1.98× 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: downloader/NettyHttpDownloader.java src/main/java/org/mark/file/downloader/NettyHttpDownloader.java— FileTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: NettyHttpDownloader (46-1390). The bar is 500 significant lines; this is 443 over it, 1.89× 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: crawler/NettyHttpUtils.java src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java— FileTooLong — 852 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: NettyHttpUtils (48-1326). The bar is 500 significant lines; this is 352 over it, 1.70× 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: controller/LlamacppController.java src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java— FileTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: LlamacppController (66-1166). The bar is 500 significant lines; this is 318 over it, 1.64× 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: chat/chat-mcp.js src/main/resources/web/chat/chat-mcp.js— FileTooLong — 809 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 309 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: js/hf.js src/main/resources/web/js/hf.js— FileTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 284 over it, 1.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: mcp/McpClientService.java src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java— FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: McpClientService (40-1142). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: server/ConfigManager.java src/main/java/org/mark/llamacpp/server/ConfigManager.java— FileTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ConfigManager (31-1215). The bar is 500 significant lines; this is 240 over it, 1.48× 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: tools/CommandLineRunner.java src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java— FileTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: CommandLineRunner (28-1150). The bar is 500 significant lines; this is 236 over it, 1.47× 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: channel/FileDownloadRouterHandler.java src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java— FileTooLong — 684 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: FileDownloadRouterHandler (47-967). The bar is 500 significant lines; this is 184 over it, 1.37× 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: tools/perplexity.html src/main/resources/web/tools/perplexity.html— FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 165 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tools/mtp-bench.html src/main/resources/web/tools/mtp-bench.html— FileTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 158 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 92% of them inside a single declaration: Benchmark (8-748). The bar is 500 significant lines; this is 152 over it, 1.30× 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.
+ 14 more in this group — see findings.md.
X2 · Cancellation propagation· Async function without AbortSignal · ×39
Async function without AbortSignal: fetchConsole src/main/resources/web/js/console-modal.js:163— `fetchConsole` 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: fetchRemoteConsole src/main/resources/web/js/console-modal.js:294— `fetchRemoteConsole` 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: fetchHitsPage src/main/resources/web/js/hf.js:174— `fetchHitsPage` 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: createHfDownloadTasks src/main/resources/web/js/hf.js:402— `createHfDownloadTasks` 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: selectRepo src/main/resources/web/js/hf.js:896— `selectRepo` 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: loadBundle src/main/resources/web/js/i18n.js:46— `loadBundle` 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: calculateModelTokens src/main/resources/web/js/model-detail.js:1195— `calculateModelTokens` 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: fetchFromNetwork src/main/resources/web/js/node-cache.js:59— `fetchFromNetwork` 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: loadLlamaCppReleases src/main/resources/web/js/settings.js:105— `loadLlamaCppReleases` 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: downloadLlamaCppAsset src/main/resources/web/js/settings.js:238— `downloadLlamaCppAsset` 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: loadSettings src/main/resources/web/js/settings.js:328— `loadSettings` 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: loadHttpsCertStatus src/main/resources/web/js/settings.js:420— `loadHttpsCertStatus` 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: saveServerPorts src/main/resources/web/js/settings.js:494— `saveServerPorts` 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: saveListenAddress src/main/resources/web/js/settings.js:520— `saveListenAddress` 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: saveHttpOnlyPort src/main/resources/web/js/settings.js:545— `saveHttpOnlyPort` 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: saveNodeRole src/main/resources/web/js/settings.js:572— `saveNodeRole` 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: setMcpServer src/main/resources/web/js/settings.js:599— `setMcpServer` 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: saveSecurity src/main/resources/web/js/settings.js:624— `saveSecurity` 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: saveHttps src/main/resources/web/js/settings.js:648— `saveHttps` 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: generateHttpsCert src/main/resources/web/js/settings.js:672— `generateHttpsCert` 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: saveLogging src/main/resources/web/js/settings.js:784— `saveLogging` 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: saveDownload src/main/resources/web/js/settings.js:812— `saveDownload` 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: loadNodes src/main/resources/web/js/settings.js:877— `loadNodes` 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: saveNodeForm src/main/resources/web/js/settings.js:972— `saveNodeForm` 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: removeNode src/main/resources/web/js/settings.js:1026— `removeNode` 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 })`.
Swallowed exception (empty catch) src/main/resources/web/js/benchmark-v3.js:369— 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) src/main/resources/web/js/console-modal.js:304— 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) src/main/resources/web/js/download.js:583— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/main/resources/web/js/download.js:698— 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) src/main/resources/web/js/hf.js:62— 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) src/main/resources/web/js/hf.js:660— 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) src/main/resources/web/js/hf.js:728— 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) src/main/resources/web/js/i18n.js:30— 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) src/main/resources/web/js/i18n.js:113— 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) src/main/resources/web/js/i18n.js:131— 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) src/main/resources/web/js/i18n.js:144— 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) src/main/resources/web/js/model-action-modal.js:876— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/main/resources/web/js/model-action-modal.js:1384— 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) src/main/resources/web/js/model-benchmark.js:65— 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) src/main/resources/web/js/model-detail.js:363— 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) src/main/resources/web/js/model-detail.js:1073— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/main/resources/web/js/model-list.js:491— 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) src/main/resources/web/js/model-list.js:551— 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) src/main/resources/web/js/model-list.js:590— 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) src/main/resources/web/js/model-list.js:618— 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) src/main/resources/web/js/node-cache.js:37— 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) src/main/resources/web/js/node-cache.js:46— 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) src/main/resources/web/js/node-cache.js:54— 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) src/main/resources/web/js/node-cache.js:76— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/main/resources/web/js/settings.js:70— `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
ClassTooLong: LlamaServerManager src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:72— ClassTooLong — 2027 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 400 significant lines; this is 1627 over it, 5.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelActionController src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:50— ClassTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 910 over it, 3.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SystemController src/main/java/org/mark/llamacpp/server/controller/SystemController.java:48— ClassTooLong — 1296 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 896 over it, 3.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: OpenAIService src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:66— ClassTooLong — 1180 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 780 over it, 2.95× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LlamaServer src/main/java/org/mark/llamacpp/server/LlamaServer.java:75— ClassTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 650 over it, 2.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.
ClassTooLong: ModelInfoController src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:42— ClassTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 558 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NettyHttpDownloader src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:46— ClassTooLong — 908 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 508 over it, 2.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.
ClassTooLong: NettyHttpUtils src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:48— ClassTooLong — 823 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 423 over it, 2.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: LlamacppController src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:66— ClassTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 361 over it, 1.90× 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: McpClientService src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:40— ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 323 over it, 1.81× 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: ConfigManager src/main/java/org/mark/llamacpp/server/ConfigManager.java:31— ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 318 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CommandLineRunner src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:28— ClassTooLong — 715 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 315 over it, 1.79× 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: FileDownloadRouterHandler src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:47— ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 246 over it, 1.62× 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: ModelSamplingService src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:24— ClassTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 228 over it, 1.57× 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: BuildTaskManager src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:38— ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 191 over it, 1.48× 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: AnthropicService src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:48— ClassTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 177 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MtpHelper src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:28— ClassTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 152 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SimpleHttpDownloader src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:30— ClassTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 119 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BasicRouterHandler src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:70— ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 105 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StreamingForwarder src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:21— ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 101 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EasyChatController src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:50— ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 70 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EasyChatStorage src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:27— ClassTooLong — 460 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 60 over it, 1.15× 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: DownloadTaskManager src/main/java/org/mark/file/downloader/DownloadTaskManager.java:27— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 36 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: HuggingFaceSearcher src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:29— ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 52 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BenchmarkService src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:41— ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 48 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:122— src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:122-128 | src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:152-158 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:122` 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) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1156— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1156-1162 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1205-1211 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1212` calls `addProperty` and `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1164` 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) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2453— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2453-2459 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2608-2614 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:525— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:525-531 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1069-1075 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1452— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1452-1458 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:61-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:143— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:143-150 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:475-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:690— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:690-696 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:931-937 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:690` 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) src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:78— src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:78-84 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:102-108 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:245— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:245-251 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:296-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:210— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:210-216 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:281-287 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:235— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:235-241 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:218-224 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:195— src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:195-201 | src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:220-226 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:772— src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:772-778 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:820-826 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:772` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:201— src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:201-207 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:219-225 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:226` calls `addProperty` and `src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:208` 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) src/main/java/org/mark/project/tools/proxy/ProxyFrontendHandler.java:118— src/main/java/org/mark/project/tools/proxy/ProxyFrontendHandler.java:118-124 | src/main/java/org/mark/project/tools/proxy/ProxyFrontendHandler.java:192-198 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/project/tools/proxy/ProxyFrontendHandler.java:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:281— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:281-287 | src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:303-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:281` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252-258 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:937-943 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:575— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:575-581 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:197-203 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:939— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:939-945 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:371-377 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (7 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:947— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:947-953 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:379-385 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1176— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1176-1182 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:591-597 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:496— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:496-502 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:289-295 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:48— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:48-54 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:60-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:214— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:214-220 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:371-377 — 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) REDACTED:626— REDACTED:626-632 | REDACTED:644-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
+ 1 more in this group — see findings.md.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×24
Animation without a prefers-reduced-motion guard src/main/resources/web/audio-transcription.html:361— `.submit-btn .spinner` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/audio-transcription.html:452— `.toast` moves (`animation: toastIn 0.2s var(--ease-spring) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/audio-transcription.html:460— `.toast.exiting` moves (`animation: toastOut 0.2s ease both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:166— `.sidebar-quick-links-chevron` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:180— `.sidebar-quick-links-list` moves (`transition: max-height 0.3s ease, opacity 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:929— `#main-benchmark-v3 .param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:1112— `#benchParamsModal .param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:1905— `#main-settings .llamacpp-asset-progress .update-progress-bar-inner` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/index.html:2046— `#main-sysinfo .ff-progress-fill` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/benchmark-v3.html:78— `.param-group-summary::before` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/cert-gen.html:45— `.spinner` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/cert-gen.html:48— `.toast.show` moves (`animation: fadeInOut 2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/gguf-mem-test.html:205— `.param-section-header .chevron` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/gguf-mem-test.html:216— `.param-section-body` moves (`transition: max-height 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/gguf-mem-test.html:293— `.toggle-track::after` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/gguf-mem-test.html:393— `.spinner` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/gguf-mem-test.html:422— `.toast` moves (`animation: slideIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/llama-build.html:287— `.progress-bar-fill` moves (`transition: width 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/llama-build.html:320— `.toast` moves (`animation: slideIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/mtp-bench.html:57— `.progress-bar .fill` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/perplexity.html:40— `.progress-bar .fill` moves (`transition: width 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/perplexity.html:89— `#perplexityParamsModal .param-group-summary::after` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/upload-test.html:156— `.progress-bar-fill` moves (`transition: width 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/main/resources/web/tools/upload-test.html:355— `.toast` moves (`animation: slideIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:110— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:110-117 | src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:156-163 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:408— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:408-415 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1009-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:650— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:650-657 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:672-679 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:650` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:220— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:220-227 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:250-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:234— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:234-242 | src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:207-214 — 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 `request` to `FullHttpRequest` in one and `HttpRequest` 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 (8 lines × 2) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:400— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:400-407 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:977-984 — 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 `src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:400` 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) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:312— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:312-319 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:388-395 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:808— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:808-815 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:870-877 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:158— src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:158-165 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:209-216 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ProxyController.java: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 (8 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1690— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1690-1697 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1817-1824 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:188— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:188-195 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1085-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:237— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:237-244 | src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:334-341 — 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:342` calls `info` and `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:245` 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) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:393— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:393-400 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:931-938 — 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 `src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:393` 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 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:114— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:114-121 | src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:165-172 — 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:213— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:213-220 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:358-365 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 (8 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:259— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:259-266 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1203-1212 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:316— src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:316-323 | src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:550-557 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:316` 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) src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:194— src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:194-201 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:239-246 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/update/LetsUpdate.java:305— src/main/java/org/mark/llamacpp/update/LetsUpdate.java:305-312 | src/main/java/org/mark/llamacpp/update/LetsUpdate.java:316-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 `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) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1101— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1101-1108 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1279-1286 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:140— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:140-147 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1324-1331 — both copies are in the same file, so extract the 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1294— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1294-1301 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:705-712 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1294` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:504— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:504-511 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:300-307 — 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) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:513— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:513-520 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:309-316 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:361— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:361-370 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:466-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:361` 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1097— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1097-1106 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:520-529 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1108` calls `fail`, `completeExceptionally` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:531` 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:126— src/main/java/org/mark/llamacpp/server/ConfigManager.java:126-135 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:312-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/ConfigManager.java: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.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:548— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:548-557 | src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:561-570 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:548` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:627— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:627-636 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:466-475 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:627` 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) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:905— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:905-914 | src/main/java/org/mark/llamacpp/server/controller/CertController.java:149-158 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:171— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:171-180 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:248-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:829— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:829-838 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:894-903 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:676— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:676-685 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:708-717 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1301— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1301-1310 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1351-1360 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1301` 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 (10 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1661— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1661-1670 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1784-1793 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1661` 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:232— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:232-241 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:385-394 — 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 `src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:232` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:255— src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:255-264 | src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:285-294 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:259— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:259-268 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:275-284 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:258` calls `isEmpty`, `getJsonString` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:274` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:732— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:732-741 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:743-752 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:761— src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:761-770 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:809-818 — both copies are in the same file, so extract the 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1379— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1379-1388 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:762-771 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1379` 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:500— src/main/java/org/mark/llamacpp/server/ConfigManager.java:500-509 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:549-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/ConfigManager.java:500` 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 (10 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1040— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1040-1049 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:463-472 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (10 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1070— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1070-1079 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:493-502 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (10 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1262— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1262-1271 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:675-684 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (10 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:103— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:103-112 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:167-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:255— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:255-264 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:261-270 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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.
TooManyMethods: LlamaServerManager src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:72— TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.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: LlamaServer src/main/java/org/mark/llamacpp/server/LlamaServer.java:75— TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EasyChatService src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:61— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× 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: SystemController src/main/java/org/mark/llamacpp/server/controller/SystemController.java:48— 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: McpClientService src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:40— 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: ModelSamplingService src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:24— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ConfigManager src/main/java/org/mark/llamacpp/server/ConfigManager.java:31— 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: EasyChatStorage src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:27— 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: CommandLineRunner src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:28— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.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.
TooManyMethods: LlamaCppProcess src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:42— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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: OpenAIService src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:66— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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: NettyHttpDownloader src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:46— 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: DownloadTaskManager src/main/java/org/mark/file/downloader/DownloadTaskManager.java:27— 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.
TooManyMethods: HuggingFaceSearcher src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:29— 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.
TooManyMethods: BuildTaskManager src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:38— 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.
TooManyMethods: BinaryRequestLog src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:18— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GGUFMetaData src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:18— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ModelActionController src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:50— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NodeManager REDACTED:40— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SimpleHttpDownloader src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:30— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DownloadTaskInfo src/main/java/org/mark/file/downloader/DownloadTaskInfo.java:5— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChatStateController src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:47— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) src/main/java/org/mark/file/downloader/DownloadTaskManager.java:633— src/main/java/org/mark/file/downloader/DownloadTaskManager.java:633-637 | src/main/java/org/mark/file/downloader/DownloadTaskManager.java:643-647 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/file/downloader/DownloadTaskManager.java:633` 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, `src/main/java/org/mark/file/downloader/DownloadTaskManager.java:648` calls `write` and `src/main/java/org/mark/file/downloader/DownloadTaskManager.java:638` 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) src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:178— src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:178-182 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:203-207 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:254— src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:254-258 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:455-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:253— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:253-257 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1962-1966 — 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 `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/CertController.java:92— src/main/java/org/mark/llamacpp/server/controller/CertController.java:92-96 | src/main/java/org/mark/llamacpp/server/controller/CertController.java:362-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/CertController.java:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1468— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1468-1472 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1587-1591 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1636— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1636-1640 | src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:461-465 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:146— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:146-150 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:326-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:324` calls `toString` and `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:144` 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) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:251— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:251-255 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:326-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:686— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:686-690 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:813-817 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1590— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1590-1595 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2136-2140 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ToolController.java:261— src/main/java/org/mark/llamacpp/server/controller/ToolController.java:261-265 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:319-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ToolController.java:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:579— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:579-585 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1704-1708 — 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:579` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1226— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1226-1230 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:639-643 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:692— src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:692-696 | src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:384-388 — 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 (5 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1089— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1089-1093 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3524-3528 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1089` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:620— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:620-624 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:626-630 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:814— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:814-818 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:883-887 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:813` calls `getInstance` and `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:881` 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1046— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1046-1050 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1684-1688 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:423— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:423-427 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:155-159 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:160` calls `addProperty`, `add`, `buildModelStatus` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:428` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:142— src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:142-146 | src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:174-178 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:172` calls `put` and `src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:139` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1369— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1369-1375 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:753-758 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note 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, `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:748` calls `ProbeResult`, `DownloadResult` and `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1362` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:599— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:599-604 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:726-731 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:599` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:487— src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:487-492 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:93-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:330— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:330-335 | src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:177-183 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:289— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:289-294 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:654-659 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:289` 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 (6 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:878— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:878-884 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1806-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:878` 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) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1437— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1437-1442 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1459-1464 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1437` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:471— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:471-476 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:109-114 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:471` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:629— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:629-634 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:681-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:629` 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, `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:678` calls `warn` and `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:625` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:140— src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:140-145 | src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:155-160 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:140` 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) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:895— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:895-900 | src/main/java/org/mark/llamacpp/server/controller/CertController.java:141-146 — 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) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1227— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1227-1232 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:938-943 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:340— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:340-345 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1107-1112 — 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 `src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:340` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1072— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1072-1077 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2241-2246 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1072` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:692— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:692-697 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:848-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:904— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:904-910 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:341-346 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (6 lines × 2) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:506— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:506-511 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:543-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.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:870— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:870-875 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1029-1034 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:304— src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:304-309 | src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:482-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:304` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1763— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1763-1768 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1834-1839 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1842` calls `headers`, `set` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1772` 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.
MethodTooLong: AnthropicService.convertAnthropicToOai src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:749— MethodTooLong — convertAnthropicToOai runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LlamaServer.main src/main/java/org/mark/llamacpp/server/LlamaServer.java:78— MethodTooLong — main runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CertController.handleGenerate src/main/java/org/mark/llamacpp/server/controller/CertController.java:165— MethodTooLong — handleGenerate runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SystemController.handleFsListRequest src/main/java/org/mark/llamacpp/server/controller/SystemController.java:285— MethodTooLong — handleFsListRequest runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModelActionController.handleModelBenchmark src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1128— MethodTooLong — handleModelBenchmark runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MtpHelper.mergeDonor src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:283— MethodTooLong — mergeDonor runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.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.
MethodTooLong: LlamaServerManager.loadModelInBackgroundFromCmd src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2138— MethodTooLong — loadModelInBackgroundFromCmd runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIService.forwardStreamToRemote src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:630— MethodTooLong — forwardStreamToRemote runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PerplexityService.run src/main/java/org/mark/llamacpp/server/service/PerplexityService.java:86— MethodTooLong — run runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FileUploadRouterHandler.channelRead src/main/java/org/mark/llamacpp/server/channel/FileUploadRouterHandler.java:50— MethodTooLong — channelRead runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LlamaServerManager.buildAutoLoadModelCache src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1136— MethodTooLong — buildAutoLoadModelCache runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.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.
MethodTooLong: ModelSamplingService.applySamplingFromCmd src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:409— MethodTooLong — applySamplingFromCmd runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.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.
MethodTooLong: GGUFMetaData.readFile src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:76— MethodTooLong — readFile runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BinaryRequestLog.migrateV1toV2 src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:424— MethodTooLong — migrateV1toV2 runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LlamaServerManager.listModel src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:327— MethodTooLong — listModel runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BenchmarkService.generatePromptForTargetTokens src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:308— MethodTooLong — generatePromptForTargetTokens runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (9 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:356— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:356-364 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:452-464 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2505— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2505-2513 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2514-2522 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2542— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2542-2550 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2624-2632 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:301— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:301-309 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:666-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:598— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:598-606 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1106-1114 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ToolController.java:229— src/main/java/org/mark/llamacpp/server/controller/ToolController.java:229-237 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:271-279 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ToolController.java:229` 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) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:273— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:273-281 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1863-1871 — 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 `src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:275— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:275-283 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:286-294 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/update/LetsUpdate.java:89— src/main/java/org/mark/llamacpp/update/LetsUpdate.java:89-97 | src/main/java/org/mark/llamacpp/update/LetsUpdate.java:299-307 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/update/LetsUpdate.java:89` 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) src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:85— src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:85-93 | src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:339-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:79— src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:79-87 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:847-855 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:847— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:847-855 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1297-1305 — 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) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:683— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:683-691 | src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:147-158 — 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:612— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:612-625 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:725-738 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:686-699 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1255-1268 — 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:224— src/main/java/org/mark/llamacpp/server/ConfigManager.java:224-241 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:948-961 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1036-1049 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1146-1163 — 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:655— REDACTED:655-665 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:532-556 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1041-1058 | src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:539-556 — 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) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:393— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:393-436 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:443-477 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:484-518 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:525-565 — 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) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:235— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:235-263 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1944-1972 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1414-1442 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1861-1889 — 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1063— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1063-1136 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:467-600 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:166-720 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2294-2354 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:281— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:281-315 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:646-677 | src/main/java/org/mark/llamacpp/server/controller/ParamController.java:62-85 | src/main/java/org/mark/llamacpp/server/controller/ParamController.java:95-117 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:853— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:853-890 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1589-1615 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1764-1840 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2031-2090 — 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) src/main/java/org/mark/llamacpp/server/controller/NodeController.java:86— src/main/java/org/mark/llamacpp/server/controller/NodeController.java:86-147 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:149-178 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:180-221 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:223-270 — 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) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:102— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:102-121 | src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:151-177 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:540-552 | src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:60-80 — 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) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:736— src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:736-755 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:757-776 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:778-810 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:812-834 — 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) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:542— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:542-577 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:580-628 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:631-787 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1386-1433 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (11 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:228— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:228-238 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:164-174 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:228` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:227` calls `info` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:163` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:335— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:335-345 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:444-454 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:335` 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 × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:757— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:757-767 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1185-1195 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:757` 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:511— src/main/java/org/mark/llamacpp/server/ConfigManager.java:511-521 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:569-579 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:951— src/main/java/org/mark/llamacpp/server/ConfigManager.java:951-961 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1039-1049 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/ConfigManager.java:951` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1360— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1360-1370 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1564-1574 — both copies are in the same file, so extract the 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:846— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:846-856 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:913-923 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:846` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:379— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:379-389 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:105-115 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:379` 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:116` calls `getModelCapabilities`, `getValue`, `getCtxSize` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:390` 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) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:151— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:151-161 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:168-178 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:150` calls `isEmpty`, `getJsonString` and `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:167` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:659— src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:659-669 | src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:692-702 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:659` 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 × 2) src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:85— src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:85-95 | src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:104-114 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:85` 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 × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:514— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:514-524 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:636-646 — 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.
AC3 · Page structure· Page without a main landmark · ×11
Page without a main landmark src/main/resources/web/audio-transcription.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 src/main/resources/web/index-new.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 src/main/resources/web/tools/benchmark-v2.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 src/main/resources/web/tools/benchmark-v3.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 src/main/resources/web/tools/cert-gen.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 src/main/resources/web/tools/gguf-mem-test.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 src/main/resources/web/tools/llama-build.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 src/main/resources/web/tools/mcp-manager.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 src/main/resources/web/tools/mtp-bench.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 src/main/resources/web/tools/perplexity.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 src/main/resources/web/tools/upload-test.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC4 · Keyboard semantics· Link used as a button (placeholder href) · ×9
Link used as a button (placeholder href) src/main/resources/web/index.html:2421— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2429— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2433— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2437— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2441— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2445— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2449— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2454— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Link used as a button (placeholder href) src/main/resources/web/index.html:2458— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
Duplicated block (17 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1052— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1052-1068 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:475-491 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1189— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1189-1205 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:604-620 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:665— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:665-681 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:712-728 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:665` 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) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:113— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:113-129 | src/main/java/org/mark/llamacpp/server/controller/BuildController.java:268-284 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/BuildController.java:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/controller/BuildController.java:130` calls `trimToNull`, `getJsonString` and `src/main/java/org/mark/llamacpp/server/controller/BuildController.java:286` 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:418— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:418-434 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:640-656 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:795— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:795-811 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:865-881 — both copies are in the same file, so extract the 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 after the matched lines, `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:813` calls `getInstance` and `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:883` 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 (17 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1746— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1746-1762 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1843-1859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ToolController.java:210— src/main/java/org/mark/llamacpp/server/controller/ToolController.java:210-226 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:243-259 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ToolController.java:210` 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) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:229— src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:229-245 | src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:338-354 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1155— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1155-1169 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:570-584 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:28— src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:28-42 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:555-569 — 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 `src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:28` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `file` to `java.io.File` in one and `File` 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 (15 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:447— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:447-461 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:578-592 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:464— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:464-478 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:595-609 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:489— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:489-503 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:620-634 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:489` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:382— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:382-396 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:607-621 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1235— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1235-1249 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:390-404 — 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, `src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:389` calls `isRocmCommand` and `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1232` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:225— src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:225-239 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:318-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:317— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:317-331 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:418-432 — both copies are in the same file, so extract the 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:917— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:917-929 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:349-361 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:535— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:535-547 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:696-708 — both copies are in the same file, so extract the 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) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:438— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:438-450 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:215-227 — 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 (13 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:376— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:376-388 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:509-521 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:910— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:910-922 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1048-1060 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:910` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:444— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:444-456 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1006-1018 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:181— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:181-193 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1358-1370 — 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 `src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:181` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2972— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2972-2984 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3000-3012 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2972` 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 (13 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:1471— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:1471-1483 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1879-1891 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2 locations) src/main/resources/web/chat/chat-mcp.js:936— src/main/resources/web/chat/chat-mcp.js:936 · src/main/resources/web/chat/chat-mcp.js:950 — 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 (12 lines × 2 locations) src/main/resources/web/js/model-action-modal.js:1631— src/main/resources/web/js/model-action-modal.js:1631 · src/main/resources/web/js/model-action-modal.js:1689 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/model-detail.js:196— src/main/resources/web/js/model-detail.js:196 · src/main/resources/web/js/model-detail.js:229 — 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 (12 lines × 2 locations) src/main/resources/web/js/model-detail.js:917— src/main/resources/web/js/model-detail.js:917 · src/main/resources/web/js/model-detail.js:1006 — 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 (12 lines × 2 locations) src/main/resources/web/js/model-detail.js:1095— src/main/resources/web/js/model-detail.js:1095 · src/main/resources/web/js/model-detail.js:1119 — 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 (12 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:161— src/main/resources/web/js/newui/usage-report.js:161 · src/main/resources/web/js/usage-report.js:137 — 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 (12 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:585— src/main/resources/web/js/newui/usage-report.js:585 · src/main/resources/web/js/usage-report.js:308 — 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 (12 lines × 2 locations) src/main/resources/web/js/settings.js:498— src/main/resources/web/js/settings.js:498 · src/main/resources/web/js/settings.js:550 — 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.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×7
Edited copy of a member (11 corresponding lines) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:148— src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:148-158 | src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:164-176 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:189— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:189-199 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:450-468 — 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) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:271— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:271-281 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1859-1871 — 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) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1246— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1246-1256 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1274-1284 — 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) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:243— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:243-253 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:226-236 — 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) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:187— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:187-198 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1084-1094 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:201— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:201-212 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:359-369 — 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 (14 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:841— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:841-854 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:963-976 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:841` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1570— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1570-1583 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1621-1634 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1569` calls `get` and `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1619` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:549— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:549-562 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:624-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1738— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1738-1751 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:228-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:302— src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:302-315 | src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:318-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:788— src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:788-801 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:865-878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:788` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:228— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:228-241 | src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:325-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:228` 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 (12 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1274— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1274-1285 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1322-1333 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1274` 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) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2931— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2931-2942 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:70-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:608— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:608-619 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:383-394 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:608` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:212— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:212-223 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:197-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:60— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:60-71 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:67-78 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 (12 lines × 2) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:131— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:131-142 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:108-119 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (12 lines × 2) src/main/java/org/mark/llamacpp/server/ConfigManager.java:968— src/main/java/org/mark/llamacpp/server/ConfigManager.java:968-979 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1056-1067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2 locations) src/main/resources/web/chat/chat-mcp.js:894— src/main/resources/web/chat/chat-mcp.js:894 · src/main/resources/web/chat/chat-mcp.js:914 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/download.js:373— src/main/resources/web/js/download.js:373 · src/main/resources/web/js/download.js:401 — 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 (17 lines × 2 locations) src/main/resources/web/js/lz-string.js:355— src/main/resources/web/js/lz-string.js:355 · src/main/resources/web/js/lz-string.js:413 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/model-action-modal.js:1879— src/main/resources/web/js/model-action-modal.js:1879 · src/main/resources/web/js/model-action-modal.js:1928 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/model-list.js:664— src/main/resources/web/js/model-list.js:664 · src/main/resources/web/js/model-list.js:742 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/newui/usage-report.js:546— src/main/resources/web/js/newui/usage-report.js:546 · src/main/resources/web/js/usage-report.js:269 — 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 (17 lines × 2 locations) src/main/resources/web/js/usage-report.js:402— src/main/resources/web/js/usage-report.js:402 · src/main/resources/web/js/usage-report.js:500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/tools/gguf-mem-test.html:231— `.device-tag` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/tools/gguf-mem-test.html:325— `.btn-primary` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/tools/llama-build.html:163— `.preset-btn.active` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/tools/llama-build.html:182— `.btn-primary` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/tools/upload-test.html:187— `.btn-primary` sets color: #fff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.0:1) src/main/resources/web/css/index.css:178— `[data-theme="dark"] .settings-tab.active` sets color: #ffffff on background-color: #818cf8 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
(anonymous)::_compress (cognitive 150) src/main/resources/web/js/lz-string.js:109— (anonymous)::_compress has cognitive complexity 150 (threshold 15). Drivers by points: if/else 41 (104 pts), loops 13 (46 pts) (nesting depth added 96). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::token (cognitive 136) REDACTED:65— (anonymous)::token has cognitive complexity 136 (threshold 15). Drivers by points: if/else 33 (91 pts), ternaries 6 (21 pts), loops 6 (16 pts), boolean chains 8 (nesting depth added 83). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::_decompress (cognitive 69) src/main/resources/web/js/lz-string.js:332— (anonymous)::_decompress has cognitive complexity 69 (threshold 15). Drivers by points: if/else 13 (32 pts), ternaries 6 (19 pts), loops 8 (15 pts), match/switch 2 (3 pts) (nesting depth added 40). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::output (cognitive 57) REDACTED:336— (anonymous)::output has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 8, ternaries 2 (7 pts), loops 1 (nesting depth added 27). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::tok (cognitive 22) REDACTED:608— (anonymous)::tok has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (15 pts), ternaries 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::marked (cognitive 19) REDACTED:721— (anonymous)::marked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×6
Edited copy of a member (13 corresponding lines) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:525— src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:525-537 | src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:540-553 — 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:86— REDACTED:86-98 | REDACTED:321-338 — 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) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:229— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:229-241 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:212-224 — 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) src/main/java/org/mark/llamacpp/server/tools/ChatTemplateFileTool.java:58— src/main/java/org/mark/llamacpp/server/tools/ChatTemplateFileTool.java:58-70 | src/main/java/org/mark/llamacpp/server/tools/ChatTemplateFileTool.java:72-85 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:179— src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:179-191 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:339-354 — 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) src/main/java/org/mark/llamacpp/win/WindowsTray.java:156— src/main/java/org/mark/llamacpp/win/WindowsTray.java:156-168 | src/main/java/org/mark/llamacpp/win/WindowsTray.java:170-184 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (16 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:430— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:430-445 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:561-576 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3198— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3198-3213 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3291-3306 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3198` 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:546— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:546-561 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:69-84 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:546` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1253— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1253-1268 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:409-424 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1253` 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) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:602— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:602-617 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:654-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:602` 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, `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:651` calls `info` and `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:599` 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1304— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1304-1319 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:715-730 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:439— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:439-445 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:626-632 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1439-1445 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:634` calls `setDoOutput` and `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:447` 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 × 3) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:401— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:401-407 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:472-478 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:978-984 — 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 `src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:401` 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 × 3) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:226— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:226-232 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:212-218 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:398-404 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:226` 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 × 3) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:674— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:674-680 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:702-708 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:726-732 — 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:674` 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 × 3) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1051— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1051-1057 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1666-1672 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1789-1795 — 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 (7 lines × 3) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:311— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:311-317 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1977-1983 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1466-1472 — 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.
(anonymous)::token (cyclomatic 51) REDACTED:65— (anonymous)::token has cyclomatic complexity 51 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::_compress (cyclomatic 38) src/main/resources/web/js/lz-string.js:109— (anonymous)::_compress has cyclomatic complexity 38 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::_decompress (cyclomatic 32) src/main/resources/web/js/lz-string.js:332— (anonymous)::_decompress has cyclomatic complexity 32 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::output (cyclomatic 29) REDACTED:336— (anonymous)::output has cyclomatic complexity 29 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
(anonymous)::tok (cyclomatic 23) REDACTED:608— (anonymous)::tok has cyclomatic complexity 23 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
FunctionTooLong: chat-mcp.create src/main/resources/web/chat/chat-mcp.js:278— FunctionTooLong — create runs 603 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 503 over it, 6.03× 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: model-list.renderModelsList src/main/resources/web/js/model-list.js:293— FunctionTooLong — renderModelsList runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: model-action-modal.submitModelAction src/main/resources/web/js/model-action-modal.js:1617— FunctionTooLong — submitModelAction runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: model-action-modal.applyCmdToDynamicFields src/main/resources/web/js/model-action-modal.js:309— FunctionTooLong — applyCmdToDynamicFields runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: settings.checkUpdate src/main/resources/web/js/settings.js:1096— FunctionTooLong — checkUpdate runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×5
Edited copy of a member (12 corresponding lines) src/main/java/org/mark/llamacpp/server/ConfigManager.java:687— src/main/java/org/mark/llamacpp/server/ConfigManager.java:687-698 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:730-747 — 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) src/main/java/org/mark/llamacpp/server/service/ModelRequestTracker.java:90— src/main/java/org/mark/llamacpp/server/service/ModelRequestTracker.java:90-101 | src/main/java/org/mark/llamacpp/server/service/ModelRequestTracker.java:119-131 — 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) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:84— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:84-95 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:92-103 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:226— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:226-238 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:163-174 — 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) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:405— src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:405-416 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:418-429 — 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 × 3) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:627— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:627-639 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:688-700 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:735-747 — 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 `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:525— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:525-537 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:543-555 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:558-570 — 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 (13 lines × 3) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:616— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:616-628 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:775-787 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1421-1433 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1640— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1640-1654 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1666-1678 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1682-1694 — 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 (13 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3097— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3097-3109 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3193-3205 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3286-3298 — 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, `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3190` calls `handleFitParam`, `splitCmdArgs` and `src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3093` 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–12 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:785— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:785-796 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1214-1224 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:785` 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–12 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1442— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1442-1453 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1468-1478 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServer.java:1442` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:98— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:98-108 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:809-820 — 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 `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:94— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:94-105 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:150-160 — 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 `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1772— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1772-1782 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1843-1854 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1772` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1842` calls `headers`, `set` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1771` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:662— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:662-671 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:709-718 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:784-793 — 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 `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:662` 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, `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:706` calls `startsWith`, `IllegalArgumentException` and `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:661` 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 × 3) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1376— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1376-1385 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1429-1438 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1557-1566 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1376` 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 (10 lines × 3) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233-242 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:712-721 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1017-1026 — 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 `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233` 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 (10 lines × 3) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:225— src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:225-234 | src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:178-187 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:318-327 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:225` 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 (10 lines × 3) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:123— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:123-132 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:101-110 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:73-82 — 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 (6 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:781— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:781-786 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:802-807 | src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:329-334 — 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 (6 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:348— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:348-353 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:764-769 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:877-882 — 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 `src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:669— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:669-674 | src/main/java/org/mark/llamacpp/server/controller/ParamController.java:77-82 | src/main/java/org/mark/llamacpp/server/controller/ParamController.java:109-114 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:669` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:212— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:212-217 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:283-288 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:357-362 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:534— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:534-539 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:637-642 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:747-752 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2 locations) src/main/resources/web/js/lz-string.js:429— src/main/resources/web/js/lz-string.js:429 · src/main/resources/web/js/lz-string.js:448 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/model-action-modal.js:816— src/main/resources/web/js/model-action-modal.js:816 · src/main/resources/web/js/model-action-modal.js:837 — 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 (13 lines × 2 locations) src/main/resources/web/js/model-action-modal.js:1090— src/main/resources/web/js/model-action-modal.js:1090 · src/main/resources/web/js/model-action-modal.js:1195 — 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 (13 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:347— src/main/resources/web/js/newui/usage-report.js:347 · src/main/resources/web/js/newui/usage-report.js:419 — both copies are in the same file, so extract the 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 locations) src/main/resources/web/js/settings.js:523— src/main/resources/web/js/settings.js:523 · src/main/resources/web/js/settings.js:814 — 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.
Change coupling: UsageReportService.java ↔ usage-report.js src/main/java/org/mark/llamacpp/server/service/UsageReportService.java:1— `src/main/java/org/mark/llamacpp/server/service/UsageReportService.java` and `src/main/resources/web/js/usage-report.js` 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 `a4cd1473` 优化:将原本的文本格式日志转为byte格式,并增加转换方法,兼容旧的文本日志; `c492afde` 优化:用量统计可以选择模型来查看每日用量; `11ed0424` 优化:通量统计的展示效果;增加切换中英文的按钮;补充缺少的i18n — run `git show` on any of them.
Change coupling: BasicRouterHandler.java ↔ LlamaRouterHandler.java src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:1— `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java` and `src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `8ab1201f` 增加:llama.cpp-ui的兼容API支持远程节点聚合; `e8a07052` 增加:llama.cpp-ui的兼容API,补全剩余的部分,现在可以正常使用了; `d5a39709` 增加:llama.cpp-ui的兼容API:/slots — run `git show` on any of them.
Change coupling: FileDownloadRouterHandler.java ↔ download.js src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:1— `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java` and `src/main/resources/web/js/download.js` 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) 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 6 shared commits counted here, the most recent 3 are `0bbaa3e3` 增加:总之,先放初版的模型搜索进来; `a11d9494` 修复BUG:下载管理中,无法正确地删除远程节点的任务; `77138cc3` 功能修改:修改了下载功能,并且支持远程节点(顺便删掉不再使用的marked.min.js) — run `git show` on any of them.
Change coupling: AnthropicService.java ↔ OpenAIService.java src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:1— `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java` change together 59% of the time (20 of the 34 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `abbd68ba` 草稿:增加clone模型,修改API端点相关的操作逻辑和websocket通知逻辑; `10f83b41` 增加:模型可以设置自动卸载的时间,空闲状态超过指定时间后,自动卸载; `1e70f16c` 修复:流式传输的换行符问题 — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×4
Edited copy of a member (23 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:542— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:542-565 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:66-88 — 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.
Edited copy of a member (23 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1890— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1890-1912 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1917-1939 — 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.
Edited copy of a member (23 corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:542— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:542-564 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1111-1138 — 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.
Edited copy of a member (23 corresponding lines) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:205— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:205-227 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:309-336 — 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 (20 corresponding lines) · ×4
Edited copy of a member (20 corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1368— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1368-1389 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:752-771 — 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.
Edited copy of a member (20 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2971— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2971-2990 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2999-3018 — 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.
Edited copy of a member (20 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1059— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1059-1084 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1560-1579 — 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.
Edited copy of a member (20 corresponding lines) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:123— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:123-146 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:263-282 — 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 copy of a member (19 corresponding lines) · ×4
Edited copy of a member (19 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:425— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:425-449 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:272-290 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:862— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:862-880 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1023-1041 — 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) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:59— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:59-77 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:66-85 — 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) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:698— src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:698-716 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:856-874 — 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 (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:252— src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:252-275 | src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:421-442 — 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) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:547— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:547-571 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:623-644 — 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) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:413— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:413-434 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:635-656 — 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:25— REDACTED:25-47 | REDACTED:55-76 — 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 (17 corresponding lines) · ×4
Edited copy of a member (17 corresponding lines) src/main/java/org/mark/llamacpp/server/service/UsageReportService.java:85— src/main/java/org/mark/llamacpp/server/service/UsageReportService.java:85-111 | src/main/java/org/mark/llamacpp/server/service/UsageReportService.java:159-175 — 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) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:708— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:708-724 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1009-1029 — 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:749— src/main/java/org/mark/llamacpp/server/ConfigManager.java:749-766 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:768-784 — 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) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:416— src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:416-432 | src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:173-192 — 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 (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:462— src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:462-470 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:472-486 — 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) src/main/java/org/mark/file/downloader/DownloadTaskManager.java:632— src/main/java/org/mark/file/downloader/DownloadTaskManager.java:632-640 | src/main/java/org/mark/file/downloader/DownloadTaskManager.java:642-651 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:120— src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:120-128 | src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:138-146 — 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) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:101— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:101-109 | src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:116-124 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×4
Edited copy of a member (4 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:748— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:748-751 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2684-2687 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:678— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:678-681 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:484-491 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:743— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:743-746 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2679-2682 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1249— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1249-1252 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:662-665 — 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 (8 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:438— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:438-445 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3653-3660 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:569-576 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:728— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:728-736 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1135-1143 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:169-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:439— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:439-446 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:626-633 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:465-472 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:634` calls `setDoOutput` and `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:447` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:106— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:106-113 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:162-169 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:856-863 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:114` calls `debug`, `getHost`, `trim` and `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) REDACTED:656— REDACTED:656-660 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:537-541 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1046-1050 | src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:544-548 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:656` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1091— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1091-1095 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:472-477 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:587-591 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2347-2351 — 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.
Duplicated block (5 lines × 4) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:883— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:883-887 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1607-1612 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1833-1837 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2047-2051 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:883` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1606` calls `getInstance`, `handleListDevices` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:882` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252-256 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:269-273 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:937-941 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:950-954 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:252` 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:258` calls `isEmpty`, `getJsonString` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:275` 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.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×3
Modal dialog does not manage focus src/main/resources/web/chat/index.html:205— 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.
Modal dialog does not manage focus src/main/resources/web/chat/index.html:673— 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.
Modal dialog does not manage focus src/main/resources/web/chat/index.html:677— 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.
Low contrast colour pair in CSS (2.5:1) src/main/resources/web/tools/cert-gen.html:32— `.btn-success` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (2.5:1) src/main/resources/web/tools/cert-gen.html:50— `.toast-success` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (2.5:1) src/main/resources/web/tools/llama-build.html:192— `.btn-success` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) src/main/resources/web/tools/cert-gen.html:51— `.toast-error` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) src/main/resources/web/tools/llama-build.html:190— `.btn-danger` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.8:1) src/main/resources/web/tools/upload-test.html:211— `.btn-danger` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Hotspot: src/main/java/org/mark/llamacpp/server/LlamaServer.java src/main/java/org/mark/llamacpp/server/LlamaServer.java:513— src/main/java/org/mark/llamacpp/server/LlamaServer.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in LlamaServer.loadApplicationConfig at line 513. 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-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 20:51:06 +08:00' --until='2026-11-03 20:51:06 +08:00' --full-history --no-merges -- src/main/java/org/mark/llamacpp/server/LlamaServer.java`: 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: src/main/resources/web/js/settings.js src/main/resources/web/js/settings.js:340— src/main/resources/web/js/settings.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in settings.populate at line 340. 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-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 20:51:06 +08:00' --until='2026-11-03 20:51:06 +08:00' --full-history --no-merges -- src/main/resources/web/js/settings.js`: 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: src/main/java/org/mark/llamacpp/server/controller/SystemController.java src/main/java/org/mark/llamacpp/server/controller/SystemController.java:843— src/main/java/org/mark/llamacpp/server/controller/SystemController.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in SystemController.handleSysSettingRequest at line 843. 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-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 20:51:06 +08:00' --until='2026-11-03 20:51:06 +08:00' --full-history --no-merges -- src/main/java/org/mark/llamacpp/server/controller/SystemController.java`: 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 (25 corresponding lines) · ×3
Edited copy of a member (25 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:982— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:982-1011 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1301-1325 — 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) src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:54— src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:54-78 | src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:118-142 — 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) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:658— src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:658-682 | src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:690-718 — 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 copies of one member (3 members, 13+ corresponding lines) · ×3
Edited copies of one member (3 members, 13+ corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:627— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:627-642 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:740-752 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1270-1286 — 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.
Edited copies of one member (3 members, 13+ corresponding lines) src/main/java/org/mark/llamacpp/update/LetsUpdate.java:412— src/main/java/org/mark/llamacpp/update/LetsUpdate.java:412-425 | src/main/java/org/mark/llamacpp/update/LetsUpdate.java:430-442 | src/main/java/org/mark/llamacpp/update/LetsUpdate.java:447-463 — 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.
Edited copies of one member (3 members, 13+ corresponding lines) src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:16— src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:16-28 | src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:50-62 | src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:65-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:127— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:127-142 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:105-119 — 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) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:701— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:701-717 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:725-739 — 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) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:281— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:281-295 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:434-448 — 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 (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:732— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:732-741 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1476-1485 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:580— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:580-589 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1013-1022 — 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) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:880— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:880-889 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:1027-1036 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (19–20 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ParamController.java:63— src/main/java/org/mark/llamacpp/server/controller/ParamController.java:63-82 | src/main/java/org/mark/llamacpp/server/controller/ParamController.java:96-114 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ParamController.java:63` 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) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:366— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:366-385 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:474-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:716— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:716-734 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1621-1640 — both copies are in the same file, so extract the 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1643` calls `DefaultHttpContent` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:735` 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 × 3) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:414— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:414-425 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:636-647 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:584-595 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:414` 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 (12 lines × 3) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:450— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:450-461 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1012-1023 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1129-1140 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:450` 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 (12 lines × 3) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:173— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:173-184 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:250-261 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:579-590 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:173` 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 after the matched lines, `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:262` calls `getPath`, `trim` and `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:186` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465-474 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:507-516 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:659-669 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465` 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 (10–11 lines × 3) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:116— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:116-126 | src/main/java/org/mark/llamacpp/server/controller/BuildController.java:271-281 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:104-113 — 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 `src/main/java/org/mark/llamacpp/server/controller/BuildController.java:116` 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 (10–11 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:643— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:643-652 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1647-1657 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1770-1780 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:643` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:333— src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:333-340 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:466-473 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1028-1035 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1145-1152 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:737— src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:737-744 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:758-765 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:779-786 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:813-820 — 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 `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:737` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:396— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:396-403 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:501-508 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1063-1070 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1180-1187 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:396` 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:393` calls `getInstance`, `handleOpenAI` and `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:499` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:876— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:876-880 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:473-477 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1037-1041 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:876` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ToolController.java:169— src/main/java/org/mark/llamacpp/server/controller/ToolController.java:169-173 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:233-237 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:275-279 — 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 `src/main/java/org/mark/llamacpp/server/controller/ToolController.java:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:57— src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:57-61 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:244-248 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:267-271 — 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 `src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java: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.
Duplicated block (19 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:371— src/main/resources/web/js/newui/usage-report.js:371 · src/main/resources/web/js/newui/usage-report.js:445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2 locations) src/main/resources/web/js/usage-report.js:430— src/main/resources/web/js/usage-report.js:430 · src/main/resources/web/js/usage-report.js:540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2 locations) src/main/resources/web/js/usage-report.js:458— src/main/resources/web/js/usage-report.js:458 · src/main/resources/web/js/usage-report.js:575 — 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 (15 lines × 2 locations) src/main/resources/web/js/download.js:626— src/main/resources/web/js/download.js:626 · src/main/resources/web/js/download.js:642 — 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 (15 lines × 2 locations) src/main/resources/web/js/model-list.js:701— src/main/resources/web/js/model-list.js:701 · src/main/resources/web/js/model-list.js:725 — 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 (15 lines × 2 locations) src/main/resources/web/js/settings.js:1217— src/main/resources/web/js/settings.js:1217 · src/main/resources/web/js/settings.js:1457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×2
Focus outline removed in CSS without a :focus replacement src/main/resources/web/audio-transcription.html:267— `.audio-preview audio` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement src/main/resources/web/tools/mcp-manager.html:348— `.dlg-body input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Low contrast colour pair in CSS (2.3:1) src/main/resources/web/index.html:1162— `#benchParamsModal .param-field:has(.param-enable-toggle:not(:checked)) .form-control` sets color: #9ca3af on background-color: #f3f4f6 — 2.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (2.3:1) src/main/resources/web/tools/benchmark-v3.html:191— `#benchParamsModal .param-field:has(.param-enable-toggle:not(:checked)) .form-control` sets color: #9ca3af on background-color: #f3f4f6 — 2.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
LlamaServerManager.handleFitParam (cyclomatic 23) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3082— LlamaServerManager.handleFitParam 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.
LlamaServerManager.handleFitParam (cyclomatic 23) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3190— LlamaServerManager.handleFitParam 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.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:803— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:803-926 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1330-1364 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:594— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:594-609 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1101-1119 — 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:465— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:465-539 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:549-597 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:781-832 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1079-1115 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1123-1174 — 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) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:126— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:126-221 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:230-275 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:285-407 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:468-490 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:107-130 — 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 (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1358— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1358-1389 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1399-1433 — 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) src/main/java/org/mark/llamacpp/server/controller/ToolController.java:209— src/main/java/org/mark/llamacpp/server/controller/ToolController.java:209-240 | src/main/java/org/mark/llamacpp/server/controller/ToolController.java:242-282 — 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 (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:385— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:385-410 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:654-685 — 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) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:134— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:134-159 | src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:183-209 — 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 copies of one member (3 members, 18+ corresponding lines) · ×2
Edited copies of one member (3 members, 18+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:56— src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:56-76 | src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:84-101 | src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:103-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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, 18+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:268— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:268-287 | src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:292-309 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1447-1464 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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 (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:224— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:224-241 | src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:320-338 — 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) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3651— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3651-3675 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:681-698 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:480— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:480-503 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:807-822 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:611-634 — 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.
Edited copies of one member (3 members, 16+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:114— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:114-132 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:178-193 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1355-1370 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×2
Edited copies of one member (3 members, 15+ corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:403— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:403-427 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3625-3646 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:665-679 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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, 15+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/CertController.java:55— src/main/java/org/mark/llamacpp/server/controller/CertController.java:55-69 | src/main/java/org/mark/llamacpp/server/controller/HuggingFaceController.java:32-47 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:94-116 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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) · ×2
Edited copies of one member (3 members, 11+ corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:529— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:529-539 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:591-604 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1097-1108 — 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.
Edited copies of one member (3 members, 11+ corresponding lines) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:285— src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:285-295 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:300-312 | src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:93-103 — 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 (3 members, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1409— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1409-1426 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1727-1740 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:193-212 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:188— src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:188-201 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:203-217 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:219-232 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1154— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1154-1165 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1067-1077 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2237-2246 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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, 10+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/NodeController.java:75— src/main/java/org/mark/llamacpp/server/controller/NodeController.java:75-84 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:62-75 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:129-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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 (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:223— src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:223-229 | src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:375-382 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:550— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:550-556 | src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:57-63 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:457— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:457-462 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:371-376 — 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) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:505— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:505-512 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:824-829 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1032— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1032-1034 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:455-457 — 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) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1207— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1207-1210 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:622-624 — 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 (29 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:390— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:390-418 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:119-147 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:390` 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, `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:116` calls `getModelCapabilities`, `getValue`, `getCtxSize` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:389` 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 (29 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:960— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:960-988 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:388-416 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:698— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:698-721 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1105-1128 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:698` 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 (24 lines × 2) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:327— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:327-350 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:470-493 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:327` 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 (23 lines × 2) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:159— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:159-181 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:853-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) src/main/java/org/mark/llamacpp/server/ConfigManager.java:655— src/main/java/org/mark/llamacpp/server/ConfigManager.java:655-677 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:701-723 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/ConfigManager.java:655` 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 (20–21 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:354— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:354-373 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1504-1524 — 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 (20–21 lines × 2) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:643— src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:643-663 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:481-500 — 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 `src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:643` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:723— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:723-741 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1130-1148 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:723` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1036— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1036-1054 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1153-1171 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1036` 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 lines × 3) src/main/java/org/mark/llamacpp/server/ConfigManager.java:988— src/main/java/org/mark/llamacpp/server/ConfigManager.java:988-1005 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1098-1115 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1172-1189 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 3) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:409— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:409-426 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:480-497 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:988-1005 — 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 `src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:409` 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 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:679— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:679-696 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1086-1103 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1895— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1895-1912 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1922-1939 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1895` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:526— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:526-539 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:154-165 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:526` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 2) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:750— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:750-761 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2054-2067 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:750` 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) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:556— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:556-568 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1679-1692 — 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java: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.
Duplicated block (13–14 lines × 2) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:174— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:174-186 | src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:223-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 4) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:613— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:613-625 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:726-738 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:687-699 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1256-1268 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 4) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:240— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:240-252 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1949-1961 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1419-1431 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1862-1874 — 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 `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:240` 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 (12–13 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:406— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:406-418 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:521-532 — 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 `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:406` 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–13 lines × 2) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:615— src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:615-626 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:449-461 — 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 `src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:615` 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) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:675— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:675-685 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:722-732 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:798-808 — 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 `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:675` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 3) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:496— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:496-506 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1058-1068 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1175-1185 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 5) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465-474 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:507-516 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:659-668 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1700-1709 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1773-1782 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:465` 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 × 5) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:748— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:748-757 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:844-853 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:943-952 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1087-1096 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1140-1149 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:748` 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 (10 lines × 4) src/main/java/org/mark/llamacpp/server/ConfigManager.java:228— src/main/java/org/mark/llamacpp/server/ConfigManager.java:228-237 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:949-958 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1037-1046 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1147-1156 — 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 `src/main/java/org/mark/llamacpp/server/ConfigManager.java:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/ConfigManager.java:1036` calls `getAutoUnloadPolicy` and `src/main/java/org/mark/llamacpp/server/ConfigManager.java:227` 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 × 4) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:544— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:544-553 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:582-591 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:633-642 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1387-1396 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:544` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:530— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:530-536 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:588-594 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:823-829 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1106-1112 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1165-1171 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1104` calls `getChatTemplateCacheFilePathIfExists`, `deleteChatTemplateCacheFile` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:822` 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 × 5) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1081— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1081-1087 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:504-510 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:303-309 | src/main/java/org/mark/llamacpp/server/controller/BuildController.java:522-528 | src/main/java/org/mark/llamacpp/server/mcp/TimeServer.java:121-127 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 (6 lines × 4) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233-238 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:712-717 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1017-1022 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1110-1115 — 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 `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:113— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:113-118 | src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:164-169 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:541-546 | src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:66-71 — before extracting anything, compare `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java` and `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 68 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 `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:113` 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, `src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:547` calls `isThinkingToggleKey` and `src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:119` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 3) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1161— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1161-1165 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2177-2179 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2271-2275 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1161` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–5 lines × 3) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:222— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:222-226 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:926-928 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:996-1000 — 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 `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:926` 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.
Complex function (anonymous) (cyclomatic 24, cognitive 24) src/main/resources/web/js/model-list.js:748— (anonymous) has cyclomatic complexity 24 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 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 24, cognitive 24) src/main/resources/web/js/newui/settings-update.js:35— (anonymous) has cyclomatic complexity 24 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 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.
X13 · Undrained process stream· Redirected process stream is never drained (deadlock) · ×2
Redirected process stream is never drained (deadlock) src/main/java/org/mark/llamacpp/server/tools/JsoupCliHelper.java:110— The JDK merges `stderr` into `stdout` here (`redirectErrorStream(true)`), and that one stream is still a pipe — and `p.waitFor(…)` is written before stdout is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the bounded wait then times out on a command that was only waiting to be read, and the output is lost. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file).
Redirected process stream is never drained (deadlock) src/main/java/org/mark/llamacpp/server/service/ComputerService.java:113— The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and the parent waits on `process.waitFor()` while nothing in this scope ever reads stderr. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file).
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative src/main/resources/web/js/html2canvas.min.js:3133— 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.
Multiple navigation landmarks without distinguishing labels src/main/resources/web/index-new.html:2— With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled.
index.html.bindEvents (cyclomatic 171) src/main/resources/web/chat/index.html:10364— index.html.bindEvents has cyclomatic complexity 171 (threshold 15). Of this number, 18 points are the body's own statements and 153 belong to 48 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.
EasyChatService.handleStreamChat (cyclomatic 130) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:166— EasyChatService.handleStreamChat has cyclomatic complexity 130 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
model-detail.extractSamplingSettingsFromConfig (cyclomatic 126) src/main/resources/web/js/model-detail.js:405— model-detail.extractSamplingSettingsFromConfig has cyclomatic complexity 126 (threshold 15). Of this number, 93 points are the body's own statements and 33 belong to 4 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.
index.html.requestAssistantResponse (cyclomatic 112) src/main/resources/web/chat/index.html:7725— index.html.requestAssistantResponse has cyclomatic complexity 112 (threshold 15). Of this number, 110 points are the body's own statements and 2 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.
model-action-modal.applyCmdToDynamicFields (cyclomatic 87) src/main/resources/web/js/model-action-modal.js:309— model-action-modal.applyCmdToDynamicFields has cyclomatic complexity 87 (threshold 15). Of this number, 81 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.html.createMessageElement (cyclomatic 80) src/main/resources/web/chat/index.html:6057— index.html.createMessageElement has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
download.renderDownloadsList (cyclomatic 77) src/main/resources/web/js/download.js:214— download.renderDownloadsList has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 4 of the 77 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 256, getDownloadCreatedAtMs, a function literal at line 249). 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.
AnthropicService.convertAnthropicToOai (cyclomatic 76) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:749— AnthropicService.convertAnthropicToOai has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
submitModelAction (cyclomatic 76) src/main/resources/web/js/model-action-modal.js:1617— submitModelAction has cyclomatic complexity 76 (threshold 15). Of this number, 47 points are the body's own statements and 29 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.
settings.checkUpdate (cyclomatic 73) src/main/resources/web/js/settings.js:1096— settings.checkUpdate has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
model-list.renderModelsList (cyclomatic 70) src/main/resources/web/js/model-list.js:293— model-list.renderModelsList has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 13 of the 70 points are its own statements and the rest belongs to one function literal inside it that branches (line 332). 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.
model-action-modal.buildLoadModelPayload (cyclomatic 69) src/main/resources/web/js/model-action-modal.js:1497— model-action-modal.buildLoadModelPayload has cyclomatic complexity 69 (threshold 15). Of this number, 62 points are the body's own statements and 7 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.
index.html.buildPayload (cyclomatic 66) src/main/resources/web/chat/index.html:9031— index.html.buildPayload has cyclomatic complexity 66 (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.
model-benchmark.renderBenchmarkFieldFromParam (cyclomatic 66) src/main/resources/web/js/model-benchmark.js:165— model-benchmark.renderBenchmarkFieldFromParam has cyclomatic complexity 66 (threshold 15). Of this number, 61 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EasyChatService.handleStreamChatHistory (cyclomatic 64) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:729— EasyChatService.handleStreamChatHistory has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
download.updateDownloadProgress (cyclomatic 63) src/main/resources/web/js/download.js:404— download.updateDownloadProgress has cyclomatic complexity 63 (threshold 15). Of this number, 62 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.
index.html.renderSystemInfo (cyclomatic 61) src/main/resources/web/index.html:6521— index.html.renderSystemInfo has cyclomatic complexity 61 (threshold 15). Of this number, 32 points are the body's own statements and 29 belong to 3 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.
ModelSamplingService.applySamplingFromCmd (cyclomatic 60) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:409— ModelSamplingService.applySamplingFromCmd has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.html.regenerateMessage (cyclomatic 60) src/main/resources/web/chat/index.html:8010— index.html.regenerateMessage has cyclomatic complexity 60 (threshold 15). Of this number, 59 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.
model-action-modal.loadModel (cyclomatic 60) src/main/resources/web/js/model-action-modal.js:1398— model-action-modal.loadModel has cyclomatic complexity 60 (threshold 15). Of this number, 25 points are the body's own statements and 35 belong to 6 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.
usage-report.renderTokenSummary (cyclomatic 60) src/main/resources/web/js/usage-report.js:322— usage-report.renderTokenSummary has cyclomatic complexity 60 (threshold 15). Of this number, 22 points are the body's own statements and 38 belong to 11 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.
create.bindEvents (cyclomatic 60) src/main/resources/web/chat/chat-mcp.js:889— create.bindEvents has cyclomatic complexity 60 (threshold 15). Of this number, 19 points are the body's own statements and 41 belong to 25 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.
index.html.updateAssistantMessageElement (cyclomatic 57) src/main/resources/web/chat/index.html:6678— index.html.updateAssistantMessageElement has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
render (cyclomatic 55) src/main/resources/web/js/newui/misc-pages.js:132— render has cyclomatic complexity 55 (threshold 15). Of this number, 30 points are the body's own statements and 25 belong to 4 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.
chat-mcp.create.bindEvents (cyclomatic 54) src/main/resources/web/chat/chat-mcp.js:889— chat-mcp.create.bindEvents has cyclomatic complexity 54 (threshold 15). Of this number, 19 points are the body's own statements and 35 belong to 13 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.
SystemController.handleFsListRequest (cyclomatic 50) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:285— SystemController.handleFsListRequest has cyclomatic complexity 50 (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.
benchmark-v3.createResultRow (cyclomatic 50) src/main/resources/web/js/benchmark-v3.js:1226— benchmark-v3.createResultRow 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.
index.html.directoryBrowserRender (cyclomatic 49) src/main/resources/web/index.html:5103— index.html.directoryBrowserRender has cyclomatic complexity 49 (threshold 15). Of this number, 19 points are the body's own statements and 30 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.
showModelDetailModal (cyclomatic 49) src/main/resources/web/js/model-detail.js:29— showModelDetailModal has cyclomatic complexity 49 (threshold 15). Of this number, 27 points are the body's own statements and 22 belong to 28 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.
index.html.addDraftFiles (cyclomatic 48) src/main/resources/web/chat/index.html:2820— index.html.addDraftFiles has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.html.addFilesToEditingMessage (cyclomatic 47) src/main/resources/web/chat/index.html:7424— index.html.addFilesToEditingMessage has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.html.renderParamField (cyclomatic 47) src/main/resources/web/index.html:5753— index.html.renderParamField has cyclomatic complexity 47 (threshold 15). Of this number, 46 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.
LlamaServerManager.listModel (cyclomatic 45) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:327— LlamaServerManager.listModel 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.
hf.createHfDownloadTasks (cyclomatic 44) src/main/resources/web/js/hf.js:402— hf.createHfDownloadTasks has cyclomatic complexity 44 (threshold 15). Of this number, 40 points are the body's own statements and 4 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.
ModelActionController.handleModelBenchmark (cyclomatic 43) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1128— ModelActionController.handleModelBenchmark has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
loadDeviceList (cyclomatic 43) src/main/resources/web/js/model-action-modal.js:2193— loadDeviceList has cyclomatic complexity 43 (threshold 15). Of this number, 19 points are the body's own statements and 24 belong to 5 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.
index.html.convertHistoryMessage (cyclomatic 42) src/main/resources/web/chat/index.html:8939— index.html.convertHistoryMessage has cyclomatic complexity 42 (threshold 15). Of this number, 36 points are the body's own statements and 6 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.
GGUFMetaData.readFile (cyclomatic 41) src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:76— GGUFMetaData.readFile 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.
OpenAIService.handleOpenAIModelsRequest (cyclomatic 40) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:99— OpenAIService.handleOpenAIModelsRequest has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelPathController.handleModelPathUpdate (cyclomatic 39) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:285— ModelPathController.handleModelPathUpdate 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.
LlamaServerManager.loadModelInBackgroundFromCmd (cyclomatic 39) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2138— LlamaServerManager.loadModelInBackgroundFromCmd 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.
settings.generateHttpsCert (cyclomatic 39) src/main/resources/web/js/settings.js:672— settings.generateHttpsCert has cyclomatic complexity 39 (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.
LlamacppController.handleLlamaCppReleaseLatest (cyclomatic 38) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:665— LlamacppController.handleLlamaCppReleaseLatest 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.
index.html.normalizeAssistant (cyclomatic 38) src/main/resources/web/chat/index.html:2102— index.html.normalizeAssistant 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.
settings.restoreUpdateStatus (cyclomatic 38) src/main/resources/web/js/settings.js:1421— settings.restoreUpdateStatus 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.
benchmark-v2.html.runBenchmark (cyclomatic 38) src/main/resources/web/tools/benchmark-v2.html:962— benchmark-v2.html.runBenchmark 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.
index.html.loadModelFromMenu (cyclomatic 37) src/main/resources/web/chat/index.html:4997— index.html.loadModelFromMenu has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
onMsg (cyclomatic 37) src/main/resources/web/js/newui/app.js:166— onMsg has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EasyChatService.accumulateDelta (cyclomatic 36) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1717— EasyChatService.accumulateDelta 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.
OpenAIService.handleOpenAIResponsesRequest (cyclomatic 36) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1086— OpenAIService.handleOpenAIResponsesRequest 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.
websocket.populateLogFilter (cyclomatic 36) src/main/resources/web/js/websocket.js:248— websocket.populateLogFilter has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 259, a function literal at line 263, fetchLogModels, …). 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.
ensureAutoUnloadWired (cyclomatic 36) src/main/resources/web/js/model-action-modal.js:1116— ensureAutoUnloadWired has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1125, 1172, 1155, …). 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.
quickStartModel (cyclomatic 36) src/main/resources/web/js/model-list.js:740— quickStartModel has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 748, 784, 772, …). 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.
index.html.fetchSysInfo (cyclomatic 35) src/main/resources/web/index.html:6455— index.html.fetchSysInfo has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 7 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6468, 6512). 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.
loadOverview (cyclomatic 35) src/main/resources/web/js/newui/model-detail.js:42— loadOverview has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 13 of the 35 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 57, 56, 82, …). 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.
FileUploadRouterHandler.channelRead (cyclomatic 34) src/main/java/org/mark/llamacpp/server/channel/FileUploadRouterHandler.java:50— FileUploadRouterHandler.channelRead 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.
SystemController.handleVramEstimateRequest (cyclomatic 34) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1641— SystemController.handleVramEstimateRequest has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OpenAIService.handleOpenAIRerankRequest (cyclomatic 34) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:975— OpenAIService.handleOpenAIRerankRequest 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.
LlamaServerManager.buildCommandStrFromForm (cyclomatic 34) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2445— LlamaServerManager.buildCommandStrFromForm 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.
submitModelBenchmark (cyclomatic 34) src/main/resources/web/js/model-benchmark.js:447— submitModelBenchmark has cyclomatic complexity 34 (threshold 15). Of this number, 27 points are the body's own statements and 7 belong to 4 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.
createCloneModel (cyclomatic 34) src/main/resources/web/js/model-list.js:658— createCloneModel has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 670, 703, 711, …). 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.
PerplexityService.run (cyclomatic 33) src/main/java/org/mark/llamacpp/server/service/PerplexityService.java:86— PerplexityService.run has cyclomatic complexity 33 (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.
MtpHelper.mergeDonor (cyclomatic 32) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:283— MtpHelper.mergeDonor 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.
LlamacppController.handleInfillRequest (cyclomatic 32) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:925— LlamacppController.handleInfillRequest 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.
AnthropicService.handleStreamResponse (cyclomatic 32) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:467— AnthropicService.handleStreamResponse 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.
ParamTool.handleThinking (cyclomatic 32) src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:357— ParamTool.handleThinking 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.
LlamaServer.loadApplicationConfig (cyclomatic 32) src/main/java/org/mark/llamacpp/server/LlamaServer.java:513— LlamaServer.loadApplicationConfig 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.
LlamaServer.main (cyclomatic 32) src/main/java/org/mark/llamacpp/server/LlamaServer.java:78— LlamaServer.main 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.
index.html.refreshModels (cyclomatic 32) src/main/resources/web/chat/index.html:9559— index.html.refreshModels has cyclomatic complexity 32 (threshold 15). Of this number, 29 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.
index.html.directoryBrowserLoad (cyclomatic 32) src/main/resources/web/index.html:5231— index.html.directoryBrowserLoad 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.
benchmark-v2.html.normalizeRecordRow (cyclomatic 32) src/main/resources/web/tools/benchmark-v2.html:758— benchmark-v2.html.normalizeRecordRow 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.
benchmark-v2.html.loadBenchmarkRecords (cyclomatic 32) src/main/resources/web/tools/benchmark-v2.html:886— benchmark-v2.html.loadBenchmarkRecords has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to 2 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.
mtp-bench.html.runBenchmark (cyclomatic 32) src/main/resources/web/tools/mtp-bench.html:604— mtp-bench.html.runBenchmark has cyclomatic complexity 32 (threshold 15). Of this number, 31 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.
toggleFavouriteModel (cyclomatic 32) src/main/resources/web/js/model-list.js:493— toggleFavouriteModel has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 514, 498, 519, …). 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.
ModelActionController.buildLocalModelList (cyclomatic 31) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:320— ModelActionController.buildLocalModelList 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.
BenchmarkService.handleBenchmark (cyclomatic 31) src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:82— BenchmarkService.handleBenchmark has cyclomatic complexity 31 (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.
StreamingForwarder.handleBooleanValue (cyclomatic 31) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:427— StreamingForwarder.handleBooleanValue has cyclomatic complexity 31 (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.
index.html.directoryBrowserNormalizeItems (cyclomatic 31) src/main/resources/web/index.html:5063— index.html.directoryBrowserNormalizeItems 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 3 function literals inside it that branch (lines 5065, 5080, 5090). 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.
benchmark-v3.runServer (cyclomatic 31) src/main/resources/web/js/benchmark-v3.js:1017— benchmark-v3.runServer has cyclomatic complexity 31 (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.
usage-report.renderDailyChart (cyclomatic 31) src/main/resources/web/js/usage-report.js:496— usage-report.renderDailyChart has cyclomatic complexity 31 (threshold 15). Of this number, 16 points are the body's own statements and 15 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.
openModelBenchmarkDialog (cyclomatic 31) src/main/resources/web/js/model-benchmark.js:1— openModelBenchmarkDialog has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 90, a function literal at line 79, a function literal at line 82, …). 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.
calculateModelTokens (cyclomatic 31) src/main/resources/web/js/model-detail.js:1195— calculateModelTokens has cyclomatic complexity 31 (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.
card (cyclomatic 31) src/main/resources/web/js/newui/models.js:146— card has cyclomatic complexity 31 (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.
FileDownloadRouterHandler.handleModelDownload (cyclomatic 30) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:175— FileDownloadRouterHandler.handleModelDownload has cyclomatic complexity 30 (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.
AnthropicService.handleModelsRequest (cyclomatic 30) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:85— AnthropicService.handleModelsRequest 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.
OpenAIService.forwardStreamToRemote (cyclomatic 30) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:630— OpenAIService.forwardStreamToRemote 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.
OpenAIService.handleOpenAIEmbeddingsRequest (cyclomatic 30) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:421— OpenAIService.handleOpenAIEmbeddingsRequest 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.
OpenAIService.handleStreamResponse (cyclomatic 30) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1569— OpenAIService.handleStreamResponse 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.
CommandLineRunner.applyExecutableDirEnv (cyclomatic 30) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:310— CommandLineRunner.applyExecutableDirEnv has cyclomatic complexity 30 (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.
index.html.continueMessage (cyclomatic 30) src/main/resources/web/chat/index.html:8266— index.html.continueMessage has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
websocket.handleWebSocketMessage (cyclomatic 30) src/main/resources/web/js/websocket.js:86— websocket.handleWebSocketMessage 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.
openModelBenchmarkList (cyclomatic 30) src/main/resources/web/js/model-benchmark.js:513— openModelBenchmarkList has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 586, 575, 574, …). 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.
runServer (cyclomatic 30) REDACTED:136— runServer has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 7 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.
applyCmdToForm (cyclomatic 30) REDACTED:519— applyCmdToForm has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 8 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.
SystemController.handleRequest (cyclomatic 29) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:116— SystemController.handleRequest 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.
StreamingForwarder.extractFields (cyclomatic 29) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:246— StreamingForwarder.extractFields has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
benchmark-v3.runBench (cyclomatic 29) src/main/resources/web/js/benchmark-v3.js:772— benchmark-v3.runBench has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 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.
model-benchmark.resetModelBenchmarkForm (cyclomatic 29) src/main/resources/web/js/model-benchmark.js:284— model-benchmark.resetModelBenchmarkForm has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.populate (cyclomatic 29) src/main/resources/web/js/settings.js:340— settings.populate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.handleAppUpdateEvent (cyclomatic 29) src/main/resources/web/js/settings.js:1350— settings.handleAppUpdateEvent has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
render (cyclomatic 29) src/main/resources/web/js/newui/models.js:93— render has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 96, 104, 118, …). 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.
BasicRouterHandler.handleRequest (cyclomatic 28) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:140— BasicRouterHandler.handleRequest 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.
LlamacppController.handleLlamaCppRemove (cyclomatic 28) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:244— LlamacppController.handleLlamaCppRemove 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.
ModelInfoController.handleModelConfigSetRequest (cyclomatic 28) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:638— ModelInfoController.handleModelConfigSetRequest 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.
ChatRequestStreamingTransformer.transform (cyclomatic 28) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:49— ChatRequestStreamingTransformer.transform 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.
LlamaServerManager.buildAutoLoadModelCache (cyclomatic 28) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1136— LlamaServerManager.buildAutoLoadModelCache 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.
LlamaServerManager.handleDirectory (cyclomatic 28) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1703— LlamaServerManager.handleDirectory 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.
chat-mcp.extractToolResultText (cyclomatic 28) src/main/resources/web/chat/chat-mcp.js:217— chat-mcp.extractToolResultText has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 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.
index.html.openVideoLightbox (cyclomatic 28) src/main/resources/web/chat/index.html:2356— index.html.openVideoLightbox has cyclomatic complexity 28 (threshold 15). Of this number, 24 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.
benchmark-v3.renderParamField (cyclomatic 28) src/main/resources/web/js/benchmark-v3.js:465— benchmark-v3.renderParamField has cyclomatic complexity 28 (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.
settings.downloadUpdate (cyclomatic 28) src/main/resources/web/js/settings.js:1252— settings.downloadUpdate 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.
download (cyclomatic 28) src/main/resources/web/js/newui/hf.js:277— download has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 4 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.
init (cyclomatic 28) src/main/resources/web/js/newui/settings.js:7— init has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 19 function literals inside it that branch (lines 20, 36, 9, …). 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.
ModelActionController.handleCloneCreateRequest (cyclomatic 27) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:802— ModelActionController.handleCloneCreateRequest 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.
SystemController.handleFitParamsRequest (cyclomatic 27) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1764— SystemController.handleFitParamsRequest 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.
SystemController.handleSysSettingRequest (cyclomatic 27) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:843— SystemController.handleSysSettingRequest 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.
LlamaCppProcess.start (cyclomatic 27) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:130— LlamaCppProcess.start 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.
LlamaServerManager.autoLoadModelFromConfig (cyclomatic 27) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3483— LlamaServerManager.autoLoadModelFromConfig 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.
benchmark-v3.appendResultRow (cyclomatic 27) src/main/resources/web/js/benchmark-v3.js:1275— benchmark-v3.appendResultRow has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 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.
model-action-modal.setModelActionMode (cyclomatic 27) src/main/resources/web/js/model-action-modal.js:1354— model-action-modal.setModelActionMode 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.
mtp-bench.html.runDiff (cyclomatic 27) src/main/resources/web/tools/mtp-bench.html:811— mtp-bench.html.runDiff 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.
estimateVramAction (cyclomatic 27) src/main/resources/web/js/model-action-modal.js:1867— estimateVramAction has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 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.
loadModels (cyclomatic 27) src/main/resources/web/js/model-list.js:69— loadModels has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 87, 111, 116, …). 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.
renderModelList (cyclomatic 27) REDACTED:87— renderModelList has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 99, 89, 96, …). 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.
recordRowHtml (cyclomatic 27) REDACTED:277— recordRowHtml has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
load (cyclomatic 27) src/main/resources/web/js/newui/models.js:28— load 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 8 function literals inside it that branch (lines 37, 49, 45, …). 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.
CertController.handleGenerate (cyclomatic 26) src/main/java/org/mark/llamacpp/server/controller/CertController.java:165— CertController.handleGenerate 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.
ModelPathController.handleModelPathAdd (cyclomatic 26) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:126— ModelPathController.handleModelPathAdd 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.
OpenAIService.handleOpenAICompletionsRequest (cyclomatic 26) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:312— OpenAIService.handleOpenAICompletionsRequest 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.
index.html.normalizeAssistantResponse (cyclomatic 26) src/main/resources/web/chat/index.html:3677— index.html.normalizeAssistantResponse 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.
index.html.sendMessage (cyclomatic 26) src/main/resources/web/chat/index.html:9652— index.html.sendMessage has cyclomatic complexity 26 (threshold 15). Of this number, 25 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.
settings.init (cyclomatic 26) src/main/resources/web/js/settings.js:2032— settings.init has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 4 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.
loadAutoUnloadPolicy (cyclomatic 26) src/main/resources/web/js/model-action-modal.js:1197— loadAutoUnloadPolicy has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1204, 1227, 1203). 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.
fitParamsAction (cyclomatic 26) src/main/resources/web/js/model-action-modal.js:1919— fitParamsAction has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 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.
ModelInfoController.handleOpenAIModelsRequest (cyclomatic 25) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374— ModelInfoController.handleOpenAIModelsRequest 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.
ModelInfoController.handleRequest (cyclomatic 25) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:103— ModelInfoController.handleRequest 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.
PerplexityController.handleListRecords (cyclomatic 25) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:205— PerplexityController.handleListRecords 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.
index.html.getAssistantModelName (cyclomatic 25) src/main/resources/web/chat/index.html:3419— index.html.getAssistantModelName 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.
index.html.formatAssistantPerformanceDetailText (cyclomatic 25) src/main/resources/web/chat/index.html:3610— index.html.formatAssistantPerformanceDetailText 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.
index.html.consumeSse::processSseLine (cyclomatic 25) src/main/resources/web/chat/index.html:9465— index.html.consumeSse::processSseLine 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.
index.html.generateAutoReply (cyclomatic 25) src/main/resources/web/chat/index.html:9780— index.html.generateAutoReply has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 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.
check (cyclomatic 25) src/main/resources/web/js/newui/settings-update.js:31— check has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 35, 67). 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.
renderTokenSummary (cyclomatic 25) src/main/resources/web/js/newui/usage-report.js:190— renderTokenSummary has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 214, 196, 248, …). 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.
EasyChatRequestWriter.writeRequestBody (cyclomatic 24) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:30— EasyChatRequestWriter.writeRequestBody 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.
LlamaServerManager.buildCommandStrFromCmd (cyclomatic 24) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2566— LlamaServerManager.buildCommandStrFromCmd 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.
LlamaServerManager.handleModelInfo (cyclomatic 24) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2837— LlamaServerManager.handleModelInfo 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.
NodeManager.callRemoteApiStreaming (cyclomatic 24) REDACTED:409— NodeManager.callRemoteApiStreaming 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.
index.html.buildSamplingParamsJson (cyclomatic 24) src/main/resources/web/chat/index.html:8594— index.html.buildSamplingParamsJson 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.
model-detail.normalizeModelSamplingStringArray (cyclomatic 24) src/main/resources/web/js/model-detail.js:342— model-detail.normalizeModelSamplingStringArray has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 2 function items inside it that branch (splitText, pushValue). 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.
settings.loadLlamaCppReleases (cyclomatic 24) src/main/resources/web/js/settings.js:105— settings.loadLlamaCppReleases 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.
mtp-bench.html.renderModelList (cyclomatic 24) src/main/resources/web/tools/mtp-bench.html:400— mtp-bench.html.renderModelList has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
groupGgufFiles (cyclomatic 24) src/main/resources/web/js/hf.js:238— groupGgufFiles has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 285, 273, 305, …). 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.
addModelSamplingConfig (cyclomatic 24) src/main/resources/web/js/model-detail.js:925— addModelSamplingConfig has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to 3 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.
FileDownloadRouterHandler.inferContentType (cyclomatic 23) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:942— FileDownloadRouterHandler.inferContentType 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.
LlamaRouterHandler.handleApiRequest (cyclomatic 23) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:100— LlamaRouterHandler.handleApiRequest 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.
AutoLoadPolicyController.handleSetPolicy (cyclomatic 23) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:93— AutoLoadPolicyController.handleSetPolicy 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.
ModelActionController.loadLocalModel (cyclomatic 23) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1027— ModelActionController.loadLocalModel 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.
chat-mcp.create.restoreScrollPositions (cyclomatic 23) src/main/resources/web/chat/chat-mcp.js:433— chat-mcp.create.restoreScrollPositions has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 4 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.
chat-mcp.create.render (cyclomatic 23) src/main/resources/web/chat/chat-mcp.js:478— chat-mcp.create.render has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 492, 500, 483). 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.
index.html.renderRichText (cyclomatic 23) src/main/resources/web/chat/index.html:1755— index.html.renderRichText has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 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.
index.html.normalizeConversationMessage (cyclomatic 23) src/main/resources/web/chat/index.html:3718— index.html.normalizeConversationMessage has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.
benchmark-v3.loadServerRecords (cyclomatic 23) src/main/resources/web/js/benchmark-v3.js:1132— benchmark-v3.loadServerRecords has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
create.restoreScrollPositions (cyclomatic 23) src/main/resources/web/chat/chat-mcp.js:433— create.restoreScrollPositions has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 4 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.
create.renderServerList (cyclomatic 23) src/main/resources/web/chat/chat-mcp.js:478— create.renderServerList has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 492, 500, 483, …). 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.
renderSources (cyclomatic 23) src/main/resources/web/js/newui/logs.js:83— renderSources 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 7 function literals inside it that branch (lines 108, 88, 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.
PerplexityController.fetchRemoteRecords (cyclomatic 22) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:287— PerplexityController.fetchRemoteRecords 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.
McpClientService.upsertServer (cyclomatic 22) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:649— McpClientService.upsertServer 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.
EasyChatService.accumulateNonStreamResponse (cyclomatic 22) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2184— EasyChatService.accumulateNonStreamResponse 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.
CommandLineRunner.splitCommandLineArgs (cyclomatic 22) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1075— CommandLineRunner.splitCommandLineArgs 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.
LlamaCppProcess.splitCommandLineArgs (cyclomatic 22) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:667— LlamaCppProcess.splitCommandLineArgs 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.
TavilyExtractTool.parseExtractResponse (cyclomatic 22) src/main/java/org/mark/test/mcp/tavily/tools/TavilyExtractTool.java:109— TavilyExtractTool.parseExtractResponse 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.
TavilySearchTool.parseSearchResponse (cyclomatic 22) src/main/java/org/mark/test/mcp/tavily/tools/TavilySearchTool.java:103— TavilySearchTool.parseSearchResponse 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.
index.html.uploadAssistantAvatar (cyclomatic 22) src/main/resources/web/chat/index.html:4115— index.html.uploadAssistantAvatar 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.
benchmark-v3.doExport (cyclomatic 22) src/main/resources/web/js/benchmark-v3.js:1371— benchmark-v3.doExport has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1372, 1388, 1387). 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.
model-action-modal.enforceModelCapabilitiesRules (cyclomatic 22) src/main/resources/web/js/model-action-modal.js:931— model-action-modal.enforceModelCapabilitiesRules has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
toggleShareConfig (cyclomatic 22) src/main/resources/web/js/model-action-modal.js:800— toggleShareConfig has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 8 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.
loadModelSamplingSettings (cyclomatic 22) src/main/resources/web/js/model-detail.js:861— loadModelSamplingSettings has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 873, 870, 871, …). 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.
hfGroupGgufFiles (cyclomatic 22) src/main/resources/web/js/newui/hf.js:357— hfGroupGgufFiles has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 382, 360, 376, …). 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.
renderDailyChart (cyclomatic 22) src/main/resources/web/js/newui/usage-report.js:391— renderDailyChart has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (onmousemove, labelFn, a function literal at line 419, …). 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.
ModelActionController.handleLoadModelRequest (cyclomatic 21) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:935— ModelActionController.handleLoadModelRequest 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.
EasyChatService.handleGenerateTitle (cyclomatic 21) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1172— EasyChatService.handleGenerateTitle 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.
OpenAIService.handleOpenAIAudioTranscriptionsRequest (cyclomatic 21) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1268— OpenAIService.handleOpenAIAudioTranscriptionsRequest 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.
LlamaServerManager.canFitModelInMemory (cyclomatic 21) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3362— LlamaServerManager.canFitModelInMemory 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.
DefaultMcpServiceImpl.doProcessRequest (cyclomatic 21) src/main/java/org/mark/test/mcp/DefaultMcpServiceImpl.java:177— DefaultMcpServiceImpl.doProcessRequest 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.
index.html.replaceMathInPlainText (cyclomatic 21) src/main/resources/web/chat/index.html:1128— index.html.replaceMathInPlainText 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.
index.html.renderGpuSection (cyclomatic 21) src/main/resources/web/chat/index.html:5327— index.html.renderGpuSection 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.
index.html.renderHwStat (cyclomatic 21) src/main/resources/web/chat/index.html:5445— index.html.renderHwStat has cyclomatic complexity 21 (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.
index.html.requestEphemeralStreamChat (cyclomatic 21) src/main/resources/web/chat/index.html:9239— index.html.requestEphemeralStreamChat 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.
index.html.consumeEphemeralSse::processSseLine (cyclomatic 21) src/main/resources/web/chat/index.html:9315— index.html.consumeEphemeralSse::processSseLine 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.
hf.fetchDetailReadme (cyclomatic 21) src/main/resources/web/js/hf.js:737— hf.fetchDetailReadme 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.
model-detail.bindModelSamplingSamplersField (cyclomatic 21) src/main/resources/web/js/model-detail.js:666— model-detail.bindModelSamplingSamplersField has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 669). 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.
settings.fillLlamaCppTestModal (cyclomatic 21) src/main/resources/web/js/settings.js:1973— settings.fillLlamaCppTestModal has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mtp-bench.html.updateRow (cyclomatic 21) src/main/resources/web/tools/mtp-bench.html:494— mtp-bench.html.updateRow 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.
perplexity.html.runTest (cyclomatic 21) src/main/resources/web/tools/perplexity.html:839— perplexity.html.runTest 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.
runBench (cyclomatic 21) REDACTED:444— runBench 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.
HuggingFaceSearcher.resolveBaseUrl (cyclomatic 20) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:574— HuggingFaceSearcher.resolveBaseUrl 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.
EasyChatController.handleAvatarUpload (cyclomatic 20) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:309— EasyChatController.handleAvatarUpload 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.
ModelInfoController.handleSetModelAliasRequest (cyclomatic 20) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:465— ModelInfoController.handleSetModelAliasRequest 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.
ModelPathController.syncModelPathsToRuntime (cyclomatic 20) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:499— ModelPathController.syncModelPathsToRuntime 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.
LlamaServer.createWindowsSystemTray (cyclomatic 20) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1845— LlamaServer.createWindowsSystemTray 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.
index.html.buildStreamChatHeaders (cyclomatic 20) src/main/resources/web/chat/index.html:8653— index.html.buildStreamChatHeaders 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.
index.html.buildStreamUserMessage (cyclomatic 20) src/main/resources/web/chat/index.html:8852— index.html.buildStreamUserMessage 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.
model-benchmark.renderBenchmarkParamsContainer (cyclomatic 20) src/main/resources/web/js/model-benchmark.js:242— model-benchmark.renderBenchmarkParamsContainer has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 2 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.
model-benchmark.appendBenchmarkResultBlock (cyclomatic 20) src/main/resources/web/js/model-benchmark.js:647— model-benchmark.appendBenchmarkResultBlock 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.
settings.renderLlamaCppRelease (cyclomatic 20) src/main/resources/web/js/settings.js:156— settings.renderLlamaCppRelease 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.
websocket.applyModelPatch (cyclomatic 20) src/main/resources/web/js/websocket.js:134— websocket.applyModelPatch has cyclomatic complexity 20 (threshold 15). Of this number, 17 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.
llama-build.html.restoreActiveTask (cyclomatic 20) src/main/resources/web/tools/llama-build.html:1306— llama-build.html.restoreActiveTask has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs 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.
submitCreateDownload (cyclomatic 20) src/main/resources/web/js/download.js:588— submitCreateDownload has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 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.
bindModelSamplingSamplersField::onclick (cyclomatic 20) src/main/resources/web/js/model-detail.js:669— bindModelSamplingSamplersField::onclick 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.
exportRecords (cyclomatic 20) REDACTED:388— exportRecords has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 391, 405, 408, …). 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.
DownloadTaskManager.extractTar (cyclomatic 19) src/main/java/org/mark/file/downloader/DownloadTaskManager.java:529— DownloadTaskManager.extractTar 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.
MtpHelper.extractDonor (cyclomatic 19) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:157— MtpHelper.extractDonor has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MtpHelper.writeValue (cyclomatic 19) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:673— MtpHelper.writeValue has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
LlamacppController.handleLlamaCppList (cyclomatic 19) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:443— LlamacppController.handleLlamaCppList 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.
BenchmarkService.generatePromptForTargetTokens (cyclomatic 19) src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:308— BenchmarkService.generatePromptForTargetTokens 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.
BuildTaskManager.executePhase (cyclomatic 19) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:228— BuildTaskManager.executePhase 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.
RemoteWebSocketClient.connect (cyclomatic 19) REDACTED:124— RemoteWebSocketClient.connect 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.
ConfigManager.mergeSharedIntoBundle (cyclomatic 19) src/main/java/org/mark/llamacpp/server/ConfigManager.java:534— ConfigManager.mergeSharedIntoBundle 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.
LlamaServerManager.extractSpecFromLaunchConfig (cyclomatic 19) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1441— LlamaServerManager.extractSpecFromLaunchConfig 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.
LlamaServerManager.loadModelAsyncFromCmd (cyclomatic 19) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2049— LlamaServerManager.loadModelAsyncFromCmd 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.
LlamaServerManager.resolveModelType (cyclomatic 19) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:526— LlamaServerManager.resolveModelType 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.
index.html.updateAssistantMessage (cyclomatic 19) src/main/resources/web/chat/index.html:6902— index.html.updateAssistantMessage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
benchmark-v3.buildBenchCmd (cyclomatic 19) src/main/resources/web/js/benchmark-v3.js:648— benchmark-v3.buildBenchCmd 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.
download.handleWebSocketMessage (cyclomatic 19) src/main/resources/web/js/download.js:139— download.handleWebSocketMessage 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.
model-action-modal.buildPersistableLaunchConfig (cyclomatic 19) src/main/resources/web/js/model-action-modal.js:608— model-action-modal.buildPersistableLaunchConfig 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.
saveModelConfigAction (cyclomatic 19) src/main/resources/web/js/model-action-modal.js:1804— saveModelConfigAction has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1828, 1844, 1828). 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.
buildCmd (cyclomatic 19) REDACTED:467— buildCmd has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 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.
renderTokenChart (cyclomatic 19) src/main/resources/web/js/newui/usage-report.js:320— renderTokenChart has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (onmousemove, a function literal at line 338, a function literal at line 347, …). 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.
NettyHttpDownloader.download (cyclomatic 18) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:137— NettyHttpDownloader.download 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.
SimpleHttpDownloader.download (cyclomatic 18) src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:75— SimpleHttpDownloader.download 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.
HuggingFaceSearcher.normalizeRepoId (cyclomatic 18) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:611— HuggingFaceSearcher.normalizeRepoId 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.
HuggingFaceSearcher.parseCursorFromLinkHeader (cyclomatic 18) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:535— HuggingFaceSearcher.parseCursorFromLinkHeader 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.
LlamaRouterHandler.forwardControlToRemote (cyclomatic 18) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:461— LlamaRouterHandler.forwardControlToRemote 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.
EasyChatController.handleBackgroundUpload (cyclomatic 18) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:459— EasyChatController.handleBackgroundUpload 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.
SystemController.firstBoolean (cyclomatic 18) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1206— SystemController.firstBoolean 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.
EasyChatService.proxySseStreamFromRemote (cyclomatic 18) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2359— EasyChatService.proxySseStreamFromRemote 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.
EasyChatService.seedAccumulatorFromFragment (cyclomatic 18) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1833— EasyChatService.seedAccumulatorFromFragment 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.
EasyChatStorage.readModelIndex (cyclomatic 18) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:377— EasyChatStorage.readModelIndex 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.
StreamingForwarder.handleNumberValue (cyclomatic 18) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:528— StreamingForwarder.handleNumberValue 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.
ToolExecutionService.formatMcpToolResult (cyclomatic 18) src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:42— ToolExecutionService.formatMcpToolResult 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.
JsonUtil.ensureToolCallIds (cyclomatic 18) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:314— JsonUtil.ensureToolCallIds 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.
JsoupCliHelper.fetchPage (cyclomatic 18) src/main/java/org/mark/llamacpp/server/tools/JsoupCliHelper.java:136— JsoupCliHelper.fetchPage 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.
ToolchainChecker.tryVsWhere (cyclomatic 18) src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:272— ToolchainChecker.tryVsWhere 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.
LlamaServerManager.loadSettingsFromFile (cyclomatic 18) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:193— LlamaServerManager.loadSettingsFromFile 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.
index.html.extractMediaFromContent (cyclomatic 18) src/main/resources/web/chat/index.html:3042— index.html.extractMediaFromContent 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.loadConversationById (cyclomatic 18) src/main/resources/web/chat/index.html:5738— index.html.loadConversationById 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 is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.pushMessage (cyclomatic 18) src/main/resources/web/chat/index.html:6829— index.html.pushMessage 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.deleteMessage (cyclomatic 18) src/main/resources/web/chat/index.html:8412— index.html.deleteMessage has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.initOrderedMultiSelects (cyclomatic 18) src/main/resources/web/index.html:5665— index.html.initOrderedMultiSelects has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 5678, 5667). 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.
index.html.loadCompatServiceStatus (cyclomatic 18) src/main/resources/web/index.html:6168— index.html.loadCompatServiceStatus 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.
benchmark-v3.hwFallback (cyclomatic 18) src/main/resources/web/js/benchmark-v3.js:1111— benchmark-v3.hwFallback 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.
model-action-modal.normalizeLaunchConfigBundle (cyclomatic 18) src/main/resources/web/js/model-action-modal.js:491— model-action-modal.normalizeLaunchConfigBundle 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.
model-action-modal.applyLaunchConfigToModal::tryApply (cyclomatic 18) src/main/resources/web/js/model-action-modal.js:680— model-action-modal.applyLaunchConfigToModal::tryApply 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.
model-action-modal.renderMainGpuSelect (cyclomatic 18) src/main/resources/web/js/model-action-modal.js:2054— model-action-modal.renderMainGpuSelect has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
model-list.renderBuildInfo (cyclomatic 18) src/main/resources/web/js/model-list.js:26— model-list.renderBuildInfo 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.
model-list.sortAndRenderModels (cyclomatic 18) src/main/resources/web/js/model-list.js:219— model-list.sortAndRenderModels has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 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.
mtp-bench.html.formatResultsAsText (cyclomatic 18) src/main/resources/web/tools/mtp-bench.html:877— mtp-bench.html.formatResultsAsText has cyclomatic complexity 18 (threshold 15). Of this number, 17 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.
perplexity.html.viewRecord (cyclomatic 18) src/main/resources/web/tools/perplexity.html:1046— perplexity.html.viewRecord 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.
updateModelSamplingConfig (cyclomatic 18) src/main/resources/web/js/model-detail.js:974— updateModelSamplingConfig has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 3 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.
saveHw (cyclomatic 18) REDACTED:217— saveHw has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 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.
loadConfigPane (cyclomatic 18) src/main/resources/web/js/newui/model-detail.js:101— loadConfigPane has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 106, 104, 105, …). 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.
populate (cyclomatic 18) src/main/resources/web/js/newui/settings.js:131— populate 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.
DownloadHandler.channelRead0 (cyclomatic 17) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:755— DownloadHandler.channelRead0 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.
DownloadToFileRequest.executeAsync (cyclomatic 17) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:925— DownloadToFileRequest.executeAsync 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.
DownloadToFileHandler.channelRead0 (cyclomatic 17) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1183— DownloadToFileHandler.channelRead0 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.
BasicRouterHandler.resolveLoadModelRemoteUrl (cyclomatic 17) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:588— BasicRouterHandler.resolveLoadModelRemoteUrl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BasicRouterHandler.resolvePropsRemoteUrl) 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.
BasicRouterHandler.resolvePropsRemoteUrl (cyclomatic 17) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:402— BasicRouterHandler.resolvePropsRemoteUrl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BasicRouterHandler.resolveLoadModelRemoteUrl) 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.
LlamaRouterHandler.resolveControlRemoteUrl (cyclomatic 17) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:363— LlamaRouterHandler.resolveControlRemoteUrl 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.
LlamacppController.handleTokenizeRequest (cyclomatic 17) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:794— LlamacppController.handleTokenizeRequest 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.
LlamacppController.proxyRawBytes (cyclomatic 17) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1063— LlamacppController.proxyRawBytes 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.
ModelActionController.fetchRemoteLoadedModels (cyclomatic 17) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:738— ModelActionController.fetchRemoteLoadedModels has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ModelActionController.fetchRemoteModelList) 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.
ModelActionController.fetchRemoteModelList (cyclomatic 17) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:455— ModelActionController.fetchRemoteModelList has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ModelActionController.fetchRemoteLoadedModels) 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.
McpClientService.callToolShortLived (cyclomatic 17) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:358— McpClientService.callToolShortLived 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.
OpenAIService.mergeRemoteModels (cyclomatic 17) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:238— OpenAIService.mergeRemoteModels 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.
CommandLineRunner.resolveExecutablePath (cyclomatic 17) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:922— CommandLineRunner.resolveExecutablePath 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.
GPUInfoHelper.getMemoryInfo (cyclomatic 17) src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:340— GPUInfoHelper.getMemoryInfo 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.
ConfigManager.normalizeLaunchConfigEntry (cyclomatic 17) src/main/java/org/mark/llamacpp/server/ConfigManager.java:824— ConfigManager.normalizeLaunchConfigEntry 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.
chat-mcp.create (cyclomatic 17) src/main/resources/web/chat/chat-mcp.js:278— chat-mcp.create 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.
index.html.flushStreamingMarkdown (cyclomatic 17) src/main/resources/web/chat/index.html:1846— index.html.flushStreamingMarkdown has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.renderModelMenu (cyclomatic 17) src/main/resources/web/chat/index.html:4823— index.html.renderModelMenu has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.ensureServerStateReady (cyclomatic 17) src/main/resources/web/chat/index.html:5631— index.html.ensureServerStateReady has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.flushStateSave (cyclomatic 17) src/main/resources/web/chat/index.html:5821— index.html.flushStateSave has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.generateTitleViaApi (cyclomatic 17) src/main/resources/web/chat/index.html:9198— index.html.generateTitleViaApi has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
benchmark-v3.renderChart (cyclomatic 17) src/main/resources/web/js/benchmark-v3.js:1310— benchmark-v3.renderChart has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
download.updateDownloadItem (cyclomatic 17) src/main/resources/web/js/download.js:376— download.updateDownloadItem has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs 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.
hf.fetchDetailGguf (cyclomatic 17) src/main/resources/web/js/hf.js:851— hf.fetchDetailGguf 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.
hf.selectRepo (cyclomatic 17) src/main/resources/web/js/hf.js:896— hf.selectRepo 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.
i18n.applyTranslations (cyclomatic 17) src/main/resources/web/js/i18n.js:69— i18n.applyTranslations 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 3 function literals inside it that branch (lines 86, 73, 113). 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.
model-action-modal.switchParamMode (cyclomatic 17) src/main/resources/web/js/model-action-modal.js:1306— model-action-modal.switchParamMode 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.
model-benchmark.buildBenchmarkCmdFromDynamicFields (cyclomatic 17) src/main/resources/web/js/model-benchmark.js:351— model-benchmark.buildBenchmarkCmdFromDynamicFields has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.addModelPath (cyclomatic 17) src/main/resources/web/js/settings.js:1613— settings.addModelPath 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.
benchmark-v2.html.withHardwareFallback (cyclomatic 17) src/main/resources/web/tools/benchmark-v2.html:610— benchmark-v2.html.withHardwareFallback 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.
benchmark-v2.html.deleteBenchmarkRecord (cyclomatic 17) src/main/resources/web/tools/benchmark-v2.html:652— benchmark-v2.html.deleteBenchmarkRecord 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.
llama-build.html.checkToolchain (cyclomatic 17) src/main/resources/web/tools/llama-build.html:1399— llama-build.html.checkToolchain 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.
perplexity.html.renderModelList (cyclomatic 17) src/main/resources/web/tools/perplexity.html:510— perplexity.html.renderModelList has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
setLogFilter (cyclomatic 17) src/main/resources/web/js/console-modal.js:67— setLogFilter has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 4 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.
deleteModelSamplingConfig (cyclomatic 17) src/main/resources/web/js/model-detail.js:1014— deleteModelSamplingConfig has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 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.
loadRecords (cyclomatic 17) REDACTED:242— loadRecords has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 247, 257, 263, …). 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.
fetchGguf (cyclomatic 17) src/main/resources/web/js/newui/hf.js:164— fetchGguf has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 172, 183, 191, …). 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.
NettyHttpDownloader.executeStreamDownload (cyclomatic 16) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:416— NettyHttpDownloader.executeStreamDownload 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.
Request.executeSingle (cyclomatic 16) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:350— Request.executeSingle 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.
LlamaRouterHandler.forwardControlToLocal (cyclomatic 16) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:396— LlamaRouterHandler.forwardControlToLocal 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.
OpenAIChatStreamingHandler.channelRead (cyclomatic 16) src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:59— OpenAIChatStreamingHandler.channelRead 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.
BuildController.handleBuildSubmit (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:111— BuildController.handleBuildSubmit 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.
EasyChatController.shouldUseGzip (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:225— EasyChatController.shouldUseGzip 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.
LlamacppController.handleApplyTemplateRequest (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:864— LlamacppController.handleApplyTemplateRequest 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.
LlamacppController.handleLlamaCppAdd (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:166— LlamacppController.handleLlamaCppAdd 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.
ModelActionController.callRemoteApiTracked (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1812— ModelActionController.callRemoteApiTracked 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.
ModelActionController.handleModelBenchmarkV2Delete (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1484— ModelActionController.handleModelBenchmarkV2Delete 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.
ModelActionController.handleRequest (cyclomatic 16) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:128— ModelActionController.handleRequest 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.
ChatStreamSession.run (cyclomatic 16) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:198— ChatStreamSession.run 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.
LlamaRecordService.extractJsonObjectValue (cyclomatic 16) src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:434— LlamaRecordService.extractJsonObjectValue 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.
ModelSamplingService.readStringArray (cyclomatic 16) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:778— ModelSamplingService.readStringArray 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.
OpenAIService.resolveFromRemoteNodes (cyclomatic 16) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:920— OpenAIService.resolveFromRemoteNodes 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.
OpenAIService.streamRawProxyResponse (cyclomatic 16) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:841— OpenAIService.streamRawProxyResponse 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.
CommandLineRunner.executeInternal (cyclomatic 16) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:127— CommandLineRunner.executeInternal 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.
CommandLineRunner.resolveByPathext (cyclomatic 16) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:962— CommandLineRunner.resolveByPathext 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.
index.html.buildLegacyAssistant (cyclomatic 16) src/main/resources/web/chat/index.html:2129— index.html.buildLegacyAssistant 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.syncAssistantVariantModelArrays (cyclomatic 16) src/main/resources/web/chat/index.html:3458— index.html.syncAssistantVariantModelArrays 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.html.canContinueAssistantResponse (cyclomatic 16) src/main/resources/web/chat/index.html:6028— index.html.canContinueAssistantResponse 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. This is NOT this file's highest cyclomatic complexity: index.html.applyLoadedState (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
benchmark-v3.deleteServerRecord (cyclomatic 16) src/main/resources/web/js/benchmark-v3.js:1187— benchmark-v3.deleteServerRecord 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.
model-action-modal.setFieldValue (cyclomatic 16) src/main/resources/web/js/model-action-modal.js:61— model-action-modal.setFieldValue 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.
model-action-modal.parseBooleanLike (cyclomatic 16) src/main/resources/web/js/model-action-modal.js:879— model-action-modal.parseBooleanLike 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.
settings.testNode (cyclomatic 16) src/main/resources/web/js/settings.js:1047— settings.testNode 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.
benchmark-v2.html.saveHardwareProfile (cyclomatic 16) src/main/resources/web/tools/benchmark-v2.html:591— benchmark-v2.html.saveHardwareProfile 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.
llama-build.html.loadFormState (cyclomatic 16) src/main/resources/web/tools/llama-build.html:1209— llama-build.html.loadFormState 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.
mtp-bench.html.setAggregateRow (cyclomatic 16) src/main/resources/web/tools/mtp-bench.html:523— mtp-bench.html.setAggregateRow 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, 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.
loadAutoLoadPolicy (cyclomatic 16) src/main/resources/web/js/model-action-modal.js:1092— loadAutoLoadPolicy has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
loadModelChatTemplate (cyclomatic 16) src/main/resources/web/js/model-detail.js:1076— loadModelChatTemplate 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 3 function literals inside it that branch (lines 1085, 1084, 1097). 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.
testProxyConnection (cyclomatic 16) src/main/resources/web/js/settings.js:2220— testProxyConnection has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
loadHistory (cyclomatic 16) REDACTED:493— loadHistory has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 498, 508, 501, …). 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.
onConsoleMsg (cyclomatic 16) src/main/resources/web/js/newui/logs.js:171— onConsoleMsg 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.
savePathSheet (cyclomatic 16) src/main/resources/web/js/newui/settings-nodes.js:190— savePathSheet has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 4 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.
load (cyclomatic 16) src/main/resources/web/js/newui/settings.js:273— load has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 280, 297, 303). 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.
TodoComment src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2277— // // TODO — 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.
EasyChatService.handleStreamChat (cognitive 228) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:166— EasyChatService.handleStreamChat has cognitive complexity 228 (threshold 15). Drivers by points: if/else 82 (142 pts), boolean chains 30, error handling 12 (25 pts), ternaries 12 (24 pts), loops 3 (7 pts) (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.requestAssistantResponse (cognitive 207) src/main/resources/web/chat/index.html:7725— index.html.requestAssistantResponse has cognitive complexity 207 (threshold 15). Drivers by points: if/else 48 (144 pts), boolean chains 38, ternaries 9 (18 pts), loops 3 (6 pts), error handling 1 (nesting depth added 108). Of this number, 205 points are the body's own statements and 2 belong to 2 function literals 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.
EasyChatService.handleStreamChatHistory (cognitive 173) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:729— EasyChatService.handleStreamChatHistory has cognitive complexity 173 (threshold 15). Drivers by points: if/else 31 (86 pts), ternaries 10 (34 pts), error handling 8 (22 pts), loops 8 (22 pts), boolean chains 9 (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicService.convertAnthropicToOai (cognitive 168) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:749— AnthropicService.convertAnthropicToOai has cognitive complexity 168 (threshold 15). Drivers by points: if/else 48 (123 pts), boolean chains 21, loops 7 (21 pts), ternaries 1 (3 pts) (nesting depth added 91). 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.
applyCmdToDynamicFields (cognitive 156) src/main/resources/web/js/model-action-modal.js:309— applyCmdToDynamicFields has cognitive complexity 156 (threshold 15). Drivers by points: if/else 43 (93 pts), ternaries 15 (33 pts), boolean chains 19, loops 9 (11 pts) (nesting depth added 70). Of this number, 150 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildLoadModelPayload (cognitive 137) src/main/resources/web/js/model-action-modal.js:1497— buildLoadModelPayload has cognitive complexity 137 (threshold 15). Drivers by points: if/else 26 (81 pts), boolean chains 27, ternaries 12 (27 pts), loops 1 (2 pts) (nesting depth added 71). Of this number, 129 points are the body's own statements and 8 belong to 3 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.
extractSamplingSettingsFromConfig (cognitive 137) src/main/resources/web/js/model-detail.js:405— extractSamplingSettingsFromConfig has cognitive complexity 137 (threshold 15). Drivers by points: if/else 36 (88 pts), boolean chains 42, loops 4, match/switch 1 (2 pts), ternaries 1 (nesting depth added 53). Of this number, 105 points are the body's own statements and 32 belong to 4 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.
submitModelAction (cognitive 120) src/main/resources/web/js/model-action-modal.js:1617— submitModelAction has cognitive complexity 120 (threshold 15). Drivers by points: if/else 35 (64 pts), ternaries 17 (28 pts), boolean chains 25, error handling 2 (3 pts) (nesting depth added 41). Of this number, 65 points are the body's own statements and 55 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.
index.html.createMessageElement (cognitive 117) src/main/resources/web/chat/index.html:6057— index.html.createMessageElement has cognitive complexity 117 (threshold 15). Drivers by points: if/else 32 (56 pts), loops 8 (24 pts), boolean chains 20, ternaries 11 (17 pts) (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.
updateDownloadProgress (cognitive 115) src/main/resources/web/js/download.js:404— updateDownloadProgress has cognitive complexity 115 (threshold 15). Drivers by points: if/else 24 (55 pts), ternaries 16 (29 pts), boolean chains 24, loops 2 (7 pts) (nesting depth added 49). Of this number, 114 points are the body's own statements and 1 belongs to one function literal 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.
LlamaServerManager.listModel (cognitive 113) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:327— LlamaServerManager.listModel has cognitive complexity 113 (threshold 15). Drivers by points: if/else 24 (71 pts), loops 9 (19 pts), error handling 5 (15 pts), boolean chains 8 (nesting depth added 67). 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.
index.html.regenerateMessage (cognitive 109) src/main/resources/web/chat/index.html:8010— index.html.regenerateMessage has cognitive complexity 109 (threshold 15). Drivers by points: if/else 41 (77 pts), boolean chains 13, loops 5 (12 pts), ternaries 4 (7 pts) (nesting depth added 46). Of this number, 108 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.
checkUpdate (cognitive 98) src/main/resources/web/js/settings.js:1096— checkUpdate has cognitive complexity 98 (threshold 15). Drivers by points: if/else 47 (66 pts), boolean chains 17, ternaries 5 (11 pts), 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.
FileUploadRouterHandler.channelRead (cognitive 97) src/main/java/org/mark/llamacpp/server/channel/FileUploadRouterHandler.java:50— FileUploadRouterHandler.channelRead has cognitive complexity 97 (threshold 15). Drivers by points: if/else 29 (74 pts), error handling 3 (13 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenAIService.handleOpenAIModelsRequest (cognitive 92) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:99— OpenAIService.handleOpenAIModelsRequest has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (71 pts), boolean chains 9, loops 6 (8 pts), error handling 2 (4 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.
create.bindEvents (cognitive 87) src/main/resources/web/chat/chat-mcp.js:889— create.bindEvents has cognitive complexity 87 (threshold 15). Drivers by points: if/else 28 (37 pts), ternaries 6 (19 pts), boolean chains 18, error handling 6 (13 pts) (nesting depth added 29). Of this number, 18 points are the body's own statements and 69 belong to 25 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.
renderModelsList (cognitive 83) src/main/resources/web/js/model-list.js:293— renderModelsList has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 28 (34 pts), if/else 19 (26 pts), boolean chains 23 (nesting depth added 13). Of this number, 21 points are the body's own statements and 62 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.
ModelSamplingService.applySamplingFromCmd (cognitive 82) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:409— ModelSamplingService.applySamplingFromCmd has cognitive complexity 82 (threshold 15). Drivers by points: if/else 22 (60 pts), boolean chains 19, match/switch 1 (2 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderBenchmarkFieldFromParam (cognitive 81) src/main/resources/web/js/model-benchmark.js:165— renderBenchmarkFieldFromParam has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 26 (38 pts), boolean chains 26, if/else 10 (15 pts), loops 1 (2 pts) (nesting depth added 18). Of this number, 76 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.updateAssistantMessageElement (cognitive 78) src/main/resources/web/chat/index.html:6678— index.html.updateAssistantMessageElement has cognitive complexity 78 (threshold 15). Drivers by points: if/else 37 (59 pts), boolean chains 17, ternaries 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParamTool.handleThinking (cognitive 72) src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:357— ParamTool.handleThinking has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (55 pts), error handling 4 (11 pts), boolean chains 6 (nesting depth added 40). 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.
index.html.buildPayload (cognitive 72) src/main/resources/web/chat/index.html:9031— index.html.buildPayload has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 25, ternaries 15 (19 pts), loops 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StreamingForwarder.extractFields (cognitive 69) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:246— StreamingForwarder.extractFields has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (63 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 43). 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.
AnthropicService.handleStreamResponse (cognitive 68) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:467— AnthropicService.handleStreamResponse has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (55 pts), boolean chains 6, error handling 2 (5 pts), loops 1, ternaries 1 (nesting depth added 37). 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.
EasyChatService.accumulateDelta (cognitive 68) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1717— EasyChatService.accumulateDelta has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 16, ternaries 1 (6 pts), loops 1 (2 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
chat-mcp.create.bindEvents (cognitive 68) src/main/resources/web/chat/chat-mcp.js:889— chat-mcp.create.bindEvents has cognitive complexity 68 (threshold 15). Drivers by points: if/else 28 (37 pts), boolean chains 18, ternaries 6 (13 pts) (nesting depth added 16). Of this number, 18 points are the body's own statements and 50 belong to 13 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.
ModelActionController.handleModelBenchmark (cognitive 67) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1128— ModelActionController.handleModelBenchmark has cognitive complexity 67 (threshold 15). Drivers by points: if/else 26 (44 pts), boolean chains 9, loops 3 (8 pts), error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
showModelDetailModal (cognitive 67) src/main/resources/web/js/model-detail.js:29— showModelDetailModal has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (45 pts), boolean chains 9, error handling 3 (7 pts), ternaries 4, loops 1 (2 pts) (nesting depth added 18). Of this number, 26 points are the body's own statements and 41 belong to 28 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.
OpenAIService.handleOpenAIResponsesRequest (cognitive 66) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1086— OpenAIService.handleOpenAIResponsesRequest has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (50 pts), boolean chains 8, ternaries 3 (7 pts), error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.refreshModels (cognitive 65) src/main/resources/web/chat/index.html:9559— index.html.refreshModels has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 11 (28 pts), if/else 13 (26 pts), boolean chains 8, loops 1 (2 pts), error handling 1 (nesting depth added 31). Of this number, 59 points are the body's own statements and 6 belong to 2 function literals 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.
benchmark-v3.createResultRow (cognitive 65) src/main/resources/web/js/benchmark-v3.js:1226— benchmark-v3.createResultRow has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 22 (38 pts), boolean chains 14, if/else 8 (12 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings.restoreUpdateStatus (cognitive 65) src/main/resources/web/js/settings.js:1421— settings.restoreUpdateStatus has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (55 pts), boolean chains 6, ternaries 1 (3 pts), error handling 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.
OpenAIService.handleOpenAIRerankRequest (cognitive 64) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:975— OpenAIService.handleOpenAIRerankRequest has cognitive complexity 64 (threshold 15). Drivers by points: if/else 24 (48 pts), boolean chains 8, ternaries 3 (7 pts), error handling 1 (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.
index.html.addFilesToEditingMessage (cognitive 64) src/main/resources/web/chat/index.html:7424— index.html.addFilesToEditingMessage has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 20, error handling 4 (11 pts), 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.
OpenAIService.handleStreamResponse (cognitive 63) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1569— OpenAIService.handleStreamResponse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (55 pts), boolean chains 5, error handling 1, loops 1, ternaries 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServer.loadApplicationConfig (cognitive 63) src/main/java/org/mark/llamacpp/server/LlamaServer.java:513— LlamaServer.loadApplicationConfig has cognitive complexity 63 (threshold 15). Drivers by points: if/else 31 (62 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.addDraftFiles (cognitive 63) src/main/resources/web/chat/index.html:2820— index.html.addDraftFiles has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 20, error handling 4 (11 pts), 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.
index.html.renderSystemInfo (cognitive 63) src/main/resources/web/index.html:6521— index.html.renderSystemInfo has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 31, ternaries 13 (24 pts), if/else 7 (8 pts) (nesting depth added 12). Of this number, 33 points are the body's own statements and 30 belong to 3 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.
PerplexityController.handleListRecords (cognitive 62) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:205— PerplexityController.handleListRecords has cognitive complexity 62 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 5 (20 pts), error handling 3 (8 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loadModel (cognitive 62) src/main/resources/web/js/model-action-modal.js:1398— loadModel has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 24, if/else 16 (19 pts), ternaries 12 (18 pts), loops 1 (nesting depth added 9). Of this number, 26 points are the body's own statements and 36 belong to 9 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.
LlamacppController.handleLlamaCppReleaseLatest (cognitive 61) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:665— LlamacppController.handleLlamaCppReleaseLatest has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 14, loops 3 (6 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicService.handleModelsRequest (cognitive 61) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:85— AnthropicService.handleModelsRequest has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 5 (10 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderTokenSummary (cognitive 61) src/main/resources/web/js/usage-report.js:322— renderTokenSummary has cognitive complexity 61 (threshold 15). Drivers by points: boolean chains 29, if/else 13 (17 pts), ternaries 8 (11 pts), loops 4 (nesting depth added 7). Of this number, 17 points are the body's own statements and 44 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.
OpenAIService.handleOpenAIEmbeddingsRequest (cognitive 60) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:421— OpenAIService.handleOpenAIEmbeddingsRequest has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (46 pts), ternaries 3 (7 pts), boolean chains 6, error handling 1 (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.
GGUFMetaData.readFile (cognitive 59) src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:76— GGUFMetaData.readFile has cognitive complexity 59 (threshold 15). Drivers by points: if/else 28 (47 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.loadModelInBackgroundFromCmd (cognitive 59) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2138— LlamaServerManager.loadModelInBackgroundFromCmd has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (38 pts), ternaries 6 (10 pts), boolean chains 6, error handling 3 (5 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.
render (cognitive 59) src/main/resources/web/js/newui/misc-pages.js:132— render has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 23, if/else 10 (nesting depth added 9). Of this number, 28 points are the body's own statements and 31 belong to 4 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.
SystemController.handleFsListRequest (cognitive 57) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:285— SystemController.handleFsListRequest has cognitive complexity 57 (threshold 15). Drivers by points: if/else 28 (33 pts), boolean chains 9, ternaries 6 (7 pts), error handling 5, loops 1 (3 pts) (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.
ensureAutoUnloadWired (cognitive 56) src/main/resources/web/js/model-action-modal.js:1116— ensureAutoUnloadWired has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (35 pts), ternaries 5 (11 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 21). Most of this is not in the body itself: 3 of the 56 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1125, 1155, 1172, …). 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.
ModelPathController.handleModelPathUpdate (cognitive 55) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:285— ModelPathController.handleModelPathUpdate has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 10, error handling 4 (8 pts), ternaries 4, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.renderParamField (cognitive 55) src/main/resources/web/index.html:5753— index.html.renderParamField has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 9 (24 pts), if/else 12 (18 pts), boolean chains 11, match/switch 1 (2 pts) (nesting depth added 22). Of this number, 53 points are the body's own statements and 2 belong 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.
handleAppUpdateEvent (cognitive 53) src/main/resources/web/js/settings.js:1350— handleAppUpdateEvent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (38 pts), ternaries 4 (12 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAIService.forwardStreamToRemote (cognitive 51) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:630— OpenAIService.forwardStreamToRemote has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 4 (5 pts), boolean chains 4, error handling 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.normalizeAssistant (cognitive 51) src/main/resources/web/chat/index.html:2102— index.html.normalizeAssistant has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 31 (46 pts), boolean chains 5 (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.
onMsg (cognitive 51) src/main/resources/web/js/newui/app.js:166— onMsg has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 5 (13 pts), boolean chains 4, error handling 1, match/switch 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.
ModelActionController.buildLocalModelList (cognitive 50) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:320— ModelActionController.buildLocalModelList has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 11, ternaries 2 (4 pts), loops 2, error handling 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.
ModelInfoController.handleOpenAIModelsRequest (cognitive 50) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374— ModelInfoController.handleOpenAIModelsRequest has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (34 pts), boolean chains 7, loops 4 (5 pts), error handling 2 (4 pts) (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.
PerplexityController.fetchRemoteRecords (cognitive 50) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:287— PerplexityController.fetchRemoteRecords has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 4 (16 pts), loops 3 (5 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatRequestStreamingTransformer.transform (cognitive 49) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:49— ChatRequestStreamingTransformer.transform has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServer.main (cognitive 49) src/main/java/org/mark/llamacpp/server/LlamaServer.java:78— LlamaServer.main has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (27 pts), error handling 13 (14 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.fetchSysInfo (cognitive 49) src/main/resources/web/index.html:6455— index.html.fetchSysInfo has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (40 pts), boolean chains 8, ternaries 1 (nesting depth added 14). Most of this is not in the body itself: 6 of the 49 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6468, 6512). 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.
benchmark-v2.html.runBenchmark (cognitive 49) src/main/resources/web/tools/benchmark-v2.html:962— benchmark-v2.html.runBenchmark has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 7 (12 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelInfoController.handleModelConfigSetRequest (cognitive 48) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:638— ModelInfoController.handleModelConfigSetRequest has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 3 (8 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MtpHelper.mergeDonor (cognitive 47) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:283— MtpHelper.mergeDonor has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 13 (17 pts), boolean chains 3, 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.
LlamacppController.handleLlamaCppList (cognitive 47) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:443— LlamacppController.handleLlamaCppList has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 4 (11 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 29). 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.
EasyChatRequestWriter.writeRequestBody (cognitive 47) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:30— EasyChatRequestWriter.writeRequestBody has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.buildCommandStrFromForm (cognitive 47) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2445— LlamaServerManager.buildCommandStrFromForm has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 10, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelPathController.syncModelPathsToRuntime (cognitive 46) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:499— ModelPathController.syncModelPathsToRuntime has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (27 pts), error handling 3 (10 pts), loops 2 (5 pts), boolean chains 4 (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.
OpenAIService.handleOpenAICompletionsRequest (cognitive 45) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:312— OpenAIService.handleOpenAICompletionsRequest has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (34 pts), ternaries 3 (7 pts), boolean chains 3, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandLineRunner.splitCommandLineArgs (cognitive 45) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1075— CommandLineRunner.splitCommandLineArgs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 5, loops 1 (nesting depth added 24). 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.
LlamaCppProcess.splitCommandLineArgs (cognitive 45) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:667— LlamaCppProcess.splitCommandLineArgs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 5, loops 1 (nesting depth added 24). 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.
loadModels (cognitive 45) src/main/resources/web/js/model-list.js:69— loadModels has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 8 (16 pts), boolean chains 8, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 18). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 87, 111, 116, …). 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.
generateHttpsCert (cognitive 45) src/main/resources/web/js/settings.js:672— generateHttpsCert has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 18, ternaries 1 (3 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.
HuggingFaceSearcher.resolveBaseUrl (cognitive 44) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:574— HuggingFaceSearcher.resolveBaseUrl has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 6, error handling 1 (4 pts) (nesting depth added 25). 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.
index.html.replaceMathInPlainText (cognitive 43) src/main/resources/web/chat/index.html:1128— index.html.replaceMathInPlainText has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (5 pts), boolean chains 4 (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.
hf.createHfDownloadTasks (cognitive 43) src/main/resources/web/js/hf.js:402— hf.createHfDownloadTasks has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 18, if/else 10 (11 pts), ternaries 7 (10 pts), loops 1 (3 pts), error handling 1 (nesting depth added 6). Of this number, 38 points are the body's own statements and 5 belong to 2 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.
loadDeviceList (cognitive 43) src/main/resources/web/js/model-action-modal.js:2193— loadDeviceList has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 15, ternaries 6 (9 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 15 of the 43 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 2220, 2259, 2248, …). 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.
populate (cognitive 43) src/main/resources/web/js/settings.js:340— populate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 6, ternaries 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.
runServer (cognitive 43) REDACTED:136— runServer has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 11, ternaries 3 (7 pts), error handling 1 (nesting depth added 11). Of this number, 36 points are the body's own statements and 7 belong to 7 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.
LlamaServerManager.buildAutoLoadModelCache (cognitive 42) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1136— LlamaServerManager.buildAutoLoadModelCache has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (29 pts), error handling 6 (10 pts), loops 2, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.directoryBrowserRender (cognitive 42) src/main/resources/web/index.html:5103— index.html.directoryBrowserRender has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 22, if/else 16 (17 pts), ternaries 2 (3 pts) (nesting depth added 2). Of this number, 21 points are the body's own statements and 21 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.
BasicRouterHandler.resolveLoadModelRemoteUrl (cognitive 41) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:588— BasicRouterHandler.resolveLoadModelRemoteUrl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BasicRouterHandler.resolvePropsRemoteUrl) 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.
BasicRouterHandler.resolvePropsRemoteUrl (cognitive 41) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:402— BasicRouterHandler.resolvePropsRemoteUrl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BasicRouterHandler.resolveLoadModelRemoteUrl) 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.
LlamaRouterHandler.resolveControlRemoteUrl (cognitive 41) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:363— LlamaRouterHandler.resolveControlRemoteUrl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EasyChatService.proxySseStreamFromRemote (cognitive 41) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2359— EasyChatService.proxySseStreamFromRemote has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (38 pts), boolean chains 2, loops 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.
appendResultRow (cognitive 41) src/main/resources/web/js/benchmark-v3.js:1275— appendResultRow has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 5 (11 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 16). Of this number, 28 points are the body's own statements and 13 belong to 4 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.
NettyHttpDownloader.download (cognitive 40) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:137— NettyHttpDownloader.download has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 4 (10 pts), ternaries 2 (8 pts), loops 3 (7 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.
SimpleHttpDownloader.download (cognitive 40) src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:75— SimpleHttpDownloader.download has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 4 (10 pts), ternaries 2 (8 pts), loops 3 (7 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.
HuggingFaceSearcher.parseCursorFromLinkHeader (cognitive 40) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:535— HuggingFaceSearcher.parseCursorFromLinkHeader has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (8 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemController.handleVramEstimateRequest (cognitive 40) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1641— SystemController.handleVramEstimateRequest has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 13, ternaries 2 (4 pts), error handling 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.
populateLogFilter (cognitive 40) src/main/resources/web/js/websocket.js:248— populateLogFilter has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 12, ternaries 5 (9 pts), error handling 2, loops 1 (nesting depth added 9). Most of this is not in the body itself: 11 of the 40 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 263, fetchLogModels, a function literal at line 259, …). 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.
applyCmdToForm (cognitive 40) REDACTED:519— applyCmdToForm has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 11, loops 3 (5 pts) (nesting depth added 12). Of this number, 25 points are the body's own statements and 15 belong to 8 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.
DownloadTaskManager.extractTar (cognitive 39) src/main/java/org/mark/file/downloader/DownloadTaskManager.java:529— DownloadTaskManager.extractTar has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemController.firstBoolean (cognitive 39) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1206— SystemController.firstBoolean has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenAIService.resolveFromRemoteNodes (cognitive 39) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:920— OpenAIService.resolveFromRemoteNodes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mtp-bench.html.runBenchmark (cognitive 39) src/main/resources/web/tools/mtp-bench.html:604— mtp-bench.html.runBenchmark has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 14, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 38 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.
setModelActionMode (cognitive 39) src/main/resources/web/js/model-action-modal.js:1354— setModelActionMode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 6 (11 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quickStartModel (cognitive 39) src/main/resources/web/js/model-list.js:740— quickStartModel has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 18, if/else 11 (13 pts), ternaries 5 (6 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 748, 784, 772, …). 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.
BasicRouterHandler.handleRequest (cognitive 38) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:140— BasicRouterHandler.handleRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (28 pts), ternaries 3 (5 pts), error handling 2, loops 1 (2 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.
LlamacppController.handleInfillRequest (cognitive 38) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:925— LlamacppController.handleInfillRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 9, error handling 4 (5 pts), loops 1, 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.
CertController.handleGenerate (cognitive 37) src/main/java/org/mark/llamacpp/server/controller/CertController.java:165— CertController.handleGenerate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 4, loops 2 (4 pts), boolean chains 3, 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.
CommandLineRunner.applyExecutableDirEnv (cognitive 37) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:310— CommandLineRunner.applyExecutableDirEnv has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 7, loops 2 (4 pts), error handling 1, ternaries 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.
LlamaServerManager.handleDirectory (cognitive 37) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1703— LlamaServerManager.handleDirectory has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 7, loops 3 (5 pts), ternaries 1 (2 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.
index.html.convertHistoryMessage (cognitive 37) src/main/resources/web/chat/index.html:8939— index.html.convertHistoryMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 18 (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.
LlamacppController.handleLlamaCppRemove (cognitive 36) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:244— LlamacppController.handleLlamaCppRemove has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 6 (10 pts), boolean chains 6, error handling 4 (6 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.
PerplexityService.run (cognitive 36) src/main/java/org/mark/llamacpp/server/service/PerplexityService.java:86— PerplexityService.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (25 pts), error handling 5 (6 pts), boolean chains 4, 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.
LlamaServerManager.handleFitParam (cognitive 36) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3190— LlamaServerManager.handleFitParam has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 4, boolean chains 3, 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.
LlamaServerManager.loadSettingsFromFile (cognitive 36) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:193— LlamaServerManager.loadSettingsFromFile has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 3 (5 pts), loops 2 (5 pts), boolean chains 4 (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.
index.html.renderRichText (cognitive 36) src/main/resources/web/chat/index.html:1755— index.html.renderRichText has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (3 pts), ternaries 1 (nesting depth added 15). Of this number, 21 points are the body's own statements and 15 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.
index.html.normalizeAssistantResponse (cognitive 36) src/main/resources/web/chat/index.html:3677— index.html.normalizeAssistantResponse has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 20 (31 pts), boolean chains 5 (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.
index.html.continueMessage (cognitive 36) src/main/resources/web/chat/index.html:8266— index.html.continueMessage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 7 (11 pts), boolean chains 8 (nesting depth added 7). Of this number, 33 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
benchmark-v2.html.loadBenchmarkRecords (cognitive 36) src/main/resources/web/tools/benchmark-v2.html:886— benchmark-v2.html.loadBenchmarkRecords has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 10, ternaries 7 (8 pts), loops 3 (4 pts), error handling 1 (nesting depth added 6). Of this number, 28 points are the body's own statements and 8 belong to 2 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.
create.renderServerList (cognitive 36) src/main/resources/web/chat/chat-mcp.js:478— create.renderServerList has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 5, boolean chains 3 (nesting depth added 14). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 492, 500, 483, …). 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.
downloadUpdate (cognitive 36) src/main/resources/web/js/settings.js:1252— downloadUpdate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingForwarder.handleBooleanValue (cognitive 35) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:427— StreamingForwarder.handleBooleanValue has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 9, ternaries 1 (2 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.
LlamaCppProcess.start (cognitive 35) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:130— LlamaCppProcess.start has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, loops 3 (5 pts), error handling 3 (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.
LlamaServerManager.handleFitParam (cognitive 35) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3082— LlamaServerManager.handleFitParam has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 1 (3 pts), ternaries 3, 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.
websocket.handleWebSocketMessage (cognitive 35) src/main/resources/web/js/websocket.js:86— websocket.handleWebSocketMessage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 1 (4 pts), match/switch 1 (2 pts), error handling 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.
DownloadToFileRequest.execute (cognitive 34) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:877— DownloadToFileRequest.execute has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (20 pts), error handling 4 (10 pts), boolean chains 3, 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.
DownloadToFileHandler.channelRead0 (cognitive 34) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1183— DownloadToFileHandler.channelRead0 has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 3 (12 pts), boolean chains 4 (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.
FileDownloadRouterHandler.handleModelDownload (cognitive 34) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:175— FileDownloadRouterHandler.handleModelDownload has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 5, 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.
JsonUtil.ensureToolCallIds (cognitive 34) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:314— JsonUtil.ensureToolCallIds has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 6, ternaries 2 (6 pts), loops 1 (2 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.
LlamaServerManager.autoLoadModelFromConfig (cognitive 34) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3483— LlamaServerManager.autoLoadModelFromConfig has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (24 pts), ternaries 4, boolean chains 3, error handling 1 (2 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.
TavilyExtractTool.parseExtractResponse (cognitive 34) src/main/java/org/mark/test/mcp/tavily/tools/TavilyExtractTool.java:109— TavilyExtractTool.parseExtractResponse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 8, loops 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.
index.html.directoryBrowserLoad (cognitive 34) src/main/resources/web/index.html:5231— index.html.directoryBrowserLoad has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 11, ternaries 2 (3 pts), error handling 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.
benchmark-v3.runBench (cognitive 34) src/main/resources/web/js/benchmark-v3.js:772— benchmark-v3.runBench has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 15, ternaries 1 (2 pts), error handling 1 (nesting depth added 6). Of this number, 24 points are the body's own statements and 10 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.
model-benchmark.submitModelBenchmark (cognitive 34) src/main/resources/web/js/model-benchmark.js:447— model-benchmark.submitModelBenchmark has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 10, if/else 8 (nesting depth added 5). Of this number, 24 points are the body's own statements and 10 belong to 2 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.
resetModelBenchmarkForm (cognitive 34) src/main/resources/web/js/model-benchmark.js:284— resetModelBenchmarkForm has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 10 (16 pts), if/else 8 (12 pts), boolean chains 5, 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.
openModelBenchmarkList (cognitive 34) src/main/resources/web/js/model-benchmark.js:513— openModelBenchmarkList has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 11, if/else 5, error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 18 belong to 4 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.
createCloneModel (cognitive 34) src/main/resources/web/js/model-list.js:658— createCloneModel has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, ternaries 8 (10 pts), if/else 7, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 670, 703, 711, …). 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.
DownloadHandler.channelRead0 (cognitive 33) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:755— DownloadHandler.channelRead0 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), error handling 2 (7 pts), boolean chains 4 (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.
MtpHelper.extractDonor (cognitive 33) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:157— MtpHelper.extractDonor has cognitive complexity 33 (threshold 15). Drivers by points: loops 11 (18 pts), if/else 8 (14 pts), ternaries 1 (nesting depth added 13). 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.
index.html.sendMessage (cognitive 33) src/main/resources/web/chat/index.html:9652— index.html.sendMessage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 10). Of this number, 32 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.
benchmark-v3.runServer (cognitive 33) src/main/resources/web/js/benchmark-v3.js:1017— benchmark-v3.runServer has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 11, error handling 1, loops 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.
benchmark-v2.html.normalizeRecordRow (cognitive 33) src/main/resources/web/tools/benchmark-v2.html:758— benchmark-v2.html.normalizeRecordRow has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 17 (19 pts), boolean chains 14 (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.
fitParamsAction (cognitive 33) src/main/resources/web/js/model-action-modal.js:1919— fitParamsAction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, ternaries 6 (7 pts), loops 1 (4 pts), error handling 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 17 belong to 3 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.
loadOverview (cognitive 33) src/main/resources/web/js/newui/model-detail.js:42— loadOverview has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 16, ternaries 9, if/else 5 (6 pts), error handling 2 (nesting depth added 1). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 57, 56, 82, …). 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.
ModelPathController.handleModelPathAdd (cognitive 32) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:126— ModelPathController.handleModelPathAdd has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, error handling 4 (7 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.
BenchmarkService.handleBenchmark (cognitive 32) src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:82— BenchmarkService.handleBenchmark has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14, boolean chains 8, ternaries 5 (6 pts), error handling 3 (4 pts) (nesting depth added 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.
OpenAIService.mergeRemoteModels (cognitive 32) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:238— OpenAIService.mergeRemoteModels has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (4 pts), boolean chains 2, error handling 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.
ConfigManager.normalizeLaunchConfigEntry (cognitive 32) src/main/java/org/mark/llamacpp/server/ConfigManager.java:824— ConfigManager.normalizeLaunchConfigEntry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.buildCommandStrFromCmd (cognitive 32) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2566— LlamaServerManager.buildCommandStrFromCmd has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 5, loops 3, ternaries 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.
index.html.directoryBrowserNormalizeItems (cognitive 32) src/main/resources/web/index.html:5063— index.html.directoryBrowserNormalizeItems has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 20, ternaries 8 (10 pts), if/else 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 5065, 5080, 5090). 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.
groupGgufFiles (cognitive 32) src/main/resources/web/js/hf.js:238— groupGgufFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (8 pts), boolean chains 7, loops 3 (nesting depth added 10). Of this number, 16 points are the body's own statements and 16 belong to 4 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.
toggleShareConfig (cognitive 32) src/main/resources/web/js/model-action-modal.js:800— toggleShareConfig has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 3 (7 pts), error handling 2 (4 pts) (nesting depth added 10). Of this number, 18 points are the body's own statements and 14 belong to 8 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.
StreamingForwarder.handleNumberValue (cognitive 31) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:528— StreamingForwarder.handleNumberValue has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (28 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.
LlamaServerManager.handleModelInfo (cognitive 31) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2837— LlamaServerManager.handleModelInfo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, ternaries 4 (5 pts), loops 3, 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.
NodeManager.callRemoteApiStreaming (cognitive 31) REDACTED:409— NodeManager.callRemoteApiStreaming has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, error handling 3 (4 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.
index.html.formatAssistantPerformanceDetailText (cognitive 31) src/main/resources/web/chat/index.html:3610— index.html.formatAssistantPerformanceDetailText has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.loadModelFromMenu (cognitive 31) src/main/resources/web/chat/index.html:4997— index.html.loadModelFromMenu has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, if/else 8, ternaries 4 (6 pts), error handling 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.
ModelActionController.fetchRemoteLoadedModels (cognitive 30) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:738— ModelActionController.fetchRemoteLoadedModels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ModelActionController.fetchRemoteModelList) 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.
ModelActionController.fetchRemoteModelList (cognitive 30) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:455— ModelActionController.fetchRemoteModelList has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ModelActionController.fetchRemoteLoadedModels) 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.
SystemController.handleSysSettingRequest (cognitive 30) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:843— SystemController.handleSysSettingRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 9, ternaries 1 (2 pts), error handling 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.
McpClientService.callToolShortLived (cognitive 30) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:358— McpClientService.callToolShortLived has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EasyChatService.accumulateNonStreamResponse (cognitive 30) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2184— EasyChatService.accumulateNonStreamResponse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, loops 1 (3 pts), error handling 1 (2 pts), ternaries 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.
EasyChatService.seedAccumulatorFromFragment (cognitive 30) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1833— EasyChatService.seedAccumulatorFromFragment has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, error handling 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.
EasyChatStorage.readModelIndex (cognitive 30) src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:377— EasyChatStorage.readModelIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (10 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServer.createWindowsSystemTray (cognitive 30) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1845— LlamaServer.createWindowsSystemTray has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14 (24 pts), error handling 3, if/else 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.extractSpecFromLaunchConfig (cognitive 30) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1441— LlamaServerManager.extractSpecFromLaunchConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, error handling 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.
index.html.renderGpuSection (cognitive 30) src/main/resources/web/chat/index.html:5327— index.html.renderGpuSection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7, ternaries 2 (4 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.
index.html.buildSamplingParamsJson (cognitive 30) src/main/resources/web/chat/index.html:8594— index.html.buildSamplingParamsJson has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, 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.
benchmark-v3.buildBenchCmd (cognitive 30) src/main/resources/web/js/benchmark-v3.js:648— benchmark-v3.buildBenchCmd has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, ternaries 3 (6 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.
model-action-modal.setFieldValue (cognitive 30) src/main/resources/web/js/model-action-modal.js:61— model-action-modal.setFieldValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, error handling 1 (4 pts), ternaries 2 (4 pts), 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.
perplexity.html.runTest (cognitive 30) src/main/resources/web/tools/perplexity.html:839— perplexity.html.runTest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (7 pts), boolean chains 4, error handling 2 (3 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.
addModelSamplingConfig (cognitive 30) src/main/resources/web/js/model-detail.js:925— addModelSamplingConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, ternaries 4 (6 pts), loops 1 (2 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 943, 942, 969). 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.
calculateModelTokens (cognitive 30) src/main/resources/web/js/model-detail.js:1195— calculateModelTokens has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, ternaries 5 (8 pts), if/else 6, error handling 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.
loadLlamaCppReleases (cognitive 30) src/main/resources/web/js/settings.js:105— loadLlamaCppReleases has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 4 (6 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.
renderDailyChart (cognitive 30) src/main/resources/web/js/usage-report.js:496— renderDailyChart has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (9 pts), ternaries 4 (7 pts), loops 2 (nesting depth added 4). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (onmousemove, a function literal at line 540, dailyLabelFn, …). 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.
AutoLoadPolicyController.handleSetPolicy (cognitive 29) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:93— AutoLoadPolicyController.handleSetPolicy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, error handling 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.
ModelActionController.buildLocalLoadedModels (cognitive 29) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:682— ModelActionController.buildLocalLoadedModels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 5 (11 pts), loops 3 (6 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.
SystemController.handleFitParamsRequest (cognitive 29) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1764— SystemController.handleFitParamsRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 10, ternaries 1 (2 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, 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.
chat-mcp.create.restoreScrollPositions (cognitive 29) src/main/resources/web/chat/chat-mcp.js:433— chat-mcp.create.restoreScrollPositions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9, error handling 1 (4 pts), ternaries 3 (4 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 11 belong to 4 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.
mtp-bench.html.renderModelList (cognitive 29) src/main/resources/web/tools/mtp-bench.html:400— mtp-bench.html.renderModelList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 9). Of this number, 27 points are the body's own statements and 2 belong 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.
create.restoreScrollPositions (cognitive 29) src/main/resources/web/chat/chat-mcp.js:433— create.restoreScrollPositions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9, error handling 1 (4 pts), ternaries 3 (4 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 11 belong to 4 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.
renderParamField (cognitive 29) src/main/resources/web/js/benchmark-v3.js:465— renderParamField has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 10, if/else 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loadAutoUnloadPolicy (cognitive 29) src/main/resources/web/js/model-action-modal.js:1197— loadAutoUnloadPolicy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 7 (8 pts), boolean chains 7, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1204, 1227, 1203). 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.
estimateVramAction (cognitive 29) src/main/resources/web/js/model-action-modal.js:1867— estimateVramAction has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 7 (9 pts), error handling 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 13 belong to 3 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.
EasyChatController.shouldUseGzip (cognitive 28) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:225— EasyChatController.shouldUseGzip has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, error handling 1 (4 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.
SystemController.handleRequest (cognitive 28) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:116— SystemController.handleRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 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.
ToolExecutionService.formatMcpToolResult (cognitive 28) src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:42— ToolExecutionService.formatMcpToolResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, 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.
index.html.loadConversationById (cognitive 28) src/main/resources/web/chat/index.html:5738— index.html.loadConversationById has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.generateAutoReply (cognitive 28) src/main/resources/web/chat/index.html:9780— index.html.generateAutoReply has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 8, error handling 1 (nesting depth added 3). Of this number, 25 points are the body's own statements and 3 belong to 2 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.
download.handleWebSocketMessage (cognitive 28) src/main/resources/web/js/download.js:139— download.handleWebSocketMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 7, error handling 1, match/switch 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.
settings.renderLlamaCppRelease (cognitive 28) src/main/resources/web/js/settings.js:156— settings.renderLlamaCppRelease has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
settings.testNode (cognitive 28) src/main/resources/web/js/settings.js:1047— settings.testNode has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 2 (4 pts), boolean chains 3, error handling 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.
mtp-bench.html.runDiff (cognitive 28) src/main/resources/web/tools/mtp-bench.html:811— mtp-bench.html.runDiff has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, ternaries 4 (9 pts), if/else 3 (4 pts), loops 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.
loadServerRecords (cognitive 28) src/main/resources/web/js/benchmark-v3.js:1132— loadServerRecords has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (8 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 27 points are the body's own statements and 1 belongs 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.
ModelActionController.handleLoadModelRequest (cognitive 27) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:935— ModelActionController.handleLoadModelRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, 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.
BuildTaskManager.applyLinuxCompilerPath (cognitive 27) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:737— BuildTaskManager.applyLinuxCompilerPath has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (4 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.
EasyChatService.proxySseStream (cognitive 27) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1660— EasyChatService.proxySseStream has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (26 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.
ToolchainChecker.tryVsWhere (cognitive 27) src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:272— ToolchainChecker.tryVsWhere has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (7 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigManager.mergeSharedIntoBundle (cognitive 27) src/main/java/org/mark/llamacpp/server/ConfigManager.java:534— ConfigManager.mergeSharedIntoBundle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, 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.
TavilySearchTool.parseSearchResponse (cognitive 27) src/main/java/org/mark/test/mcp/tavily/tools/TavilySearchTool.java:103— TavilySearchTool.parseSearchResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, 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.
model-list.toggleFavouriteModel (cognitive 27) src/main/resources/web/js/model-list.js:493— model-list.toggleFavouriteModel has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 18, if/else 6, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 514, 525, 498, …). 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.
settings.init (cognitive 27) src/main/resources/web/js/settings.js:2032— settings.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 1 (nesting depth added 2). Of this number, 21 points are the body's own statements and 6 belong to 4 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.
mtp-bench.html.updateRow (cognitive 27) src/main/resources/web/tools/mtp-bench.html:494— mtp-bench.html.updateRow has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 7 (11 pts), boolean chains 3, 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.
recordRowHtml (cognitive 27) REDACTED:277— recordRowHtml has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 6, boolean chains 4 (nesting depth added 1). Of this number, 21 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
download (cognitive 27) src/main/resources/web/js/newui/hf.js:277— download has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), ternaries 5 (6 pts), error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 12 belong to 4 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.
card (cognitive 27) src/main/resources/web/js/newui/models.js:146— card has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 19, boolean chains 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.
HuggingFaceSearcher.crawlGgufTargeted (cognitive 26) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:283— HuggingFaceSearcher.crawlGgufTargeted has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 pts), boolean chains 4, 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.
MtpHelper.serializeDonorKVs (cognitive 26) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:576— MtpHelper.serializeDonorKVs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (5 pts), boolean chains 3 (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.
ModelActionController.handleCloneCreateRequest (cognitive 26) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:802— ModelActionController.handleCloneCreateRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, boolean chains 8, error handling 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.
OpenAIService.handleOpenAIAudioTranscriptionsRequest (cognitive 26) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1268— OpenAIService.handleOpenAIAudioTranscriptionsRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, 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.
GPUInfoHelper.getMemoryInfo (cognitive 26) src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:340— GPUInfoHelper.getMemoryInfo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 1 (2 pts), ternaries 2, 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.
ToolchainChecker.checkSycl (cognitive 26) src/main/java/org/mark/llamacpp/server/tools/ToolchainChecker.java:138— ToolchainChecker.checkSycl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultMcpServiceImpl.doProcessRequest (cognitive 26) src/main/java/org/mark/test/mcp/DefaultMcpServiceImpl.java:177— DefaultMcpServiceImpl.doProcessRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (8 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-mcp.extractToolResultText (cognitive 26) src/main/resources/web/chat/chat-mcp.js:217— chat-mcp.extractToolResultText has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, ternaries 3 (4 pts), error handling 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 9 belong 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.
index.html.requestEphemeralStreamChat (cognitive 26) src/main/resources/web/chat/index.html:9239— index.html.requestEphemeralStreamChat has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, ternaries 3, 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.
openModelBenchmarkDialog (cognitive 26) src/main/resources/web/js/model-benchmark.js:1— openModelBenchmarkDialog has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 8, ternaries 8, if/else 7, error handling 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 90, a function literal at line 79, a function literal at line 82, …). 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.
render (cognitive 26) src/main/resources/web/js/newui/models.js:93— render has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 8, ternaries 4 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 96, 104, 118, …). 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.
init (cognitive 26) src/main/resources/web/js/newui/settings.js:7— init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, boolean chains 7, ternaries 3 (4 pts), error handling 2 (nesting depth added 1). None of this is in the body itself: all 26 points belong to 19 function literals inside it that branch (lines 36, 20, 9, …). 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.
renderTokenSummary (cognitive 26) src/main/resources/web/js/newui/usage-report.js:190— renderTokenSummary has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (8 pts), if/else 5 (6 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 214, 196, 248, …). 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.
FileDownloadRouterHandler.handleListDownloads (cognitive 25) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:341— FileDownloadRouterHandler.handleListDownloads has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaRouterHandler.handleApiRequest (cognitive 25) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:100— LlamaRouterHandler.handleApiRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 8, 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, 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.
McpClientService.fetchToolsFromSse (cognitive 25) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:439— McpClientService.fetchToolsFromSse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, 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.
McpClientService.getAllAvailableTools (cognitive 25) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:212— McpClientService.getAllAvailableTools has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, loops 2 (3 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.
McpClientService.upsertServer (cognitive 25) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:649— McpClientService.upsertServer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, ternaries 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BenchmarkService.generatePromptForTargetTokens (cognitive 25) src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:308— BenchmarkService.generatePromptForTargetTokens has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (4 pts), boolean chains 3, ternaries 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.
ChatStreamSession.resolveFromRemoteNodes (cognitive 25) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:381— ChatStreamSession.resolveFromRemoteNodes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.flushStateSave (cognitive 25) src/main/resources/web/chat/index.html:5821— index.html.flushStateSave has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (8 pts), boolean chains 1, 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.
index.html.updateAssistantMessage (cognitive 25) src/main/resources/web/chat/index.html:6902— index.html.updateAssistantMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5 (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.
index.html.consumeSse::processSseLine (cognitive 25) src/main/resources/web/chat/index.html:9465— index.html.consumeSse::processSseLine has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 4 (5 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. This shape REPEATS in the file: one other method here (index.html.consumeSse) 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.
settings.addModelPath (cognitive 25) src/main/resources/web/js/settings.js:1613— settings.addModelPath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 3, boolean chains 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.
normalizeLaunchConfigBundle (cognitive 25) src/main/resources/web/js/model-action-modal.js:491— normalizeLaunchConfigBundle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (9 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildBenchmarkCmdFromDynamicFields (cognitive 25) src/main/resources/web/js/model-benchmark.js:351— buildBenchmarkCmdFromDynamicFields has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 5 (7 pts), boolean chains 4, loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 4 belong 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.
exportRecords (cognitive 25) REDACTED:388— exportRecords has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 9, if/else 4 (nesting depth added 5). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 391, 405, 408, …). 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.
runBench (cognitive 25) REDACTED:444— runBench has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 3 (6 pts), 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.
buildCmd (cognitive 25) REDACTED:467— buildCmd has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 24 points are the body's own statements and 1 belongs 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.
load (cognitive 25) src/main/resources/web/js/newui/models.js:28— load has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, ternaries 6, if/else 5, error handling 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 37, 49, 45, …). 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.
check (cognitive 25) src/main/resources/web/js/newui/settings-update.js:31— check has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 6, ternaries 4, error handling 1. Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 35, 67). 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.
populate (cognitive 25) src/main/resources/web/js/newui/settings.js:131— populate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, 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.
EasyChatController.handleAvatarUpload (cognitive 24) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:309— EasyChatController.handleAvatarUpload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, error handling 3 (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.
ModelInfoController.handleRequest (cognitive 24) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:103— ModelInfoController.handleRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. 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.
ModelInfoController.handleSetModelAliasRequest (cognitive 24) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:465— ModelInfoController.handleSetModelAliasRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildTaskManager.executePhase (cognitive 24) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:228— BuildTaskManager.executePhase has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 4, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RemoteWebSocketClient.connect (cognitive 24) REDACTED:124— RemoteWebSocketClient.connect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 3 (5 pts), boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LlamaServerManager.handleFitParam (cognitive 24) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3283— LlamaServerManager.handleFitParam has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2, ternaries 2, 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.
index.html.openVideoLightbox (cognitive 24) src/main/resources/web/chat/index.html:2356— index.html.openVideoLightbox has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, if/else 6, ternaries 2. Of this number, 20 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.
index.html.buildStreamUserMessage (cognitive 24) src/main/resources/web/chat/index.html:8852— index.html.buildStreamUserMessage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, loops 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.
model-list.sortAndRenderModels (cognitive 24) src/main/resources/web/js/model-list.js:219— model-list.sortAndRenderModels has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, ternaries 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 11 belong to 2 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.
doExport (cognitive 24) src/main/resources/web/js/benchmark-v3.js:1371— doExport has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (8 pts), if/else 5 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1372, 1388, 1387, …). 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.
fetchDetailReadme (cognitive 24) src/main/resources/web/js/hf.js:737— fetchDetailReadme has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 4 (6 pts), 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.
renderModelList (cognitive 24) REDACTED:87— renderModelList has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 6 (7 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 99, 89, 96, …). 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.
HuggingFaceSearcher.fetchReadme (cognitive 23) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:154— HuggingFaceSearcher.fetchReadme has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, 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.
HuggingFaceSearcher.normalizeRepoId (cognitive 23) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:611— HuggingFaceSearcher.normalizeRepoId has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 2 (3 pts), error handling 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.
LlamaRouterHandler.forwardControlToRemote (cognitive 23) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:461— LlamaRouterHandler.forwardControlToRemote has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (6 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAIChatStreamingHandler.channelRead (cognitive 23) src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:59— OpenAIChatStreamingHandler.channelRead has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3, 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.
UnifiedBodyBuffer.findLastClosingBrace (cognitive 23) src/main/java/org/mark/llamacpp/server/service/UnifiedBodyBuffer.java:159— UnifiedBodyBuffer.findLastClosingBrace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 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.
CommandLineRunner.resolveByPathext (cognitive 23) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:962— CommandLineRunner.resolveByPathext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (7 pts), loops 2, 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.
CommandLineRunner.resolveExecutablePath (cognitive 23) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:922— CommandLineRunner.resolveExecutablePath has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, 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.
JsonUtil.ensureToolCallIdsInArray (cognitive 23) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:351— JsonUtil.ensureToolCallIdsInArray has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.canFitModelInMemory (cognitive 23) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3362— LlamaServerManager.canFitModelInMemory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, ternaries 5 (7 pts), boolean chains 4, 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, 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.
index.html.flushStreamingMarkdown (cognitive 23) src/main/resources/web/chat/index.html:1846— index.html.flushStreamingMarkdown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.getAssistantModelName (cognitive 23) src/main/resources/web/chat/index.html:3419— index.html.getAssistantModelName has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
model-action-modal.splitCmdArgs (cognitive 23) src/main/resources/web/js/model-action-modal.js:191— model-action-modal.splitCmdArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 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.
model-action-modal.buildAllowedBareTokenSetFromParamConfig (cognitive 23) src/main/resources/web/js/model-action-modal.js:266— model-action-modal.buildAllowedBareTokenSetFromParamConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 pts), boolean chains 5, loops 2 (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.
usage-report.drawBarsChart (cognitive 23) src/main/resources/web/js/usage-report.js:186— usage-report.drawBarsChart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
bindModelSamplingSamplersField::onclick (cognitive 23) src/main/resources/web/js/model-detail.js:669— bindModelSamplingSamplersField::onclick has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, 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, 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.
updateModelSamplingConfig (cognitive 23) src/main/resources/web/js/model-detail.js:974— updateModelSamplingConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 5). 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 literals inside it that branch (lines 997, 996, 1009). 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.
drawBarsChart (cognitive 23) src/main/resources/web/js/newui/usage-report.js:466— drawBarsChart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
SimpleHttpDownloader.downloadRange (cognitive 22) src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:266— SimpleHttpDownloader.downloadRange has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2, 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.
FileDownloadRouterHandler.inferContentType (cognitive 22) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:942— FileDownloadRouterHandler.inferContentType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 4. 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.
EasyChatController.handleBackgroundUpload (cognitive 22) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:459— EasyChatController.handleBackgroundUpload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 3 (4 pts), boolean chains 3, 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.
LlamacppController.proxyRawBytes (cognitive 22) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1063— LlamacppController.proxyRawBytes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelActionController.loadLocalModel (cognitive 22) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1027— ModelActionController.loadLocalModel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 8, 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.
ModelSamplingService.readStringArray (cognitive 22) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:778— ModelSamplingService.readStringArray has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, ternaries 2 (4 pts), 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.
LlamaServerManager.resolveModelType (cognitive 22) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:526— LlamaServerManager.resolveModelType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5, boolean chains 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.
index.html.normalizeConversationMessage (cognitive 22) src/main/resources/web/chat/index.html:3718— index.html.normalizeConversationMessage has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 16, if/else 3 (4 pts), boolean chains 2 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.html.deleteMessage (cognitive 22) src/main/resources/web/chat/index.html:8412— index.html.deleteMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (5 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 16 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.
model-action-modal.enforceModelCapabilitiesRules (cognitive 22) src/main/resources/web/js/model-action-modal.js:931— model-action-modal.enforceModelCapabilitiesRules has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 10 (11 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.
model-action-modal.getCurrentModelById (cognitive 22) src/main/resources/web/js/model-action-modal.js:1239— model-action-modal.getCurrentModelById has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mtp-bench.html.formatResultsAsText (cognitive 22) src/main/resources/web/tools/mtp-bench.html:877— mtp-bench.html.formatResultsAsText has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 8, if/else 1, loops 1 (nesting depth added 5). Of this number, 21 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.
applyTranslations (cognitive 22) src/main/resources/web/js/i18n.js:69— applyTranslations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 86, t, a function literal at line 113, …). 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.
applyLaunchConfigToModal::tryApply (cognitive 22) src/main/resources/web/js/model-action-modal.js:680— applyLaunchConfigToModal::tryApply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, ternaries 1 (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.
saveModelConfigAction (cognitive 22) src/main/resources/web/js/model-action-modal.js:1804— saveModelConfigAction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, ternaries 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1828, 1844, 1828). 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.
deleteModelSamplingConfig (cognitive 22) src/main/resources/web/js/model-detail.js:1014— deleteModelSamplingConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1033, 1032, 1050). 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.
renderSources (cognitive 22) src/main/resources/web/js/newui/logs.js:83— renderSources has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 4 (6 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 108, 88, 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.
EasyChatStreamingHandler.channelRead (cognitive 21) src/main/java/org/mark/llamacpp/server/channel/EasyChatStreamingHandler.java:50— EasyChatStreamingHandler.channelRead has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 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.
EasyChatService.handleGenerateTitle (cognitive 21) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1172— EasyChatService.handleGenerateTitle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 3, error handling 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.
EasyChatService.resolveModelTarget (cognitive 21) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1092— EasyChatService.resolveModelTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 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.
OpenAIService.streamRawProxyResponse (cognitive 21) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:841— OpenAIService.streamRawProxyResponse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 3, 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.
StreamingForwarder.handleStringValue (cognitive 21) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:371— StreamingForwarder.handleStringValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParamTool.handleOpenAIChatThinking (cognitive 21) src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:267— ParamTool.handleOpenAIChatThinking has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (4 pts), boolean chains 3 (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.
index.html.updateInteractionLockState (cognitive 21) src/main/resources/web/chat/index.html:5572— index.html.updateInteractionLockState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 pts), boolean chains 3, 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.
download.renderDownloadsList::getDownloadCreatedAtMs (cognitive 21) src/main/resources/web/js/download.js:230— download.renderDownloadsList::getDownloadCreatedAtMs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 5 (9 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.
model-action-modal.sanitizeExtraParamTokens (cognitive 21) src/main/resources/web/js/model-action-modal.js:293— model-action-modal.sanitizeExtraParamTokens has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (7 pts), boolean chains 5, 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.
perplexity.html.renderModelList (cognitive 21) src/main/resources/web/tools/perplexity.html:510— perplexity.html.renderModelList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 belong 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.
submitCreateDownload (cognitive 21) src/main/resources/web/js/download.js:588— submitCreateDownload has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, ternaries 6 (7 pts), if/else 6, error handling 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 6 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.
renderBenchmarkParamsContainer (cognitive 21) src/main/resources/web/js/model-benchmark.js:242— renderBenchmarkParamsContainer has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 6 belong to 2 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.
viewModelDetails (cognitive 21) src/main/resources/web/js/model-detail.js:1— viewModelDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 2 (5 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 6, 4, 5, …). 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.
fillLlamaCppTestModal (cognitive 21) src/main/resources/web/js/settings.js:1973— fillLlamaCppTestModal has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 7, if/else 1 (nesting depth added 1). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
hfGroupGgufFiles (cognitive 21) src/main/resources/web/js/newui/hf.js:357— hfGroupGgufFiles has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 5 (nesting depth added 1). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 360, 382, 380, …). 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.
loadConfigPane (cognitive 21) src/main/resources/web/js/newui/model-detail.js:101— loadConfigPane has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, error handling 2 (3 pts), if/else 3 (nesting depth added 6). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 106, 104, 105, …). 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.
savePathSheet (cognitive 21) src/main/resources/web/js/newui/settings-nodes.js:190— savePathSheet has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 3). Of this number, 13 points are the body's own statements and 8 belong to 4 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.
NettyHttpDownloader.executeStreamDownload (cognitive 20) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:416— NettyHttpDownloader.executeStreamDownload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 5 (7 pts), error handling 3, 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.
HuggingFaceSearcher.detectReadmePath (cognitive 20) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:340— HuggingFaceSearcher.detectReadmePath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, 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.
BasicRouterHandler.handleModelProps (cognitive 20) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:366— BasicRouterHandler.handleModelProps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (20 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.
FileDownloadRouterHandler.createAndStartLlamaCppTask (cognitive 20) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:734— FileDownloadRouterHandler.createAndStartLlamaCppTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaRouterHandler.forwardControlToLocal (cognitive 20) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:396— LlamaRouterHandler.forwardControlToLocal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 3 (4 pts), loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputerService.getCPUModel (cognitive 20) src/main/java/org/mark/llamacpp/server/service/ComputerService.java:28— ComputerService.getCPUModel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, error handling 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.
LlamaRecordService.extractJsonObjectValue (cognitive 20) src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:434— LlamaRecordService.extractJsonObjectValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 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.
PerplexityService.sendJsonLine (cognitive 20) src/main/java/org/mark/llamacpp/server/service/PerplexityService.java:476— PerplexityService.sendJsonLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParamTool.splitCmdArgs (cognitive 20) src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:142— ParamTool.splitCmdArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 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.
ProxyConfig.parse (cognitive 20) src/main/java/org/mark/project/tools/proxy/ProxyConfig.java:19— ProxyConfig.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (3 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.
index.html.populateSettingsModelSelects (cognitive 20) src/main/resources/web/chat/index.html:3271— index.html.populateSettingsModelSelects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.uploadAssistantAvatar (cognitive 20) src/main/resources/web/chat/index.html:4115— index.html.uploadAssistantAvatar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 2, error handling 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.
index.html.renderModelMenu (cognitive 20) src/main/resources/web/chat/index.html:4823— index.html.renderModelMenu has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 belong to 2 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.
index.html.buildFragmentPayload (cognitive 20) src/main/resources/web/chat/index.html:8902— index.html.buildFragmentPayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 6 (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.
model-action-modal.switchParamMode (cognitive 20) src/main/resources/web/js/model-action-modal.js:1306— model-action-modal.switchParamMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, 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.
model-detail.normalizeModelSamplingStringArray::splitText (cognitive 20) src/main/resources/web/js/model-detail.js:353— model-detail.normalizeModelSamplingStringArray::splitText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 1, ternaries 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.
llama-build.html.checkToolchain (cognitive 20) src/main/resources/web/tools/llama-build.html:1399— llama-build.html.checkToolchain has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 4, error handling 1, if/else 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.
setLogFilter (cognitive 20) src/main/resources/web/js/console-modal.js:67— setLogFilter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 5). Of this number, 13 points are the body's own statements and 7 belong to 4 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.
openModelDetailTab (cognitive 20) src/main/resources/web/js/model-detail.js:248— openModelDetailTab has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 7 (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyUpdate (cognitive 20) src/main/resources/web/js/settings.js:1320— applyUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), boolean chains 3, 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.
applyModelPatch (cognitive 20) src/main/resources/web/js/websocket.js:134— applyModelPatch has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 8, error handling 1, ternaries 1. Of this number, 12 points are the body's own statements and 8 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.
renderDailyChart (cognitive 20) src/main/resources/web/js/newui/usage-report.js:391— renderDailyChart has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 3 (4 pts), loops 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (onmousemove, a function literal at line 419, labelFn, …). 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.
ModelPathController.ensureModelPathConfigInitialized (cognitive 19) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:418— ModelPathController.ensureModelPathConfigInitialized has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (3 pts), error handling 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.
PerplexityController.handleRecordByFilename (cognitive 19) src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java:369— PerplexityController.handleRecordByFilename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 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.
AnthropicService.handleMessagesCountTokensRequest (cognitive 19) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:204— AnthropicService.handleMessagesCountTokensRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatRequestStreamingTransformer.copyComposite (cognitive 19) src/main/java/org/mark/llamacpp/server/service/ChatRequestStreamingTransformer.java:258— ChatRequestStreamingTransformer.copyComposite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatStreamSession.resolveLocalModelUrl (cognitive 19) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:331— ChatStreamSession.resolveLocalModelUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (3 pts), error handling 2 (nesting depth added 9). 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.
ChatStreamSession.run (cognitive 19) src/main/java/org/mark/llamacpp/server/service/ChatStreamSession.java:198— ChatStreamSession.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 5, 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.
GGufMetaDataExtractor.downloadHeader (cognitive 19) src/main/java/org/mark/llamacpp/server/tools/GGufMetaDataExtractor.java:306— GGufMetaDataExtractor.downloadHeader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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.
JsonUtil.getJsonStringList (cognitive 19) src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:234— JsonUtil.getJsonStringList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, error handling 2 (4 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.
LlamaServerManager.checkAndAutoUnload (cognitive 19) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1008— LlamaServerManager.checkAndAutoUnload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, 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.
LlamaServerManager.loadModelAsyncFromCmd (cognitive 19) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2049— LlamaServerManager.loadModelAsyncFromCmd has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 6, boolean chains 3, 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.
NettyWebServer.initHttpsContext (cognitive 19) src/main/java/org/mark/llamacpp/server/NettyWebServer.java:132— NettyWebServer.initHttpsContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts), ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GetModelPathTool.ensureModelPathConfigInitialized (cognitive 19) src/main/java/org/mark/test/mcp/tools/GetModelPathTool.java:73— GetModelPathTool.ensureModelPathConfigInitialized has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (3 pts), error handling 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.
index.html.renderHwStat (cognitive 19) src/main/resources/web/chat/index.html:5445— index.html.renderHwStat has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 6, ternaries 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.
index.html.buildStreamChatHeaders (cognitive 19) src/main/resources/web/chat/index.html:8653— index.html.buildStreamChatHeaders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 4 (5 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.
index.html.consumeEphemeralSse::processSseLine (cognitive 19) src/main/resources/web/chat/index.html:9315— index.html.consumeEphemeralSse::processSseLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, ternaries 4 (5 pts), boolean chains 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.
llama-build.html.restoreActiveTask (cognitive 19) src/main/resources/web/tools/llama-build.html:1306— llama-build.html.restoreActiveTask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, error handling 2 (nesting depth added 1). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
fetchDetailGguf (cognitive 19) src/main/resources/web/js/hf.js:851— fetchDetailGguf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 3 (4 pts), 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.
normalizeModelConfigBundle (cognitive 19) src/main/resources/web/js/model-detail.js:294— normalizeModelConfigBundle has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (7 pts), if/else 2, loops 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.
testLlamaCpp (cognitive 19) src/main/resources/web/js/settings.js:1996— testLlamaCpp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 pts), boolean chains 5, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleModelLoadEvent (cognitive 19) src/main/resources/web/js/websocket.js:170— handleModelLoadEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 5 (6 pts), boolean chains 2, loops 1 (2 pts), other 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.
fetchGguf (cognitive 19) src/main/resources/web/js/newui/hf.js:164— fetchGguf has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 172, 183, 191, …). 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.
HuggingFaceSearcher.collectHits (cognitive 18) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:243— HuggingFaceSearcher.collectHits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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.
BinaryRequestLog.migrateV1toV2 (cognitive 18) src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:424— BinaryRequestLog.migrateV1toV2 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamacppController.handleLlamaCppTest (cognitive 18) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:573— LlamacppController.handleLlamaCppTest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (2 pts), 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.
ModelActionController.findNodeByLoadedModel (cognitive 18) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1890— ModelActionController.findNodeByLoadedModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), error handling 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. This shape REPEATS in the file: one other method here (ModelActionController.findNodeByModel) 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.
ModelActionController.findNodeByModel (cognitive 18) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1917— ModelActionController.findNodeByModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), error handling 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. This shape REPEATS in the file: one other method here (ModelActionController.findNodeByLoadedModel) 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.
SystemController.handleModelSamplingSettingAddRequest (cognitive 18) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1086— SystemController.handleModelSamplingSettingAddRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1 (2 pts), 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.
EasyChatRequestWriter.readClientEnableThinking (cognitive 18) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:193— EasyChatRequestWriter.readClientEnableThinking has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsoupCliHelper.fetchPage (cognitive 18) src/main/java/org/mark/llamacpp/server/tools/JsoupCliHelper.java:136— JsoupCliHelper.fetchPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 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.
GetModelsTool.buildResponse (cognitive 18) src/main/java/org/mark/test/mcp/tools/GetModelsTool.java:58— GetModelsTool.buildResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 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.
index.html.ensureServerStateReady (cognitive 18) src/main/resources/web/chat/index.html:5631— index.html.ensureServerStateReady has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 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.
index.html.loadState (cognitive 18) src/main/resources/web/chat/index.html:5926— index.html.loadState has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.pushMessage (cognitive 18) src/main/resources/web/chat/index.html:6829— index.html.pushMessage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9, if/else 5, boolean chains 4. 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.
index.html.initOrderedMultiSelects (cognitive 18) src/main/resources/web/index.html:5665— index.html.initOrderedMultiSelects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7 (nesting depth added 1). 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 5678, 5667). 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.
hf.selectRepo (cognitive 18) src/main/resources/web/js/hf.js:896— hf.selectRepo has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 4, 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.
model-action-modal.buildPersistableLaunchConfig (cognitive 18) src/main/resources/web/js/model-action-modal.js:608— model-action-modal.buildPersistableLaunchConfig has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, boolean chains 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.
model-action-modal.renderMainGpuSelect (cognitive 18) src/main/resources/web/js/model-action-modal.js:2054— model-action-modal.renderMainGpuSelect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 5). Of this number, 17 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.
settings.updateAssetProgress (cognitive 18) src/main/resources/web/js/settings.js:283— settings.updateAssetProgress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
benchmark-v2.html.deleteBenchmarkRecord (cognitive 18) src/main/resources/web/tools/benchmark-v2.html:652— benchmark-v2.html.deleteBenchmarkRecord has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, ternaries 4 (6 pts), if/else 5, 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.
create.executeToolCalls (cognitive 18) src/main/resources/web/chat/chat-mcp.js:1064— create.executeToolCalls has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, ternaries 2 (5 pts), if/else 2 (4 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.
showBenchOutput (cognitive 18) src/main/resources/web/js/benchmark-v3.js:904— showBenchOutput has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 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.
updateDetailGgufToolbar (cognitive 18) src/main/resources/web/js/hf.js:770— updateDetailGgufToolbar has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 7 (8 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.
getParamOptionValues (cognitive 18) src/main/resources/web/js/model-action-modal.js:250— getParamOptionValues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 pts), boolean chains 5, 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.
fitParamsApplyAction (cognitive 18) src/main/resources/web/js/model-action-modal.js:1979— fitParamsApplyAction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 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.
deleteModelChatTemplate (cognitive 18) src/main/resources/web/js/model-detail.js:1161— deleteModelChatTemplate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1175, 1174, 1190). 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.
testProxyConnection (cognitive 18) src/main/resources/web/js/settings.js:2220— testProxyConnection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 4, error handling 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 9 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.
Request.executeSingle (cognitive 17) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:350— Request.executeSingle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 4 (5 pts), error handling 4, boolean chains 3 (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.
DownloadToFileRequest.executeAsync (cognitive 17) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:925— DownloadToFileRequest.executeAsync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 4 (5 pts), 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.
BasicRouterHandler.handleTools (cognitive 17) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:733— BasicRouterHandler.handleTools has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, 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.
LlamacppController.handleLlamaCppAdd (cognitive 17) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:166— LlamacppController.handleLlamaCppAdd has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 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.
LlamacppController.handleTokenizeRequest (cognitive 17) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:794— LlamacppController.handleTokenizeRequest 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.
ModelActionController.handleModelBenchmarkList (cognitive 17) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1374— ModelActionController.handleModelBenchmarkList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 1 (3 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.
ProxyController.handleProxyTest (cognitive 17) src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:195— ProxyController.handleProxyTest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 5, error handling 2, ternaries 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.
SystemController.handleAutoStartRequest (cognitive 17) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2031— SystemController.handleAutoStartRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 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.
BuildTaskManager.applyLinuxRuntimePath (cognitive 17) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:700— BuildTaskManager.applyLinuxRuntimePath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 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.
BuildTaskManager.hasCudartDlls (cognitive 17) src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:681— BuildTaskManager.hasCudartDlls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1, 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.
EasyChatRequestWriter.writeExtraFields (cognitive 17) src/main/java/org/mark/llamacpp/server/service/EasyChatRequestWriter.java:118— EasyChatRequestWriter.writeExtraFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 1 (2 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.
EasyChatService.parseTitleFromResponse (cognitive 17) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1322— EasyChatService.parseTitleFromResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 1 (3 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.
ModelSamplingService.loadSelectedSamplingMap (cognitive 17) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:272— ModelSamplingService.loadSelectedSamplingMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), error handling 2 (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.
ModelSamplingService.parseJsonStringArray (cognitive 17) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:854— ModelSamplingService.parseJsonStringArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 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.
OpenAIService.resolveAudioTranscriptionModel (cognitive 17) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1343— OpenAIService.resolveAudioTranscriptionModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (3 pts), boolean chains 2, 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.
PerplexityService.parseDevices (cognitive 17) src/main/java/org/mark/llamacpp/server/service/PerplexityService.java:515— PerplexityService.parseDevices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingForwarder.hasPartialKeyTail (cognitive 17) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:690— StreamingForwarder.hasPartialKeyTail has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 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.
UsageReportService.getDailyTokenUsage (cognitive 17) src/main/java/org/mark/llamacpp/server/service/UsageReportService.java:204— UsageReportService.getDailyTokenUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandLineRunner.addWindowsCudartDirs (cognitive 17) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:519— CommandLineRunner.addWindowsCudartDirs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts), 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.
CommandLineRunner.executeInternal (cognitive 17) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:127— CommandLineRunner.executeInternal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 6, boolean chains 2, loops 2 (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.
CommandLineRunner.hasCudartDlls (cognitive 17) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:560— CommandLineRunner.hasCudartDlls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1, 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.
LlamaCppProcess.hasCudartDlls (cognitive 17) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:429— LlamaCppProcess.hasCudartDlls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1, 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.
LlamaServerManager.handleListDevices (cognitive 17) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3026— LlamaServerManager.handleListDevices has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 3 (6 pts), boolean chains 2, 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.
ApplicationConfigTool.execute (cognitive 17) src/main/java/org/mark/test/mcp/tools/others/ApplicationConfigTool.java:43— ApplicationConfigTool.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (3 pts), boolean chains 2, 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.
index.html.consumeSse (cognitive 17) src/main/resources/web/chat/index.html:9435— index.html.consumeSse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 8, ternaries 6 (7 pts), loops 3 (5 pts), error handling 1 (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. This shape REPEATS in the file: one other method here (index.html.consumeSse::processSseLine) 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.
index.html.bindEvents::closeAudioRecorderModal (cognitive 17) src/main/resources/web/chat/index.html:10509— index.html.bindEvents::closeAudioRecorderModal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 2 (6 pts), boolean chains 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. This shape REPEATS in the file: one other method here (index.html.bindEvents) 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.
index.html.bindEvents (cognitive 17) src/main/resources/web/chat/index.html:10364— index.html.bindEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 128 (156 pts), boolean chains 28, error handling 6 (10 pts), loops 7 (8 pts), ternaries 3 (6 pts) (nesting depth added 36). 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. This shape REPEATS in the file: one other method here (index.html.bindEvents::closeAudioRecorderModal) 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.
benchmark-v3.hwFallback (cognitive 17) src/main/resources/web/js/benchmark-v3.js:1111— benchmark-v3.hwFallback has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
benchmark-v3.renderChart (cognitive 17) src/main/resources/web/js/benchmark-v3.js:1310— benchmark-v3.renderChart has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 3). Of this number, 16 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.
console-modal.renderRemoteFiltered (cognitive 17) src/main/resources/web/js/console-modal.js:126— console-modal.renderRemoteFiltered has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 1, ternaries 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.
hf.showDetail (cognitive 17) src/main/resources/web/js/hf.js:572— hf.showDetail has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 15 points are the body's own statements and 2 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.
model-benchmark.appendBenchmarkResultBlock (cognitive 17) src/main/resources/web/js/model-benchmark.js:647— model-benchmark.appendBenchmarkResultBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 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.
settings.saveNodeForm (cognitive 17) src/main/resources/web/js/settings.js:972— settings.saveNodeForm has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 4, boolean chains 3, 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.
benchmark-v2.html.withHardwareFallback (cognitive 17) src/main/resources/web/tools/benchmark-v2.html:610— benchmark-v2.html.withHardwareFallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mtp-bench.html.setAggregateRow (cognitive 17) src/main/resources/web/tools/mtp-bench.html:523— mtp-bench.html.setAggregateRow has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 3, boolean chains 2, loops 1 (nesting depth added 3). Of this number, 16 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.
loadModelSamplingSettings (cognitive 17) src/main/resources/web/js/model-detail.js:861— loadModelSamplingSettings has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 5, if/else 2, error handling 1. Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 873, 870, 871, …). 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.
addLlamaCpp (cognitive 17) src/main/resources/web/js/settings.js:1798— addLlamaCpp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (5 pts), error handling 2 (3 pts), boolean chains 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.
paramInputHtml (cognitive 17) REDACTED:638— paramInputHtml has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 2 (nesting depth added 3). 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 643). 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.
fetchReadme (cognitive 17) src/main/resources/web/js/newui/hf.js:235— fetchReadme has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 243, 253, 258, …). 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.
onConsoleMsg (cognitive 17) src/main/resources/web/js/newui/logs.js:171— onConsoleMsg has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 4, error handling 1 (2 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 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.
tokenize (cognitive 17) REDACTED:502— tokenize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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.
DownloadTaskManager.startTask (cognitive 16) src/main/java/org/mark/file/downloader/DownloadTaskManager.java:120— DownloadTaskManager.startTask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 4, boolean chains 1, ternaries 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.
NettyHttpDownloader.executeProbeRequest (cognitive 16) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:315— NettyHttpDownloader.executeProbeRequest has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 3 (4 pts), error handling 3, boolean chains 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.
MtpHelper.toJsonElement (cognitive 16) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:621— MtpHelper.toJsonElement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 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.
BasicRouterHandler.forwardLoadModelToRemote (cognitive 16) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:621— BasicRouterHandler.forwardLoadModelToRemote has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (5 pts), if/else 4, loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoLoadPolicyController.handleResetPolicy (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:176— AutoLoadPolicyController.handleResetPolicy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, error handling 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.
CertController.handleDownload (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/CertController.java:101— CertController.handleDownload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 2, error handling 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatStateController.handleDeleteRequest (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:211— ChatStateController.handleDeleteRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EasyChatController.handleRequest (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:103— EasyChatController.handleRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 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.
ModelPathController.normalizePathForCompare (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:577— ModelPathController.normalizePathForCompare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, error handling 1, loops 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.
SystemController.handleModelSamplingSettingRequest (cognitive 16) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:942— SystemController.handleModelSamplingSettingRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 1, error handling 1, ternaries 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.
NettyWriteHelper.waitUntilWritable (cognitive 16) src/main/java/org/mark/llamacpp/server/io/NettyWriteHelper.java:22— NettyWriteHelper.waitUntilWritable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
McpClientService.initializeFromRegistry (cognitive 16) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:96— McpClientService.initializeFromRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 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.
AnthropicService.forwardRequestToLlamaCpp (cognitive 16) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:279— AnthropicService.forwardRequestToLlamaCpp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 3, error handling 2, loops 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.
AnthropicService.handleNonStreamResponse (cognitive 16) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:353— AnthropicService.handleNonStreamResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), error handling 1 (2 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.
ModelSamplingService.writeSelectedSamplingMap (cognitive 16) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:238— ModelSamplingService.writeSelectedSamplingMap has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 3 (5 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.
OpenAIService.handleNonStreamResponse (cognitive 16) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1502— OpenAIService.handleNonStreamResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GPUInfoHelper.init (cognitive 16) src/main/java/org/mark/llamacpp/server/tools/GPUInfoHelper.java:57— GPUInfoHelper.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 1, error handling 1, ternaries 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.
LlamaServerManager.buildModelStatus (cognitive 16) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1516— LlamaServerManager.buildModelStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 2 (6 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlamaServerManager.splitSpecType (cognitive 16) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2697— LlamaServerManager.splitSpecType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, 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.
ProxyFrontendHandler.handleHttpProxy (cognitive 16) src/main/java/org/mark/project/tools/proxy/ProxyFrontendHandler.java:150— ProxyFrontendHandler.handleHttpProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 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.
chat-mcp.create (cognitive 16) src/main/resources/web/chat/chat-mcp.js:278— chat-mcp.create has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.html.wrapHtmlCodeBlocks (cognitive 16) src/main/resources/web/chat/index.html:1406— index.html.wrapHtmlCodeBlocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 2 belong 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.
index.html.extractMediaFromContent (cognitive 16) src/main/resources/web/chat/index.html:3042— index.html.extractMediaFromContent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.html.document.addEventListener("click") (cognitive 16) src/main/resources/web/index.html:6011— index.html.document.addEventListener("click") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
index.html.loadCompatServiceStatus (cognitive 16) src/main/resources/web/index.html:6168— index.html.loadCompatServiceStatus has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 5, ternaries 2 (5 pts), error handling 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.
download.updateDownloadItem (cognitive 16) src/main/resources/web/js/download.js:376— download.updateDownloadItem has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 2 (3 pts) (nesting depth added 1). 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, 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.
hf.mergeHits (cognitive 16) src/main/resources/web/js/hf.js:154— hf.mergeHits has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 4, if/else 2 (4 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.
hf.getGroupTotalSize (cognitive 16) src/main/resources/web/js/hf.js:359— hf.getGroupTotalSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 3, 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.
model-list.renderSlotsSquaresInner (cognitive 16) src/main/resources/web/js/model-list.js:462— model-list.renderSlotsSquaresInner has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 2 (3 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
llama-build.html.appendConsole (cognitive 16) src/main/resources/web/tools/llama-build.html:1032— llama-build.html.appendConsole has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 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.
mcp-manager.html.renderTools (cognitive 16) src/main/resources/web/tools/mcp-manager.html:597— mcp-manager.html.renderTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 1 (3 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 4). 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, 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.
perplexity.html.viewRecord (cognitive 16) src/main/resources/web/tools/perplexity.html:1046— perplexity.html.viewRecord has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 3, loops 1 (2 pts), ternaries 1 (2 pts), error handling 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.
renderBenchParams (cognitive 16) src/main/resources/web/js/benchmark-v3.js:548— renderBenchParams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 14 points are the body's own statements and 2 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.
loadAutoLoadPolicy (cognitive 16) src/main/resources/web/js/model-action-modal.js:1092— loadAutoLoadPolicy has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6, boolean chains 5, if/else 3 (4 pts), error handling 1 (nesting depth added 1). Of this number, 8 points are the body's own statements and 8 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.
loadModelChatTemplate (cognitive 16) src/main/resources/web/js/model-detail.js:1076— loadModelChatTemplate has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (4 pts), if/else 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1085, 1084, 1097). 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.
loadModelDefaultChatTemplate (cognitive 16) src/main/resources/web/js/model-detail.js:1102— loadModelDefaultChatTemplate has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1110, 1109, 1121). 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.
saveModelChatTemplate (cognitive 16) src/main/resources/web/js/model-detail.js:1126— saveModelChatTemplate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 6 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.
renderBuildInfo (cognitive 16) src/main/resources/web/js/model-list.js:26— renderBuildInfo has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 5, if/else 4. 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.
loadRecords (cognitive 16) REDACTED:242— loadRecords has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 3 (4 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 247, 263, 257, …). 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.
renderTokenChart (cognitive 16) src/main/resources/web/js/newui/usage-report.js:320— renderTokenChart has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), loops 2, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (onmousemove, a function literal at line 347, a function literal at line 338, …). 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.
D4 · Code Duplication· Near-duplicate member family (11 members, 16 shared lines) · ×1
Near-duplicate member family (11 members, 16 shared lines) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:305— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:305-338 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:465-539 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:734-779 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:781-832 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:853-890 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1019-1070 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1079-1115 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1214-1248 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1256-1293 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1333-1366 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1375-1409 — These 11 members are variants of one another: a block of 16 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 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· Near-duplicate member family (4 members, 31 shared lines) · ×1
Near-duplicate member family (4 members, 31 shared lines) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:312— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:312-414 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:421-517 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:975-1079 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1086-1198 — These 4 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 34 shared lines) · ×1
Near-duplicate member family (3 members, 34 shared lines) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:626— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:626-685 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:687-732 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:734-808 — These 3 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 24 shared lines) · ×1
Near-duplicate member family (3 members, 24 shared lines) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:402— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:402-433 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:588-619 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:363-394 — These 3 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (65 shared lines) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:467— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:467-600 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1569-1720 — These two members are variants of one another: 65 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 (61 shared lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:667— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:667-741 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:1075-1148 — These two members are variants of one another: 61 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 (58 shared lines) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374-456 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:99-233 — These two members are variants of one another: 58 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 (43 shared lines) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:794— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:794-856 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:864-923 — These two members are variants of one another: 43 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 (36 shared lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:316— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:316-387 | src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:417-501 — These two members are variants of one another: 36 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 (31 shared lines) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1641— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1641-1743 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1764-1840 — These two members are variants of one another: 31 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 (25 shared lines) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:166— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:166-235 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:126-221 — These two members are variants of one another: 25 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 (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:435— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:435-481 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:483-523 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:621-684 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1653-1717 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1726-1790 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:353-406 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2159-2169 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:631-787 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1502-1567 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Edited copy of a member (133 corresponding lines) · ×1
Edited copy of a member (133 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:103— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:103-235 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:116-277 — These two members are one piece of code written twice and then edited apart: 133 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 (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:309— src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:309-383 | src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:459-528 — These two members are one piece of code written twice and then edited apart: 70 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 (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:396— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:396-459 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:461-530 — These two members are one piece of code written twice and then edited apart: 64 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 (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:942— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:942-1007 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1086-1137 — These two members are one piece of code written twice and then edited apart: 52 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) · ×1
Edited copy of a member (63 corresponding lines) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:755— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:755-824 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1183-1245 — 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1555— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1555-1594 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1603-1643 — 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 (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:11— src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:11-45 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:536-572 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:371— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:371-401 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:471-500 — 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:759— src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:759-799 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:801-846 — 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 (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:429— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:429-461 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:560-592 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) src/main/java/org/mark/llamacpp/server/controller/BuildController.java:197— src/main/java/org/mark/llamacpp/server/controller/BuildController.java:197-233 | src/main/java/org/mark/llamacpp/server/controller/BuildController.java:327-357 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:344— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:344-369 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:609-632 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:444-469 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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 (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) src/main/java/org/mark/llamacpp/server/ConfigManager.java:654— src/main/java/org/mark/llamacpp/server/ConfigManager.java:654-682 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:700-728 — 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 copies of one member (4 members, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1428— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1428-1453 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1455-1478 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1758-1782 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1829-1854 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1893— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1893-1929 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1937-1963 — 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 (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:222— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:222-247 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:379-402 — 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 copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:346— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:346-363 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:606-628 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:834-851 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1183-1205 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:305— src/main/java/org/mark/llamacpp/gguf/GGUFMetaData.java:305-342 | src/main/java/org/mark/llamacpp/gguf/GgufReader.java:187-224 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:523— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:523-536 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:79-91 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:90-102 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1617-1632 — 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, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:193— src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:193-210 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:216-229 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:238-249 — 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.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:150— src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:150-163 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:121-136 — 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 (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:251— src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:251-258 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:274-281 — 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, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:650— src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:650-655 | src/main/java/org/mark/llamacpp/crawler/HuggingFaceSearcher.java:657-662 | src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:158-171 — 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, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:616— src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:616-627 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:629-640 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:642-653 | src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:655-666 — 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 (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:891— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:891-900 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:902-911 | src/main/java/org/mark/llamacpp/server/service/LlamaRecordService.java:504-513 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:83-91 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 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.
Duplicated block (82 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:143— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:143-224 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:80-161 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30–36 lines × 2) src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:213— src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java:213-242 | src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:344-379 — 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 `src/main/java/org/mark/llamacpp/server/websocket/WebSocketManager.java:344` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (35 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:992— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:992-1026 | src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:419-453 — before extracting anything, compare `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java` and `src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 340 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (30–32 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:816— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:816-845 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:949-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 `src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:816` 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 (55 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1655— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1655-1709 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1728-1782 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1655` 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 (32 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:850— src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:850-881 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:986-1017 — both copies are in the same file, so extract the 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 (28 lines × 3) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:586— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:586-613 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:637-664 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1391-1418 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:586` 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 (27–28 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:984— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:984-1010 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1095-1122 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:984` 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 (23–24 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:169— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:169-191 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:517-540 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:168` calls `getPath` and `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:516` 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 (22 lines × 3) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:944— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:944-965 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1088-1109 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1141-1162 — 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 `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:944` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–22 lines × 2) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:375— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:375-384 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:970-991 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:908— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:908-928 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1131-1152 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:908` 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 (28–30 lines × 2) src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:250— src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:250-279 | src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java:405-432 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14–21 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3163— src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3163-3176 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3230-3243 | src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:3328-3348 — 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 (19–21 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:488— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:488-506 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1598-1618 — 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:488` 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 (18–20 lines × 4) src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:394— src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:394-413 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:444-461 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:485-502 | src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:526-543 — 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 `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:414` calls `get` and `src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:463` 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 (52–53 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:459— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:459-511 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:742-793 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:459` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–20 lines × 2) src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:474— src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:474-490 | src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:494-513 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/StreamingForwarder.java:474` 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–19 lines × 2) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1109— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1109-1123 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:756-774 — 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 `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:378— src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:378-392 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:451-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:378` 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 (17 lines × 4) src/main/java/org/mark/llamacpp/server/controller/NodeController.java:87— src/main/java/org/mark/llamacpp/server/controller/NodeController.java:87-103 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:150-166 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:181-197 | src/main/java/org/mark/llamacpp/server/controller/NodeController.java:224-240 — 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 `src/main/java/org/mark/llamacpp/server/controller/NodeController.java: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. 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) src/main/java/org/mark/llamacpp/server/ConfigManager.java:1013— src/main/java/org/mark/llamacpp/server/ConfigManager.java:1013-1029 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1123-1139 | src/main/java/org/mark/llamacpp/server/ConfigManager.java:1197-1213 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16–18 lines × 2) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:235— src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:235-250 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:420-437 — both copies are in the same file, so extract the 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–16 lines × 4) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:313— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:313-328 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:422-432 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:976-986 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1087-1098 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:343— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:343-358 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1120-1134 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 4) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:523— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:523-535 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:541-553 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1638-1652 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1664-1676 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–15 lines × 3) REDACTED:62— REDACTED:62-70 | REDACTED:87-95 | REDACTED:322-336 — 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 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1136— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1136-1150 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1336-1350 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1491-1505 — 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1136` 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–14 lines × 3) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:863— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:863-874 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:458-471 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1024-1035 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:863` 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 × 3) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:535— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:535-547 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1044-1057 | src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:542-555 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:535` 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 (14 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1176— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1176-1189 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:915-928 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1139-1152 — 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. 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–13 lines × 5) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:449— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:449-461 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:491-503 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:645-656 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1683-1694 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1756-1767 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:449` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–13 lines × 2) src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:202— src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:202-211 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1549-1561 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11–13 lines × 2) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1443— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1443-1453 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1516-1528 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1443` 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 × 9) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:309— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:309-320 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:785-796 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:857-868 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1023-1034 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1083-1094 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1219-1230 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1260-1271 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1337-1348 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1380-1391 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:359— src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:359-370 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:467-478 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1029-1040 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1146-1157 — 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 `src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:359` 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–12 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:376— src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:376-386 | src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java:637-648 | src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java:475-485 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–12 lines × 2) src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:544— src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:544-550 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1114-1125 — 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 `src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:544` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:612— src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:612-623 | src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1117-1126 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:612` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:1115` calls `release` and `src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java:610` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 7) src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:523— src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:523-533 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:806-816 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:938-948 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1133-1142 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1333-1342 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1488-1497 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:293-302 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. 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–11 lines × 2) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1710— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1710-1720 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1731-1740 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/server/LlamaServer.java:1710` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 6) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:611— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:611-620 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:905-914 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:987-996 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1128-1137 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1189-1198 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1306-1315 — 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. 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 × 12) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:306— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:306-313 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:466-474 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:550-558 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:735-742 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:782-789 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:854-861 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1020-1027 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1080-1087 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1215-1223 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1257-1264 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1334-1341 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1376-1384 — all 12 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 7) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:348— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:348-356 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:608-616 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:902-910 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:984-992 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1125-1133 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1186-1194 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1303-1311 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–9 lines × 6) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:466— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:466-474 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:508-516 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:660-668 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1701-1709 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1774-1782 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:671-678 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 5) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:557— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:557-565 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:69-77 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:83-91 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:80-88 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:94-102 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:557` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:131— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:131-139 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:235-243 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:289-297 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:139-147 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 11) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:316— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:316-323 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:477-484 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:745-752 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:792-799 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:864-871 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1030-1037 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1090-1097 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1226-1233 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1267-1274 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1344-1351 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1387-1394 — all 11 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 `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:316` 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 lines × 9) src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:97— src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java:97-105 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:525-533 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:808-816 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:940-948 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1135-1142 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1335-1342 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1490-1497 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:295-302 | src/main/java/org/mark/llamacpp/server/controller/UsageReportController.java:153-160 — there are 9 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/AutoLoadPolicyController.java: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. 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 (4–8 lines × 6) src/main/java/org/mark/llamacpp/server/controller/SystemController.java:286— src/main/java/org/mark/llamacpp/server/controller/SystemController.java:286-293 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1010-1017 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1060-1067 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1449-1456 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1561-1564 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:2096-2099 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:286` 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 (4–8 lines × 5) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:274— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:274-277 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:301-308 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:312-319 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:323-330 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:351-354 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (7–8 lines × 2) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:819— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:819-826 | src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:355-361 — 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 `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:819` 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 × 6) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:466— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:466-472 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:508-514 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:660-666 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1701-1707 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1774-1780 | src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:2160-2166 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:466` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 4) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82-87 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:93-98 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1622-1628 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1880-1885 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82` 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 (2–7 lines × 6) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:411— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:411-412 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:420-426 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:597-598 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:606-612 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:372-373 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:381-387 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:411` 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 (6–7 lines × 2) src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:197— src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:197-202 | src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:353-359 — both copies are in the same file, so extract the 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 `src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:197` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:353` calls `RandomAccessFile` and `src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:197` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–7 lines × 3) src/main/java/org/mark/llamacpp/server/LlamaServer.java:1435— src/main/java/org/mark/llamacpp/server/LlamaServer.java:1435-1441 | src/main/java/org/mark/llamacpp/server/LlamaServer.java:1461-1467 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1158-1160 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 10) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:527— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:527-532 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:556-561 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:68-73 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82-87 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:79-84 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:93-98 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1623-1628 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1753-1758 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1850-1855 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1880-1885 — there are 10 copies across 4 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 10 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:527` 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 × 8) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420-425 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:734-739 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1111-1116 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:764-769 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:787-792 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:877-882 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:926-931 | src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:60-65 — there are 8 copies across 4 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:59` calls `StringBuilder` and `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 6) src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420— src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420-425 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:734-739 | src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1111-1116 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:787-792 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:821-826 | src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:60-65 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/org/mark/llamacpp/server/service/ToolExecutionService.java:59` calls `StringBuilder` and `src/main/java/org/mark/llamacpp/server/mcp/McpClientService.java:1110` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–6 lines × 8) src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:170— src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:170-175 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:247-252 | src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:574-576 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:130-135 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:234-239 | src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:288-293 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:138-143 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:196-198 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:574` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 4) src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:121— src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:121-126 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:146-149 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:164-167 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:191-196 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:146` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:150` calls `isEmpty`, `getJsonString` and `src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:168` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 12) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:318— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:318-323 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:479-484 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:652-657 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:747-752 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:794-799 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:866-871 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1032-1037 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1092-1097 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1228-1233 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1269-1274 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1346-1351 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1389-1394 — all 12 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 before the matched lines, `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:651` calls `getAsJsonObject` and `src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:317` 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 × 8) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:328— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:328-333 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:347-351 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:607-611 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:900-905 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:983-987 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1124-1128 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1184-1189 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1302-1306 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 7) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:450— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:450-456 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:492-498 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:646-651 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1684-1689 | src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1757-1762 | src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:354-358 | src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1504-1508 — there are 7 copies across 4 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 5) src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82— src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java:82-86 | src/main/java/org/mark/llamacpp/server/controller/ProxyController.java:93-97 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1028-1033 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1622-1627 | src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1880-1884 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1028` 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 × 3) src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:403— src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:403-423 | src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:589-609 | src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:364-384 — 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 `src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:403` 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 (4–5 lines × 3) src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:754— src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:754-757 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:801-805 | src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:1039-1043 — 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.
Low cohesion: NettySseMcpServer (LCOM4 4) src/main/java/org/mark/test/mcp/channel/NettySseMcpServer.java:40— NettySseMcpServer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
IC1 · Incompleteness & stubs· Empty method body · ×1
Empty method body — does nothing with its inputs src/main/java/org/mark/audiocpp/AudioServer.java:11— `main` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Duplicated block (64 lines × 2 locations) src/main/resources/web/js/lz-string.js:135— src/main/resources/web/js/lz-string.js:135 · src/main/resources/web/js/lz-string.js:220 — 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 (59 lines × 2 locations) src/main/resources/web/js/settings.js:1512— src/main/resources/web/js/settings.js:1512 · src/main/resources/web/js/settings.js:1693 — 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.
R10 · Code Duplication· Duplicated block with local edits (31 matched lines × 2 locations) · ×1
Duplicated block with local edits (31 matched lines × 2 locations) src/main/resources/web/js/model-action-modal.js:268— src/main/resources/web/js/model-action-modal.js:268 · src/main/resources/web/js/model-action-modal.js:414 — the two spans are one implementation copied and then locally edited — 347 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 (30 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:478— src/main/resources/web/js/newui/usage-report.js:478 · src/main/resources/web/js/usage-report.js:198 — 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 (28 lines × 2 locations) REDACTED:100— REDACTED:100 · REDACTED:220 — 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.
R10 · Code Duplication· Duplicated block with local edits (26 matched lines × 2 locations) · ×1
Duplicated block with local edits (26 matched lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:410— src/main/resources/web/js/newui/usage-report.js:410 · src/main/resources/web/js/usage-report.js:531 — the two spans are one implementation copied and then locally edited — 283 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 (24 matched lines × 2 locations) · ×1
Duplicated block with local edits (24 matched lines × 2 locations) src/main/resources/web/js/model-action-modal.js:2124— src/main/resources/web/js/model-action-modal.js:2124 · REDACTED:245 — the two spans are one implementation copied and then locally edited — 218 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 (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) src/main/resources/web/js/hf.js:496— src/main/resources/web/js/hf.js:496 · src/main/resources/web/js/hf.js:537 — the two spans are one implementation copied and then locally edited — 184 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 (22 lines × 2 locations) src/main/resources/web/js/hf.js:52— src/main/resources/web/js/hf.js:52 · src/main/resources/web/js/newui/hf.js:435 — 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 (21 lines × 2 locations) src/main/resources/web/js/settings.js:1674— src/main/resources/web/js/settings.js:1674 · src/main/resources/web/js/settings.js:1855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (20 matched lines × 2 locations) · ×1
Duplicated block with local edits (20 matched lines × 2 locations) src/main/resources/web/js/newui/hf.js:31— src/main/resources/web/js/newui/hf.js:31 · src/main/resources/web/js/newui/hf.js:73 — the two spans are one implementation copied and then locally edited — 164 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 (16 lines × 2 locations) src/main/resources/web/js/download.js:14— src/main/resources/web/js/download.js:14 · src/main/resources/web/js/hf.js:19 — 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 (14 matched lines × 2 locations) · ×1
Duplicated block with local edits (14 matched lines × 2 locations) src/main/resources/web/js/download.js:570— src/main/resources/web/js/download.js:570 · src/main/resources/web/js/settings.js:55 — the two spans are one implementation copied and then locally edited — 112 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 (14 lines × 2 locations) src/main/resources/web/js/newui/usage-report.js:569— src/main/resources/web/js/newui/usage-report.js:569 · src/main/resources/web/js/usage-report.js:292 — 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.
Complex function extractSamplingSettingsFromConfig (cyclomatic 93, cognitive 105) src/main/resources/web/js/model-detail.js:405— extractSamplingSettingsFromConfig has cyclomatic complexity 93 and cognitive complexity 105; 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 applyCmdToDynamicFields (cyclomatic 81, cognitive 150) src/main/resources/web/js/model-action-modal.js:309— applyCmdToDynamicFields has cyclomatic complexity 81 and cognitive complexity 150; 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 checkUpdate (cyclomatic 73, cognitive 98) src/main/resources/web/js/settings.js:1096— checkUpdate has cyclomatic complexity 73 and cognitive complexity 98; 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 buildLoadModelPayload (cyclomatic 62, cognitive 129) src/main/resources/web/js/model-action-modal.js:1497— buildLoadModelPayload has cyclomatic complexity 62 and cognitive complexity 129; 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 updateDownloadProgress (cyclomatic 62, cognitive 114) src/main/resources/web/js/download.js:404— updateDownloadProgress has cyclomatic complexity 62 and cognitive complexity 114; 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 58, cognitive 62) src/main/resources/web/js/model-list.js:332— (anonymous) has cyclomatic complexity 58 and cognitive complexity 62; 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 56, cognitive 50) src/main/resources/web/js/download.js:256— (anonymous) has cyclomatic complexity 56 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 token (cyclomatic 51, cognitive 136) REDACTED:65— token has cyclomatic complexity 51 and cognitive complexity 136; 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 submitModelAction (cyclomatic 47, cognitive 65) src/main/resources/web/js/model-action-modal.js:1617— submitModelAction has cyclomatic complexity 47 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 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 createHfDownloadTasks (cyclomatic 40, cognitive 37) src/main/resources/web/js/hf.js:402— createHfDownloadTasks has cyclomatic complexity 40 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 generateHttpsCert (cyclomatic 39, cognitive 45) src/main/resources/web/js/settings.js:672— generateHttpsCert has cyclomatic complexity 39 and cognitive complexity 45; 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 _compress (cyclomatic 38, cognitive 150) src/main/resources/web/js/lz-string.js:109— _compress has cyclomatic complexity 38 and cognitive complexity 150; 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 restoreUpdateStatus (cyclomatic 38, cognitive 65) src/main/resources/web/js/settings.js:1421— restoreUpdateStatus has cyclomatic complexity 38 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 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 onMsg (cyclomatic 37, cognitive 51) src/main/resources/web/js/newui/app.js:166— onMsg has cyclomatic complexity 37 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 _decompress (cyclomatic 32, cognitive 69) src/main/resources/web/js/lz-string.js:332— _decompress has cyclomatic complexity 32 and cognitive complexity 69; 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 calculateModelTokens (cyclomatic 31, cognitive 30) src/main/resources/web/js/model-detail.js:1195— calculateModelTokens has cyclomatic complexity 31 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 card (cyclomatic 31, cognitive 27) src/main/resources/web/js/newui/models.js:146— card has cyclomatic complexity 31 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.
Complex function handleWebSocketMessage (cyclomatic 30, cognitive 35) src/main/resources/web/js/websocket.js:86— handleWebSocketMessage has cyclomatic complexity 30 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 render (cyclomatic 30, cognitive 28) src/main/resources/web/js/newui/misc-pages.js:132— render has cyclomatic complexity 30 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 output (cyclomatic 29, cognitive 57) REDACTED:336— output has cyclomatic complexity 29 and cognitive complexity 57; 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 handleAppUpdateEvent (cyclomatic 29, cognitive 53) src/main/resources/web/js/settings.js:1350— handleAppUpdateEvent 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 populate (cyclomatic 29, cognitive 43) src/main/resources/web/js/settings.js:340— populate has cyclomatic complexity 29 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 downloadUpdate (cyclomatic 28, cognitive 36) src/main/resources/web/js/settings.js:1252— downloadUpdate has cyclomatic complexity 28 and cognitive complexity 36; 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 setModelActionMode (cyclomatic 27, cognitive 39) src/main/resources/web/js/model-action-modal.js:1354— setModelActionMode has cyclomatic complexity 27 and cognitive complexity 39; 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 showModelDetailModal (cyclomatic 27, cognitive 26) src/main/resources/web/js/model-detail.js:29— showModelDetailModal has cyclomatic complexity 27 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 loadModel (cyclomatic 25, cognitive 26) src/main/resources/web/js/model-action-modal.js:1398— loadModel has cyclomatic complexity 25 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 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 loadLlamaCppReleases (cyclomatic 24, cognitive 30) src/main/resources/web/js/settings.js:105— loadLlamaCppReleases has cyclomatic complexity 24 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 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.
R2 · Cyclomatic Complexity· Complex function tok (cyclomatic 23, cognitive 22) · ×1
Complex function tok (cyclomatic 23, cognitive 22) REDACTED:608— tok has cyclomatic complexity 23 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.
Complex function (anonymous) (cyclomatic 23, cognitive 21) src/main/resources/web/js/newui/model-detail.js:57— (anonymous) has cyclomatic complexity 23 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 enforceModelCapabilitiesRules (cyclomatic 22, cognitive 22) src/main/resources/web/js/model-action-modal.js:931— enforceModelCapabilitiesRules has cyclomatic complexity 22 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function init (cyclomatic 22, cognitive 21) src/main/resources/web/js/settings.js:2032— init has cyclomatic complexity 22 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 22, cognitive 20) src/main/resources/web/js/model-list.js:670— (anonymous) has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 fetchDetailReadme (cyclomatic 21, cognitive 24) src/main/resources/web/js/hf.js:737— fetchDetailReadme has cyclomatic complexity 21 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 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 21, cognitive 20) src/main/resources/web/js/usage-report.js:338— (anonymous) has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 extractToolResultText (cyclomatic 21, cognitive 17) src/main/resources/web/chat/chat-mcp.js:217— extractToolResultText has cyclomatic complexity 21 and cognitive complexity 17; 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 renderLlamaCppRelease (cyclomatic 20, cognitive 28) src/main/resources/web/js/settings.js:156— renderLlamaCppRelease has cyclomatic complexity 20 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 onclick (cyclomatic 20, cognitive 23) src/main/resources/web/js/model-detail.js:669— onclick has cyclomatic complexity 20 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 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 handleWebSocketMessage (cyclomatic 19, cognitive 28) src/main/resources/web/js/download.js:139— handleWebSocketMessage has cyclomatic complexity 19 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.
R3 · Large Files· src/main/resources/web/js/model-action-modal.js · ×1
src/main/resources/web/js/model-action-modal.js: 2099 lines of code src/main/resources/web/js/model-action-modal.js:1— src/main/resources/web/js/model-action-modal.js has 2099 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· src/main/resources/web/js/settings.js · ×1
src/main/resources/web/js/settings.js: 2086 lines of code src/main/resources/web/js/settings.js:1— src/main/resources/web/js/settings.js has 2086 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· src/main/resources/web/js/model-detail.js · ×1
src/main/resources/web/js/model-detail.js: 1292 lines of code src/main/resources/web/js/model-detail.js:1— src/main/resources/web/js/model-detail.js has 1292 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· src/main/resources/web/chat/chat-mcp.js · ×1
src/main/resources/web/chat/chat-mcp.js: 1076 lines of code src/main/resources/web/chat/chat-mcp.js:1— src/main/resources/web/chat/chat-mcp.js has 1076 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· src/main/resources/web/js/hf.js · ×1
src/main/resources/web/js/hf.js: 934 lines of code src/main/resources/web/js/hf.js:1— src/main/resources/web/js/hf.js has 934 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: 832 lines of code REDACTED:1— REDACTED 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· src/main/resources/web/js/model-list.js · ×1
src/main/resources/web/js/model-list.js: 750 lines of code src/main/resources/web/js/model-list.js:1— src/main/resources/web/js/model-list.js has 750 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: 694 lines of code REDACTED:1— REDACTED 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· src/main/resources/web/js/download.js · ×1
src/main/resources/web/js/download.js: 674 lines of code src/main/resources/web/js/download.js:1— src/main/resources/web/js/download.js has 674 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· src/main/resources/web/js/usage-report.js · ×1
src/main/resources/web/js/usage-report.js: 666 lines of code src/main/resources/web/js/usage-report.js:1— src/main/resources/web/js/usage-report.js has 666 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· src/main/resources/web/js/newui/usage-report.js · ×1
src/main/resources/web/js/newui/usage-report.js: 546 lines of code src/main/resources/web/js/newui/usage-report.js:1— src/main/resources/web/js/newui/usage-report.js has 546 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· src/main/resources/web/js/newui/hf.js · ×1
src/main/resources/web/js/newui/hf.js: 463 lines of code src/main/resources/web/js/newui/hf.js:1— src/main/resources/web/js/newui/hf.js has 463 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· src/main/resources/web/js/lz-string.js · ×1
src/main/resources/web/js/lz-string.js: 461 lines of code src/main/resources/web/js/lz-string.js:1— src/main/resources/web/js/lz-string.js 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.
Test Coverage — 0% of 27 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count
Swallowed exception (caught, then discarded) src/main/resources/web/js/newui/app.js:167— `catch (e)` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Duplicated predicate src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1342— `!Files.exists(filePath) || !Files.isRegularFile(filePath)` appears character-identically in 3 files — src/main/java/org/mark/llamacpp/server/LlamaServerManager.java, src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java, src/main/java/org/mark/llamacpp/server/controller/CertController.java. 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 src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:392— `!Files.exists(p) || !Files.isDirectory(p)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java, src/main/java/org/mark/llamacpp/server/controller/ModelPathController.java. 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 src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:411— `!Files.exists(rootPath) || !Files.isDirectory(rootPath)` appears character-identically in 5 files — src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java, src/main/java/org/mark/llamacpp/server/LlamaServer.java, src/main/java/org/mark/llamacpp/server/LlamaServerManager.java, src/main/java/org/mark/llamacpp/server/service/BuildTaskManager.java. 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 src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java:418— `!found && root.has("data") && root.get("data").isJsonArray()` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/channel/BasicRouterHandler.java, src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java. 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 src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:426— `!id.isEmpty() && !dataById.containsKey(id)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java, src/main/java/org/mark/llamacpp/server/service/OpenAIService.java. 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 src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java:727— `!inSingle && !inDouble && Character.isWhitespace(c)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/LlamaCppProcess.java, src/main/java/org/mark/llamacpp/server/tools/CommandLineRunner.java. 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 src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:402— `!info.has("items") || !info.get("items").isJsonArray()` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java, src/main/java/org/mark/llamacpp/server/service/OpenAIService.java. 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 src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:321— `!isHttps && !"http".equalsIgnoreCase(scheme)` appears character-identically in 2 files — src/main/java/org/mark/file/downloader/NettyHttpDownloader.java, src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java. 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 src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:418— `!key.isEmpty() && !modelsByKey.containsKey(key)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java, src/main/java/org/mark/llamacpp/server/service/OpenAIService.java. 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 src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java:401— `!nodeId.isEmpty() && !"local".equals(nodeId)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/channel/FileDownloadRouterHandler.java, src/main/java/org/mark/llamacpp/server/controller/PerplexityController.java. 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 src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java:208— `!obj.has(key) || obj.get(key).isJsonNull()` appears character-identically in 3 files — src/main/java/org/mark/llamacpp/record/BinaryRequestLog.java, src/main/java/org/mark/llamacpp/server/LlamaServerManager.java, src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java. 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 src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:149— `!probe.rangeSupported && actualThreads > 1` appears character-identically in 2 files — src/main/java/org/mark/file/downloader/NettyHttpDownloader.java, src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java. 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 src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:606— `!waitForTlsHandshake && sent.compareAndSet(false, true)` appears character-identically in 2 files — src/main/java/org/mark/file/downloader/NettyHttpDownloader.java, src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java. 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 src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:409— `"Host".equalsIgnoreCase(key) || "Connection".equalsIgnoreCase(key) || "Content-Length".equalsIgnoreCase(key) || "Transfer-Encoding".equalsIg…` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java, src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java. 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 src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:613— `"enable_thinking".equals(key) || "force_enable_thinking".equals(key)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java, src/main/java/org/mark/llamacpp/server/service/SamplingInjectionBuilder.java. 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 src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1230— `"false".equals(s) || "0".equals(s) || "no".equals(s) || "off".equals(s)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/SystemController.java, src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java. 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 src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:242— `"jpeg".equals(subtype) || "jpg".equals(subtype)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java, src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java. 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 src/main/java/org/mark/llamacpp/server/controller/SystemController.java:1227— `"true".equals(s) || "1".equals(s) || "yes".equals(s) || "on".equals(s)` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/SystemController.java, src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java. 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 src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java:271— `(ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java, src/main/java/org/mark/llamacpp/server/service/EasyChatBackgroundService.java. 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 src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java:1036— `(cmd == null || cmd.isEmpty()) && (extraParams == null || extraParams.isEmpty())` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java, src/main/java/org/mark/llamacpp/server/controller/SystemController.java. 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 src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1037— `acceptRanges != null && acceptRanges.toLowerCase(Locale.ROOT).contains("bytes")` appears character-identically in 2 files — src/main/java/org/mark/file/downloader/NettyHttpDownloader.java, src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java. 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 src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java:315— `assistantId == null || assistantId.trim().isEmpty()` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java, src/main/java/org/mark/llamacpp/server/service/EasyChatAvatarService.java. 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 src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:874— `authority == null || authority.isBlank()` appears character-identically in 2 files — src/main/java/org/mark/file/downloader/NettyHttpDownloader.java, src/main/java/org/mark/llamacpp/crawler/NettyHttpUtils.java. 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:320— `body != null && (method.equals("POST") || method.equals("PUT"))` appears character-identically in 2 files — REDACTED, src/main/java/org/mark/llamacpp/server/controller/ModelActionController.java. 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 src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java:239— `body.has("variantIndex") && !body.get("variantIndex").isJsonNull()` appears character-identically in 2 files — src/main/java/org/mark/llamacpp/server/controller/ChatStateController.java, src/main/java/org/mark/llamacpp/server/controller/EasyChatController.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch src/main/java/org/mark/file/downloader/DownloadTaskManager.java:627— `readTarHeaderSize` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:93— `resolveFileName` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/file/downloader/DownloadWebSocketListener.java:102— `resolveParentPath` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/gguf/GGUFMetaDataReader.java:42— `read` swallows every exception into `return java.util.Collections.emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/gguf/MtpHelper.java:569— `readMetadata` swallows every exception into `return Collections.emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:546— `readBody` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/controller/LlamacppController.java:1055— `readBody` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/controller/SystemController.java:578— `getFsItemLong` swallows every exception into `return 0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/AnthropicService.java:1022— `getString` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:553— `readBody` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:652— `readString` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:261— `getLastModifiedSafe` swallows every exception into `return -1L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ComputerService.java:168— `getCPUCoreCount` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ComputerService.java:197— `getJvmInputArguments` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ComputerService.java:205— `getJvmStartTime` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ComputerService.java:149— `getPhysicalMemoryKB` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ComputerService.java:127— `tryExecAndRead` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/EasyChatStorage.java:426— `readModelIndex` swallows every exception into `return new HashMap<>()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/service/ModelSamplingService.java:267— `getLastModifiedSafe` swallows every exception into `return -1L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:78— `getJsonString` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/tools/JsonUtil.java:279— `jsonValueToString` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/tools/ParamTool.java:216— `getQueryParam` swallows every exception into `return new HashMap<>()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2939— `jsonString` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/java/org/mark/test/mcp/tools/ReadStaticImageTool.java:129— `getAbsolutePath` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/main/resources/web/js/model-action-modal.js:126— `getParamConfigListSafe` 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.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/ConfigManager.java:724— `info` at line 724 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/LlamaServer.java:81— `info` at line 81 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/LlamaServer.java:85— `info` at line 85 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/LlamaServer.java:90— `info` at line 90 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1815— `info` at line 1815 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:2313— `info` at line 2313 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/NettyWebServer.java:205— `info` at line 205 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/main/java/org/mark/llamacpp/server/service/BenchmarkService.java:527— `info` at line 527 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, 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 level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Silent fallback default on parse failure src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1046— `parseContentLength` returns `-1` when `NumberFormatException` is thrown, with no log or throw — 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure src/main/java/org/mark/file/downloader/NettyHttpDownloader.java:1065— `parseContentRangeSize` returns `-1` when `NumberFormatException` is thrown, with no log or throw — 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:469— `parseContentLength` returns `-1` when `NumberFormatException` is thrown, with no log or throw — 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 in the catch or in the Javadoc, and the row stops firing.
Silent fallback default on parse failure src/main/java/org/mark/file/downloader/SimpleHttpDownloader.java:488— `parseContentRangeSize` returns `-1` when `NumberFormatException` is thrown, with no log or throw — 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 in the catch or in the Javadoc, and the row stops firing.
Subsumed condition operand src/main/java/org/mark/llamacpp/server/LlamaServerManager.java:1846— `base.endsWith("-mtp-donor")` can never decide this `||` — every value satisfying `base.endsWith("-mtp-donor")` also satisfies `base.endsWith("-donor")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:137— `uri.startsWith("/v1/reranking")` can never decide this `||` — every value satisfying `uri.startsWith("/v1/reranking")` also satisfies `uri.startsWith("/v1/rerank")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src/main/java/org/mark/llamacpp/server/channel/LlamaRouterHandler.java:137— `uri.startsWith("/reranking")` can never decide this `||` — every value satisfying `uri.startsWith("/reranking")` also satisfies `uri.startsWith("/rerank")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:184— `uri.startsWith("/llama.cpp/v1/chat/completions")` can never decide this `||` — every value satisfying `uri.startsWith("/llama.cpp/v1/chat/completions")` also satisfies `uri.startsWith("/llama.cpp/v1/chat/completion")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
No ADRs found REDACTED:89— 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 `REDACTED` makes this repository a deployable product (line 89).
D21 · Naming Consistency· `buildAiMessage` spells `Ai` where 20 names in the project spell it `AI` · ×1
`buildAiMessage` spells `Ai` where 20 names in the project spell it `AI` src/main/java/org/mark/llamacpp/server/service/EasyChatService.java:1965— 20 of 22 names in project llamacpp.hub spell the token `AI` (20 of 22; unit: names in project llamacpp.hub containing `AI`). Peers: NettyWebServer.bindOpenAI (src/main/java/org/mark/llamacpp/server/NettyWebServer.java:188); org.mark.llamacpp.server.channel.OpenAIChatStreamingHandler (src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:36); ModelInfoController.handleOpenAIModelsRequest (src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374); ChatTemplateKwargsService.handleOpenAI (src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:59); ChatTemplateKwargsService.getOpenAIChatTemplateKwargs (src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:84). Rename to `buildAIMessage`. [rule N6]
D21 · Naming Consistency· `openAiErrorCode` spells `Ai` where 20 names in the project spell it `AI` · ×1
`openAiErrorCode` spells `Ai` where 20 names in the project spell it `AI` src/main/java/org/mark/llamacpp/server/service/OpenAIService.java:1792— 20 of 22 names in project llamacpp.hub spell the token `AI` (20 of 22; unit: names in project llamacpp.hub containing `AI`). Peers: NettyWebServer.bindOpenAI (src/main/java/org/mark/llamacpp/server/NettyWebServer.java:188); org.mark.llamacpp.server.channel.OpenAIChatStreamingHandler (src/main/java/org/mark/llamacpp/server/channel/OpenAIChatStreamingHandler.java:36); ModelInfoController.handleOpenAIModelsRequest (src/main/java/org/mark/llamacpp/server/controller/ModelInfoController.java:374); ChatTemplateKwargsService.handleOpenAI (src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:59); ChatTemplateKwargsService.getOpenAIChatTemplateKwargs (src/main/java/org/mark/llamacpp/server/service/ChatTemplateKwargsService.java:84). Rename to `openAIErrorCode`. [rule N6]
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 1 of 101 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 101 of the 142 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: REDACTED. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No SAST — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation REDACTED:20— `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 release approval gate REDACTED:676— The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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.)
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 5/47 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.
X5 · Nullable reference types· Java packages are not null-marked everywhere · ×1
Java packages are not null-marked everywhere — 0/30 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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 01a1e6b6-0adb-7c1b-a681-4d3071f430fa · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 67 · Warnings: 1674 · Recommendations: 107 · Info: 6 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 23:34 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.