Public report of lizhipay/acg-faka, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 20:14 UTC · Survey ID cd_1231b0a194a34619a0ac98e58e97ad5e
lizhipay/acg-faka
Measured 17 November 2026, 20:08 UTC, at code version bc266e6
First survey, so nothing to compare with yet
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 large codebase: 132,560 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 0.8 person-years · Weakest lens: Production Readiness, 23.7
Findings by how serious they are
120 critical1559 serious116 minor
14 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 20:08 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.
1778of 1795 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 132,560 lines of product code in 5 projects.
lizhipay/acg-faka falls short of our standard for production, in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 32.9 out of 100 and is rated Weak, and 23 of its 120 critical findings are security problems.
Production Readiness, at 23.7, is the weakest lens and counts most in the score. The best first step is fixing the package under a licence on your banned list, worth about 2.6 points. Adding automated security scanning would lift Production Readiness itself, also worth about 2.6. Raising Production Readiness to 70 would lift the score to about 40.4.
Twelve pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Four secrets can leak from the build pipeline, and twenty-six controls can't be used without a mouse. Pinning each tool to an exact version, limiting each secret to its own step and making the controls work with a keyboard would close these risks. Updating the vulnerable packages would fix the two packages with a known security hole, and the two places where the code runs text as code or as a command need a direct call instead. The 23 labels or groups of fields with no name need connecting to their fields or naming.
The product code is 132,560 lines, about €110,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 23.7 to 70, the lowest score rated Strong, the score would rise from 32.9 to about 40.4.
Code composition: what the lines of code are
Product code 100%Tests 0%
Rebuild cost: about €110,000 · Estimate
Cost to rebuild
€38,000 to €190,000, for 625 to 1,984 hours of work, about 0.8 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 33. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 132,560 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Banned license finding(s) in License Compliance.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json.
Raises the score by about 1.4 points · Low effort · ADR Quality
3
Add a SAST step to CI running what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
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 €110,000 to build again, about 0.8 person-years of work. Its weakest lens is Production Readiness, at 23.7 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 2.6 points for low effort, because it clears the 1 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 72,359 lines over the last 90 days, which is about 293,456 lines a year. At that pace, the extra work comes to an estimated 52.3 to 314 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
87 modules, with 49 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 47 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
App.Interceptor uses Kernel.Annotation, so a change to Kernel.Annotation can break App.Interceptor, while a change to App.Interceptor can't break Kernel.Annotation.
Position
Below the diagonal: App.Interceptor uses a module listed above it, which is the healthy direction.
App.Interceptor uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Interceptor, while a change to App.Interceptor can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Interceptor uses a module listed above it, which is the healthy direction.
Kernel.Context.Abstract uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break Kernel.Context.Abstract, while a change to Kernel.Context.Abstract can't break Kernel.Context.Interface.
Position
Below the diagonal: Kernel.Context.Abstract uses a module listed above it, which is the healthy direction.
Kernel.Util uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break Kernel.Util, while a change to Kernel.Util can't break Kernel.Context.Interface.
Position
Below the diagonal: Kernel.Util uses a module listed above it, which is the healthy direction.
assets.admin.js.dict uses assets.common.js.util.dict, so a change to assets.common.js.util.dict can break assets.admin.js.dict, while a change to assets.admin.js.dict can't break assets.common.js.util.dict.
Position
Below the diagonal: assets.admin.js.dict uses a module listed above it, which is the healthy direction.
assets.user.js.dict uses assets.common.js.util.dict, so a change to assets.common.js.util.dict can break assets.user.js.dict, while a change to assets.user.js.dict can't break assets.common.js.util.dict.
Position
Below the diagonal: assets.user.js.dict uses a module listed above it, which is the healthy direction.
App.Controller.Base uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.Base, while a change to App.Controller.Base can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.Base uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in App.Controller.Base uses a type in App.Model.
The types involved
App.Controller.Base.Manage → App.Model.Manage
App.Controller.Base.Shared → App.Model.User
App.Controller.Base.Shared → App.Model.UserGroup
App.Controller.Base.User → App.Model.User
App.Controller.Base.User → App.Model.UserGroup
Direction
App.Controller.Base uses App.Model, so a change to App.Model can break App.Controller.Base, while a change to App.Controller.Base can't break App.Model.
Position
Below the diagonal: App.Controller.Base uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in App.Service uses a type in App.Model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Kernel.Context uses Kernel.Context.Abstract, so a change to Kernel.Context.Abstract can break Kernel.Context, while a change to Kernel.Context can't break Kernel.Context.Abstract.
Position
Below the diagonal: Kernel.Context uses a module listed above it, which is the healthy direction.
App.Controller.Base.API uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.Base.API, while a change to App.Controller.Base.API can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.Base.API uses a module listed above it, which is the healthy direction.
App.Controller.Base.API uses App.Model, so a change to App.Model can break App.Controller.Base.API, while a change to App.Controller.Base.API can't break App.Model.
Position
Below the diagonal: App.Controller.Base.API uses a module listed above it, which is the healthy direction.
App.Controller.Base.API uses App.Controller.Base, so a change to App.Controller.Base can break App.Controller.Base.API, while a change to App.Controller.Base.API can't break App.Controller.Base.
Position
Below the diagonal: App.Controller.Base.API uses a module listed above it, which is the healthy direction.
App.Controller.Base.View uses App.Controller.Base, so a change to App.Controller.Base can break App.Controller.Base.View, while a change to App.Controller.Base.View can't break App.Controller.Base.
Position
Below the diagonal: App.Controller.Base.View uses a module listed above it, which is the healthy direction.
App.Controller uses App.Controller.Base.API, so a change to App.Controller.Base.API can break App.Controller, while a change to App.Controller can't break App.Controller.Base.API.
Position
Below the diagonal: App.Controller uses a module listed above it, which is the healthy direction.
App.Controller.Admin uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.Admin, while a change to App.Controller.Admin can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.Admin uses a module listed above it, which is the healthy direction.
App.Controller.Admin uses App.Service, so a change to App.Service can break App.Controller.Admin, while a change to App.Controller.Admin can't break App.Service.
Position
Below the diagonal: App.Controller.Admin uses a module listed above it, which is the healthy direction.
App.Controller.Admin uses App.Controller.Base.View, so a change to App.Controller.Base.View can break App.Controller.Admin, while a change to App.Controller.Admin can't break App.Controller.Base.View.
Position
Below the diagonal: App.Controller.Admin uses a module listed above it, which is the healthy direction.
App.Controller.Admin.Api uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.Admin.Api, while a change to App.Controller.Admin.Api can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.Admin.Api uses a module listed above it, which is the healthy direction.
App.Controller.Admin.Api uses App.Model, so a change to App.Model can break App.Controller.Admin.Api, while a change to App.Controller.Admin.Api can't break App.Model.
Position
Below the diagonal: App.Controller.Admin.Api uses a module listed above it, which is the healthy direction.
37 pairs of types, where a type in App.Controller.Admin.Api uses a type in App.Service. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
App.Controller.Admin.Api uses App.Service, so a change to App.Service can break App.Controller.Admin.Api, while a change to App.Controller.Admin.Api can't break App.Service.
Position
Below the diagonal: App.Controller.Admin.Api uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in App.Controller.Admin.Api uses a type in App.Controller.Base.API. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
App.Controller.Admin.Api uses App.Controller.Base.API, so a change to App.Controller.Base.API can break App.Controller.Admin.Api, while a change to App.Controller.Admin.Api can't break App.Controller.Base.API.
Position
Below the diagonal: App.Controller.Admin.Api uses a module listed above it, which is the healthy direction.
App.Controller.Shared uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.Shared, while a change to App.Controller.Shared can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.Shared uses a module listed above it, which is the healthy direction.
App.Controller.Shared uses App.Model, so a change to App.Model can break App.Controller.Shared, while a change to App.Controller.Shared can't break App.Model.
Position
Below the diagonal: App.Controller.Shared uses a module listed above it, which is the healthy direction.
App.Controller.Shared uses App.Service, so a change to App.Service can break App.Controller.Shared, while a change to App.Controller.Shared can't break App.Service.
Position
Below the diagonal: App.Controller.Shared uses a module listed above it, which is the healthy direction.
App.Controller.Shared uses App.Controller.Base.API, so a change to App.Controller.Base.API can break App.Controller.Shared, while a change to App.Controller.Shared can't break App.Controller.Base.API.
Position
Below the diagonal: App.Controller.Shared uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in App.Controller.User uses a type in App.Model.
The types involved
App.Controller.User.Download → App.Model.CardFile
Direction
App.Controller.User uses App.Model, so a change to App.Model can break App.Controller.User, while a change to App.Controller.User can't break App.Model.
Position
Below the diagonal: App.Controller.User uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in App.Controller.User uses a type in App.Service.
The types involved
App.Controller.User.Index → App.Service.Shop
Direction
App.Controller.User uses App.Service, so a change to App.Service can break App.Controller.User, while a change to App.Controller.User can't break App.Service.
Position
Below the diagonal: App.Controller.User uses a module listed above it, which is the healthy direction.
App.Controller.User uses App.Controller.Base.View, so a change to App.Controller.Base.View can break App.Controller.User, while a change to App.Controller.User can't break App.Controller.Base.View.
Position
Below the diagonal: App.Controller.User uses a module listed above it, which is the healthy direction.
App.Controller.User.Api uses Kernel.Context.Interface, so a change to Kernel.Context.Interface can break App.Controller.User.Api, while a change to App.Controller.User.Api can't break Kernel.Context.Interface.
Position
Below the diagonal: App.Controller.User.Api uses a module listed above it, which is the healthy direction.
App.Controller.User.Api uses App.Model, so a change to App.Model can break App.Controller.User.Api, while a change to App.Controller.User.Api can't break App.Model.
Position
Below the diagonal: App.Controller.User.Api uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in App.Controller.User.Api uses a type in App.Service. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
App.Controller.User.Api uses App.Service, so a change to App.Service can break App.Controller.User.Api, while a change to App.Controller.User.Api can't break App.Service.
Position
Below the diagonal: App.Controller.User.Api uses a module listed above it, which is the healthy direction.
App.Controller.User.Api uses App.Controller.Base.API, so a change to App.Controller.Base.API can break App.Controller.User.Api, while a change to App.Controller.User.Api can't break App.Controller.Base.API.
Position
Below the diagonal: App.Controller.User.Api uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in App.Service.Bind uses a type in App.Entity.Query.
The types involved
App.Service.Bind.Query → App.Entity.Query.Delete
App.Service.Bind.Query → App.Entity.Query.Get
App.Service.Bind.Query → App.Entity.Query.Save
Direction
App.Service.Bind uses App.Entity.Query, so a change to App.Entity.Query can break App.Service.Bind, while a change to App.Service.Bind can't break App.Entity.Query.
Position
Below the diagonal: App.Service.Bind uses a module listed above it, which is the healthy direction.
App.Service.Bind uses Kernel.Exception, so a change to Kernel.Exception can break App.Service.Bind, while a change to App.Service.Bind can't break Kernel.Exception.
Position
Below the diagonal: App.Service.Bind uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in App.Service.Bind uses a type in App.Model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in App.Service.Bind uses a type in App.Service. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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
51
High / Critical
A03:2025 — Software Supply Chain Failures
10
High / Critical
A02:2025 — Security Misconfiguration
5
High / Critical
A07:2025 — Authentication Failures
4
High / Critical
Roadmap
Top priorities: Resolve the 1 Banned license finding(s) in License Compliance; Add a SAST step to CI running what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing; Resolve the 1 finding(s) in DR & Backup.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Banned license finding(s) in License Compliance.
Add a SAST step to CI running what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
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.
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 — 120
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 — 1559
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 — 116
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
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, 1778 of 1795 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: test source is present (.php) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.php) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
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 (6 contributor(s) across 345 commit(s) sampled, automation and bot accounts excluded). One of them holds 98% of the history; the other 5 hold 0.4% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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)` (131175 LoC, 479 module-visible types across 76 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.
D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 1881 sampled here came from .html/.js files. This repository's .php source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `app/Controller/Admin/Api/Plugin.php`, `app/Service/App.php`, `app/Service/Bind/Query.php`, `app/Service/Cash.php`, `app/Service/Currency.php`, … (+29 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
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. 128 further occurrence(s) are not listed individually; the score already reflects all 168.
AC6 Visual & motion safety — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. An image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository. (rule: registry). The renderer reported: compose up failed (exit 17 — an image could not be built) — openssl\"]; foreach ($need as $e) { if (!extension_loaded($e)) { fwrite(STDERR, \"缺少扩展 $e\\n\"); exit(1); } } if (!extension_loaded(\"Zend OPcache\")) { fwrite(STDERR, \"缺少 opcache\\n\"); exit(1); } if (!function_exists(\"imagecreatetruecolor\") || !function_exists(\"bcadd\")) { fwrite(STDERR, \"gd/bcmath 装上了但函数不可用\\n\"); exit(1); } echo \"扩展自检通过\\n\";'" did not complete successfully: exit code: 1; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 17 — an image could not be built) — openssl\"]; foreach ($need as $e) { if (!extension_loaded($e)) { fwrite(STDERR, \"缺少扩展 $e\\n\"); exit(1); } } if (!extension_loaded(\"Zend OPcache\")) { fwrite(STDERR, \"缺少 opcache\\n\"); exit(1); } if (!function_exists(\"imagecreatetruecolor\") || !function_exists(\"bcadd\")) { fwrite(STDERR, \"gd/bcmath 装上了但函数不可用\\n\"); exit(1); } echo \"扩展自检通过\\n\";'" did not complete successfully: exit code: 1; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
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. 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.
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. 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.
M3 Folder & project structure — 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. Whether the tests sit apart from production code is not visible here, because the suite is not in a form this pass reads. The test-separation credit is granted rather than withheld: this is a gap in the analyzer's language coverage, not a finding about the repository's tests. You can widen what we reach: keep the test surface somewhere a reader can find it without opening a binary — an exported/checked-in test source tree beside the production code makes the suite reviewable, diffable and discoverable by tooling.
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.
P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
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. 277 further occurrence(s) are not listed individually; the score already reflects all 317.
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. 319 further occurrence(s) are not listed individually; the score already reflects all 359.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 7 further occurrence(s) are not listed individually; the score already reflects all 47.
X1 Async correctness — 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.
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. 85 further occurrence(s) are not listed individually; the score already reflects all 125.
X12 Unreachable branch — 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.
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. 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.
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. 141 further occurrence(s) are not listed individually; the score already reflects all 181.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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. 158 further occurrence(s) are not listed individually; the score already reflects all 198.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
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.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
597 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was tree.select.layui.define() at 1045. A further 11 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 Form.createForm at 40 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/Service/Bind/Mcp.php (Mcp.call at 18), app/Util/CardFile/Archive.php (Archive.headMatches at 17), assets/admin/controller/file/index.js (confirmFileDelete::done at 17), app/Service/ManageSessionManager.php (ManageSessionManager.device at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 387 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 21 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with tree.select.layui.define() (cyclomatic 1045), hex.layui.define() (cyclomatic 268), fallback.render (cyclomatic 177). — 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 21 together lifts Cyclomatic Complexity from 2.0 to about 3.8/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.
+ 484 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 35 bodies over 60 down to 60 or less in Cognitive Complexity — start with tree.select.layui.define() (cognitive 1209), commodity (cognitive 297), hex.layui.define() (cognitive 235). — 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 35 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 Classes7.4 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 37 FileTooLong finding(s) in God Classes — start with index.js (2), codemirror.js, REDACTED. — One of this dimension's main actionable groups (37 warning-level).
Resolve the 29 FunctionTooLong finding(s) in God Classes — start with commodity.js (4), REDACTED (3), codemirror.js (3). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 16 MethodTooLong finding(s) in God Classes — start with Commodity.php (3), Order.php, component.js. — One of this dimension's main actionable groups (16 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.
115 duplicated block group(s) detected. 3.5 % of the production lines (4,679 of 132,560) are in a reported copy. A further 79 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .js (57% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 100 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with ManageSessionManager.php (2), Order.php, ManageSession.php. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 9 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with Order.php (2), Card.php, Coupon.php. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 7 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with Order.php (2), ManageSessionManager.php (2), Commodity.php. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling2.0 / 10Critical✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
5 production modules (source-import), 1 dependency cycle(s), 0 unstable depended-on module(s). No manifest declares this repository's modules, so the modules are its top-level source directories and the edges the imports between them; 0 module(s) off the main sequence, with abstractness counted on 2 of the 5 (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).
Circular dependencyREDACTED:14
What to do
Resolve the 1 Circular dependency finding(s) in Coupling — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
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.
1 outdated, 0 abandoned direct Composer dependencies. PLATFORM requirements (php, ext-*, lib-*) are deliberately not graded here: they name the runtime rather than a Packagist package, so there is no release for them to be behind — whether that runtime is still supported is a separate question with a separate remedy. Development requirements are excluded, because a consumer never installs them. A newer release is reported only where this repository's OWN constraint already admits it, so the remedy is `composer update` and never a manifest edit. Known CVEs in this dependency graph are D30's question.
Outdated: ezyang/htmlpurifier
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
REDACTED scan ran and found no leaked secrets. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material. 1 password hash(es) are listed to check and are not counted as leaked credentials.
REDACTED
✓ On the Gold path — maintain.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
1 of 38 locked Composer package(s) use a banned license. Licences were read from this repository's REDACTED, which records the `license` each package declares, over every package in its production `packages` list, direct and transitive, at the locked version; the 0 package(s) under `packages-dev` are not installed for a consumer and are excluded.
Banned license: smarty/smarty
What to do
Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: REDACTED (2×1045=2090); app/Service/Bind/Order.php (16×119=1904); app/Controller/User/Api/Commodity.php (12×73=876)
Hotspot: REDACTED · ×51REDACTED:1
What to do
Resolve the 51 Hotspot finding(s) in Churn × Complexity Hotspots — start with Order.php (2), Commodity.php (2), User.php (2). — One of this dimension's main actionable groups (51 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 55494 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.
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. 5 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 composer.json. — 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 107 declarations measured against a convention their peers follow.
`parseURL` spells `URL` where 28 names in the project spell it `Url`assets/static/jquery.pjax.js:588
`parseHTML` spells `HTML` where 77 names in the project spell it `Html`assets/static/jquery.pjax.js:646
What to do
Resolve the 1 `parseURL` spells `URL` where 28 names in the project spell it `Url` finding(s) in Naming Consistency — start with jquery.pjax.js. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `parseHTML` spells `HTML` where 77 names in the project spell it `Html` finding(s) in Naming Consistency — start with jquery.pjax.js. — 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.
18 of 749 judged comments only repeat the code they sit on (2.4 %). 964 comment(s) in another language or script were not judged.
redundant comment · ×3REDACTED:1810
doc comments repeat the namesassets/common/js/component.js:311
What to do
Resolve the 3 redundant comment finding(s) in Comment Value — start with REDACTED, REDACTED, codemirror.js. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
45 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated. Measured over the .html/.js source only — this repository's .php was not sampled for call sites, so this score covers part of the tree, not all of it.
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, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
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 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-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).
51 finding(s): 0 critical, 19 high, 32 medium, 0 low. 12 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 75 file(s) — `app/Controller/Admin/Api/Plugin.php` (line 50), `app/Service/App.php` (line 12), `app/Service/Bind/Query.php` (line 229), `app/Service/Cash.php` (line 12), `app/Service/Currency.php` (line 18), … (+70 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 7 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 12 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 (12 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 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 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).
Resolve the 1 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 290 of the 484 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 11 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives4.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×15) — app/View/User/Theme/Cartoon/Common/Header.html:73, app/View/User/Theme/Cartoon/Common/Header.html:187, app/View/User/Theme/Cartoon/Index/Item.html:11, …
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. — app/View/User/Theme/Cartoon/Index/Closed.html:76
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.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
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. (×23) — app/View/Admin/Config/Other.html:43, app/View/Admin/Config/Other.html:117, app/View/Admin/Config/Other.html:133, …
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. (×13) — app/View/Admin/Config/Other.html:48, app/View/Admin/Config/Other.html:121, app/View/Admin/Config/Other.html:137, …
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — app/View/Admin/Config/Other.html:188, app/View/Admin/Config/Other.html:298, app/View/Admin/Config/Other.html:370, …
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.
The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag. (×6) — app/View/Admin/Authentication/Lock.html:2, app/View/Admin/Authentication/Login.html:2, app/View/Admin/Config/Wiki.html:2, …
A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — app/View/Admin/Config/Security.html:339
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×8) — app/View/Admin/Config/Wiki.html:2, app/View/Admin/Header.html:2, app/View/LegalTerms.html:2, …
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×2) — app/View/LegalTerms.html:421, app/View/User/Theme/Cartoon/Index/Item.html:146
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — app/View/Rewrite.html:2
user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. (×2) — app/View/User/Submit.html:4, app/View/User/Theme/Cartoon/Common/Header.html:6
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".
The repo's own CSS styles .image-input-wrapper 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) — app/View/Admin/Config/Setting.html:51, app/View/Admin/Manage/Set.html:31
The repo's own CSS styles .btn with `cursor: pointer`, so this <span> 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) — app/View/Admin/Config/Setting.html:68, app/View/Admin/Manage/Set.html:47
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — app/View/Admin/Header.html:312
The repo's own CSS styles .btn 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. — app/View/Admin/Header.html:348
The repo's own CSS styles .chip with `cursor: pointer`, so this <span> 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. — app/View/Install.html:379
The repo's own CSS styles .image-code with `cursor: pointer`, so this <img> 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) — app/View/User/Theme/Cartoon/Authentication/Login.html:37, app/View/User/Theme/Cartoon/Authentication/Register.html:86
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — app/View/User/Theme/Cartoon/Common/Header.html:170
The repo's own CSS styles .shared-button with `cursor: pointer`, so this <span> 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. — app/View/User/Theme/Cartoon/Index/Item.html:26
The repo's own CSS styles .captcha-img with `cursor: pointer`, so this <img> 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. — app/View/User/Theme/Cartoon/Index/Item.html:120
The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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. (×15) — assets/admin/controller/shared/store.js:1425, assets/admin/controller/store/developer.js:654, assets/admin/controller/store/developer.js:663, …
The repo's own CSS styles .CodeMirror-foldmarker with `cursor: pointer`, so this <span> 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. — assets/static/codemirror/addon/fold/foldcode.js:72
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.
aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden. (×2) — app/View/Admin/Authentication/Lock.html:35, app/View/Admin/Authentication/Login.html:36
"#{if $config.callback_ip_whitelist == 1}true#{else}false#{/if}" is not a valid value for aria-expanded — allowed: true, false, undefined. — app/View/Admin/Config/Other.html:67
aria-hidden="true" hides the element from assistive tech but leaves it keyboard-focusable — a confusing dead stop. Remove aria-hidden or make the element non-focusable. — assets/common/js/jquery.min.js:5339
What to do
Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
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.
The projects app → kernel → app form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference. — REDACTED:14
What to do
Break project reference cycles by extracting shared abstractions into a separate project; keep the graph a DAG.
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.
`App` declares 27 methods: `getVersions`, `update`, `upload`, `ad`, `install`, `captcha`, `register`, `login`, `plugins`, `authors`, `purchase`, `levels`, `bindLevel`, `installPlugin`, `updatePlugin`, `uninstallPlugin`, `purchaseRecords`, `unbind`, `rebindPlan`, `developerPlugins`, `developerCreatePlugin`, `developerCreateKit`, `developerDeletePlugin`, `developerUpdatePlugin`, `developerPluginPriceSet`, `service`, `editPassword`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/Service/App.php:12
`Shared` declares 21 methods: `connect`, `items`, `item`, `inventoryState`, `inventory`, `trade`, `retrieve`, `draftCard`, `getDraft`, `getItemStock`, `getValuation`, `AdjustmentPrice`, `AdjustmentTemplate`, `usesFactoryBase`, `factoryQuote`, `priceSkipped`, `AdjustmentAmount`, `AdjustmentExtra`, `syncRemoteItem`, `remoteCost`, `remoteLeaveMessage`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/Service/Shared.php:11
`Ticket` declares 17 methods: `ready`, `userData`, `adminData`, `userDetail`, `adminDetail`, `userMessages`, `adminMessages`, `commodityOptions`, `orderOptions`, `create`, `userReply`, `adminReply`, `close`, `delete`, `userBadge`, `adminBadge`, `upload`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — app/Service/Ticket.php:10
`Request` declares 18 methods: `method`, `all`, `post`, `unsafePost`, `xml`, `get`, `unsafeGet`, `header`, `cookie`, `json`, `unsafeJson`, `file`, `uri`, `uriSuffix`, `setProperty`, `url`, `domain`, `raw`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — kernel/Context/Interface/Request.php:8
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX 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 JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, 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.
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.
No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
Maturity · Maturity — Whether the 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 / 10Strong✓ 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 · Observability8.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 phpstan or psalm (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.
What to do
Add a SAST step to CI running what this repository's stack ships: phpstan or psalm — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`new Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/Pay/Base.php:77
`new \GuzzleHttp\Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/Util/Http.php:22
What to do
Give every client an explicit bound: `new Client(['timeout' => 10, 'connect_timeout' => 3])` for Guzzle (whose default is to wait forever), `CURLOPT_TIMEOUT`/`CURLOPT_CONNECTTIMEOUT` before `curl_exec`, `timeout`/`max_duration` on Symfony HttpClient (or `framework.http_client.default_options`), and a stream-context `timeout` or `connection_timeout` for `file_get_contents`/`SoapClient`. In Drupal, use the `http_client` service, which carries core's site-wide timeout, rather than `new Client()`. Add retries with back-off (Guzzle `Middleware::retry`, Symfony `RetryableHttpClient`, Laravel `->retry()`) around dependencies that fail.
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 · 131 plain JS — the untyped files are assets/admin/controller/auth/lock.js, assets/admin/controller/auth/login.js, assets/admin/controller/config/google2fa.js, assets/admin/controller/config/index.js, assets/admin/controller/config/lang.js, assets/admin/controller/config/mail.js (+125 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 Duplication3.9 / 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.
55 duplicated blocks under assets/admin/controller/ have copies in at least two of the sibling directories auth, config, dashboard, file, manage, pay (+4 more sibling(s) not listed) — 45 of them are reported below, and 10 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 55 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 55 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 55 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — assets/admin/controller/config/plugin.js:296
52 duplicated blocks under assets/ have copies in at least two of the sibling directories admin, common, static, user — 40 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 52 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — assets/common/js/component/authtree.js:9
6 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, business, dashboard, index, security, user under assets/user/controller/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — assets/user/controller/dashboard/index.js:3
assets/common/js/component/authtree.js:9 · assets/static/modules/authtree.js:9 — these 2 files are line-for-line copies of one another — 432 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — assets/common/js/component/authtree.js:9
assets/admin/controller/trade/card.js:141 · assets/user/controller/business/card.js:43 — the two spans are one implementation copied and then locally edited — 1578 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. — assets/admin/controller/trade/card.js:141
assets/admin/controller/config/mail.js:50 · assets/admin/controller/config/sms.js:73 — the two spans are one implementation copied and then locally edited — 668 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. — assets/admin/controller/config/mail.js:50
assets/admin/js/material.js:129 · assets/user/js/glass.js:392 — the two spans are one implementation copied and then locally edited — 761 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. — assets/admin/js/material.js:129
assets/user/controller/dashboard/index.js:3 · assets/user/controller/user/purchase.record.js:5 — the two spans are one implementation copied and then locally edited — 899 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. — assets/user/controller/dashboard/index.js:3
assets/admin/controller/config/plugin.js:296 · assets/admin/controller/pay/plugin.js:419 — 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. — assets/admin/controller/config/plugin.js:296
assets/admin/controller/trade/order.js:790 · assets/admin/controller/user/recharge.order.js:276 — 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. — assets/admin/controller/trade/order.js:790
assets/admin/controller/trade/commodity.js:272 · assets/user/controller/business/commodity.js:86 — 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. — assets/admin/controller/trade/commodity.js:272
assets/admin/controller/trade/commodity.js:830 · assets/user/controller/business/commodity.js:366 — 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. — assets/admin/controller/trade/commodity.js:830
assets/admin/controller/trade/commodity.js:333 · assets/user/controller/business/commodity.js:147 — 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. — assets/admin/controller/trade/commodity.js:333
assets/admin/controller/trade/commodity.js:414 · assets/user/controller/business/commodity.js:224 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — assets/admin/controller/trade/commodity.js:414
assets/user/controller/index/item.js:223 · assets/user/controller/user/recharge.js:26 — the two spans are one implementation copied and then locally edited — 592 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. — assets/user/controller/index/item.js:223
assets/static/acg.js:1075 · assets/user/js/treasure.js:11 — the two spans are one implementation copied and then locally edited — 495 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. — assets/static/acg.js:1075
assets/static/acg.js:11 · assets/user/controller/index/item.js:218 — the two spans are one implementation copied and then locally edited — 532 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. — assets/static/acg.js:11
assets/user/controller/business/business.js:180 · assets/user/controller/business/business.js:323 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — assets/user/controller/business/business.js:180
assets/admin/controller/trade/coupon.js:334 · assets/user/controller/business/coupon.js:96 — 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. — assets/admin/controller/trade/coupon.js:334
assets/admin/controller/user/index.js:481 · assets/admin/controller/user/index.js:529 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — assets/admin/controller/user/index.js:481
assets/user/controller/business/card.js:343 · assets/user/controller/business/coupon.js:313 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — assets/user/controller/business/card.js:343
assets/admin/controller/config/plugin.js:158 · assets/admin/controller/pay/plugin.js:52 — 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. — assets/admin/controller/config/plugin.js:158
assets/user/controller/business/card.js:103 · assets/user/controller/business/commodity.js:426 — 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. — assets/user/controller/business/card.js:103
assets/admin/controller/trade/card.js:201 · assets/admin/controller/trade/commodity.js:890 — 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. — assets/admin/controller/trade/card.js:201
assets/admin/controller/store/home.js:1221 · assets/admin/controller/store/home.js:1519 — 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. — assets/admin/controller/store/home.js:1221
assets/static/acg.js:298 · assets/static/pay.js:24 — 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. — assets/static/acg.js:298
assets/admin/controller/store/developer.js:640 · assets/admin/controller/store/home.js:1313 — 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. — assets/admin/controller/store/developer.js:640
assets/user/controller/business/card.js:305 · assets/user/controller/business/coupon.js:276 — the 2 copies are spread across 2 files, and the CITED SPAN is a DECLARATION HEADER — the name, parameter list with its constraints and defaults, and base-type clause of a declaration — rather than statements inside a body. A header cannot be lifted into a helper: there is no expression position for a call to stand in, and the copies are frequently required to match, because one declaration passes its parameters straight through to the other. So the move is not extraction. Give the repeated pieces names — factor a long constraint or base-type expression into one named type both declarations refer to — and where the headers must stay identical, derive one from the other (a shared base declaration, or a single alias that spells the parameter set once) so that changing it once changes both. Where the language offers neither, treat the two as a pair that must be edited together: they drift apart the first time only one of them is changed, which is why this is reported. — assets/user/controller/business/card.js:305
assets/admin/controller/trade/coupon.js:451 · assets/admin/controller/user/recharge.order.js:86 — 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. — assets/admin/controller/trade/coupon.js:451
REDACTED:309 · REDACTED:447 · REDACTED:1724 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:309
assets/admin/controller/user/cash.js:5 · assets/admin/controller/user/index.js:7 — 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. — assets/admin/controller/user/cash.js:5
assets/admin/js/mobile/recipes.js:1640 · assets/admin/js/mobile/recipes.js:1760 — 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. — assets/admin/js/mobile/recipes.js:1640
assets/admin/controller/config/plugin.js:47 · assets/admin/controller/dashboard/index.js:711 — 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. — assets/admin/controller/config/plugin.js:47
assets/admin/controller/trade/card.js:46 · assets/admin/controller/trade/coupon.js:47 — 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. — assets/admin/controller/trade/card.js:46
assets/admin/js/dict.js:83 · assets/user/js/dict.js:21 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — assets/admin/js/dict.js:83
assets/admin/controller/trade/order.js:298 · assets/admin/controller/user/index.js:95 — 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. — assets/admin/controller/trade/order.js:298
assets/user/controller/security/email.js:19 · assets/user/controller/security/phone.js:19 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — assets/user/controller/security/email.js:19
assets/admin/controller/config/google2fa.js:128 · assets/admin/controller/config/google2fa.js:180 — 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. — assets/admin/controller/config/google2fa.js:128
assets/admin/controller/trade/card.js:356 · assets/admin/controller/trade/coupon.js:458 · assets/admin/controller/user/recharge.order.js:94 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — assets/admin/controller/trade/card.js:356
assets/admin/controller/config/plugin.js:439 · assets/admin/controller/pay/plugin.js:567 — 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. — assets/admin/controller/config/plugin.js:439
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.
_docMouseMove has cyclomatic complexity 132 and cognitive complexity 229; 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:2968
inlineNormal has cyclomatic complexity 121 and cognitive complexity 180; 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:414
(anonymous) has cyclomatic complexity 116 and cognitive complexity 135; 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. — assets/static/modules/hex.js:351
(anonymous) has cyclomatic complexity 78 and cognitive complexity 74; 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. — assets/admin/js/mobile/fallback.js:2883
(anonymous) has cyclomatic complexity 68 and cognitive complexity 198; 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. — assets/static/acg.js:658
(anonymous) has cyclomatic complexity 63 and cognitive complexity 113; 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. — assets/static/codemirror/lib/codemirror.js:393
blockNormal has cyclomatic complexity 62 and cognitive complexity 66; 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:153
moveNode has cyclomatic complexity 57 and cognitive complexity 75; 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:3551
insertLineContent has cyclomatic complexity 56 and cognitive complexity 147; 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. — assets/static/codemirror/lib/codemirror.js:1921
upload has cyclomatic complexity 49 and cognitive complexity 75; 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. — assets/admin/controller/trade/card-file-upload.js:603
render has cyclomatic complexity 49 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 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. — assets/admin/js/mobile/fallback.js:2784
popup has cyclomatic complexity 44 and cognitive complexity 47; 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. — assets/common/js/component.js:339
tokenBase has cyclomatic complexity 43 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. — assets/static/codemirror/mode/javascript/javascript.js:66
(anonymous) has cyclomatic complexity 41 and cognitive complexity 40; 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. — assets/static/codemirror/lib/codemirror.js:14
statement has cyclomatic complexity 40 and cognitive complexity 46; 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. — assets/static/codemirror/mode/javascript/javascript.js:368
(anonymous) has cyclomatic complexity 39 and cognitive complexity 60; 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. — assets/static/codemirror/lib/codemirror.js:3232
(anonymous) has cyclomatic complexity 39 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — assets/static/modules/hex.js:647
indent has cyclomatic complexity 36 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — assets/static/codemirror/mode/javascript/javascript.js:895
renderRelated has cyclomatic complexity 36 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — assets/user/controller/user/ticket.detail.js:179
done has cyclomatic complexity 36 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. — assets/admin/controller/pay/api.js:105
measureCharInner has cyclomatic complexity 35 and cognitive complexity 49; 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. — assets/static/codemirror/lib/codemirror.js:2489
renderTreeContext has cyclomatic complexity 35 and cognitive complexity 46; 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. — assets/admin/js/mobile/fallback.js:2628
markText has cyclomatic complexity 34 and cognitive complexity 38; 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. — assets/static/codemirror/lib/codemirror.js:5968
getType has cyclomatic complexity 33 and cognitive complexity 59; 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:324
render has cyclomatic complexity 33 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — assets/common/js/component/authtree.js:45, assets/static/modules/authtree.js:45
success has cyclomatic complexity 33 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. — assets/user/js/glass.js:243
stretchSpansOverChange has cyclomatic complexity 32 and cognitive complexity 64; 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. — assets/static/codemirror/lib/codemirror.js:1372
buildToken has cyclomatic complexity 32 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. — assets/static/codemirror/lib/codemirror.js:1801
pollContent has cyclomatic complexity 32 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — assets/static/codemirror/lib/codemirror.js:9058
renderToolbar has cyclomatic complexity 32 and cognitive complexity 31; 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. — assets/admin/js/mobile/fallback.js:2193
submit has cyclomatic complexity 32 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. — assets/admin/controller/trade/order.js:785
(anonymous) has cyclomatic complexity 32 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:28
skipAtomicInner has cyclomatic complexity 31 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. — assets/static/codemirror/lib/codemirror.js:5202
presentPopup 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. — REDACTED:1130
submit 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. — assets/admin/controller/user/recharge.order.js:271
tokenBaseInner has cyclomatic complexity 30 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. — REDACTED:101
clear has cyclomatic complexity 30 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. — assets/static/codemirror/lib/codemirror.js:5858
onKey has cyclomatic complexity 30 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. — assets/admin/controller/trade/category-tree.js:1041
makeChkFlag has cyclomatic complexity 29 and cognitive complexity 54; 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:2278
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.
assets/static/codemirror/lib/codemirror.js has 8882 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/codemirror/lib/codemirror.js:1
REDACTED has 3978 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
assets/admin/js/mobile/fallback.js has 3083 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/js/mobile/fallback.js:1
REDACTED has 2923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
REDACTED has 1951 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
assets/admin/js/mobile/recipes.js has 1936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/js/mobile/recipes.js:1
assets/admin/controller/shared/store.js has 1876 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/shared/store.js:1
REDACTED has 1852 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
assets/admin/controller/store/home.js has 1588 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/store/home.js:1
assets/admin/controller/trade/commodity.js has 1488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/commodity.js:1
REDACTED has 1376 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
assets/admin/js/mobile/workflows.js has 1319 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/js/mobile/workflows.js:1
assets/admin/controller/trade/category-tree.js has 1286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/category-tree.js:1
assets/admin/controller/trade/card-file-upload.js has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/card-file-upload.js:1
assets/static/modules/hex.js has 1204 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/modules/hex.js:1
assets/common/js/util.js has 1166 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/common/js/util.js:1
assets/static/acg.js has 1130 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/acg.js:1
assets/admin/controller/trade/drag-sort.js has 1105 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/drag-sort.js:1
assets/common/js/editor/markdown/editorv2.js has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/common/js/editor/markdown/editorv2.js:1
assets/static/codemirror/mode/javascript/javascript.js has 914 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/codemirror/mode/javascript/javascript.js:1
assets/admin/controller/store/developer.js has 899 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/store/developer.js:1
assets/admin/controller/user/ticket.js has 872 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/user/ticket.js:1
assets/admin/controller/trade/order.js has 856 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/order.js:1
assets/admin/controller/pay/api.js has 851 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/pay/api.js:1
assets/admin/controller/dashboard/index.js 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. — assets/admin/controller/dashboard/index.js:1
assets/static/codemirror/mode/css/css.js has 808 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/codemirror/mode/css/css.js:1
assets/common/js/component.js has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/common/js/component.js:1
assets/admin/controller/user/index.js has 771 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/user/index.js:1
assets/common/js/component/authtree.js has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/common/js/component/authtree.js:1
assets/admin/controller/trade/coupon.js has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/coupon.js:1
assets/static/modules/authtree.js has 712 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/static/modules/authtree.js:1
assets/admin/controller/config/plugin.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/config/plugin.js:1
assets/admin/controller/trade/card.js has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/trade/card.js:1
assets/user/controller/business/commodity.js has 673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/user/controller/business/commodity.js:1
REDACTED has 671 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
assets/admin/controller/user/message.js has 610 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/user/message.js:1
assets/admin/controller/pay/plugin.js has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/pay/plugin.js:1
assets/admin/controller/config/index.js has 540 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/admin/controller/config/index.js:1
assets/common/js/component/search.js has 518 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/common/js/component/search.js:1
assets/user/js/glass.js has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — assets/user/js/glass.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 131 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.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — docker/nginx.conf:61
`sourceMap` is set explicitly here. The OWASP Secure Headers Project lists it among the response headers to REMOVE: it names the server, framework or tooling behind the application, which is exactly what an attacker looks up known exploits for. (No deduction on this card.) — assets/common/js/editor/editor.js:16
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Stop sending `sourceMap`: delete the write, and suppress the framework's own copy where it has one (Kestrel `AddServerHeader = false`, Express `app.disable('x-powered-by')` / `helmet.hidePoweredBy()`, nginx `server_tokens off`, IIS `<requestFiltering removeServerHeader="true" />`).
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 3/4 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.
`postOrderExportRequest` 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 })`. — assets/admin/controller/trade/order.js:694
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped5.6 / 10Adequate✓ 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.
`state.element.getAttribute('data-icon')` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `src` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `state.element.getAttribute('data-icon')` at this site, or validate it against the shape the position accepts before interpolating it. — assets/common/js/format.js:269
`escapeHtml(theme.icon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/config/index.js:235
`REGISTRY.map(langCard).join('')` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/config/lang.js:70
`String(value??'')` 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. (×4) — assets/admin/controller/config/plugin.js:46, assets/admin/controller/dashboard/index.js:710, assets/admin/controller/shared/priceTemplate.js:16, …
`this.updateNum` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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) — assets/admin/controller/config/plugin.js:177, assets/admin/controller/pay/plugin.js:72
`escapeHtml(icon.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. (×2) — assets/admin/controller/config/plugin.js:239, assets/admin/controller/store/developer.js:137
`escapeHtml(wiki.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/config/plugin.js:395
`escapeHtml(previewUrl)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/file/index.js:207
`item.version` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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. — assets/admin/controller/global.js:116
`item.content` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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. — assets/admin/controller/global.js:117
`item.update_url` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through the DOM library's `.append()` 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/global.js:118
`item.update_date` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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. — assets/admin/controller/global.js:119
`res.data.local` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/global.js:145
``[ ${i18n('更新')} v${res.data.version} ]`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/global.js:150
``${res.themePlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/global.js:183
``${res.generalPlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/global.js:187
``${res.payPlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/global.js:191
`avatar` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/manage/manage.js:100
`hit.icon` is text this program did not author, and it is written into a quoted attribute value through the DOM library's `.html()` 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. — assets/admin/controller/pay/api.js:405
`escapeHtml(safeImageUrl(item?.icon))` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. (×2) — assets/admin/controller/pay/plugin.js:129, assets/admin/controller/pay/plugin.js:406
`util.icon("fa-duotone fa-regular fa-rotate-right")+` ${i18n('继续导入失败商品(')}${stats.failed})`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/shared/store.js:884
`escapeHtml(favicon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/shared/store.js:1243
`escapeHtml(url.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. (×2) — assets/admin/controller/shared/store.js:1248, assets/admin/controller/store/developer.js:133
`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. — assets/admin/controller/store/developer.js:34
`escapeHtml(iconUrl)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/store/home.js:126
`escapeHtml(url)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/store/home.js:366
`escapeHtml(icon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/store/home.js:370
`title` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/store/home.js:394
`description` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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. — assets/admin/controller/store/home.js:395
`escapeHtml(item.icon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/store/home.js:1082
`state` 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. — assets/admin/controller/trade/card-file-upload.js:912
`esc(node.icon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/trade/category-tree.js:358
`escapeAttr(item.cover)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — assets/admin/controller/trade/commodity.js:1025
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.
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. (×29) — REDACTED:156, REDACTED:212, kernel/Util/Lang.php:91, …
`catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×6) — kernel/Util/Lang.php:652, kernel/Util/Lang.php:877, kernel/Util/Lang.php:898, …
`.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) — assets/user/js/webauthn.js:141, assets/user/js/webauthn.js:155, REDACTED:314
`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. — assets/static/acg.js:395
`catch (err)` 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. — assets/common/js/editor/markdown/editorv2.js:431
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 PHP's static analysis checks null and is not undermined by a nullness baseline — PHPStan from level 8 (`checkNullables`) or Psalm at `errorLevel` 3 or stricter is what makes `?User` a type whose method call is an error, and the null entries of a baseline, `@psalm-suppress PossiblyNull…` and `@phpstan-ignore *.nonObject` 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.
This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
What to do
Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — C3 reached only 42% of this repository's production lines — javascript (75,414 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
C4 Data Retention — C4 reached only 42% of this repository's production lines — javascript (75,414 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 50 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
AX1 Captive dependencies — Not applicable: this repository's PHP 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 — Not applicable: PHP builds its object graph per request and shares none of it between requests. 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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — openssl\"]; foreach ($need as $e) { if (!extension_loaded($e)) { fwrite(STDERR, \"缺少扩展 $e\\n\"); exit(1); } } if (!extension_loaded(\"Zend OPcache\")) { fwrite(STDERR, \"缺少 opcache\\n\"); exit(1); } if (!function_exists(\"imagecreatetruecolor\") || !function_exists(\"bcadd\")) { fwrite(STDERR, \"gd/bcmath 装上了但函数不可用\\n\"); exit(1); } echo \"扩展自检通过\\n\";'" did not complete successfully: exit code: 1; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — C1 reached only 42% of this repository's production lines — javascript (75,414 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route (no Laravel Route::…, no Symfony #[Route], no Filament panel, no WordPress REST route or AJAX action). Access control is therefore N/A here — a Composer library is authorized by the application that mounts it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D10 Test Quality — ~132 lines of test source are present (.php) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no .php test runner
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.
D32 Data Compliance (PII/GDPR) — 34 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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 included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (35 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); its 35 aggregate(s) are ORM models only — persistence, not behaviour: a CRUD model, measured, not claimed as DDD)
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'.
P8 Schema migrations — Laravel is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
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).
X13 Undrained process stream — 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
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. PHP gives a request one thread of its own; the event-loop libraries (ReactPHP, Amp) run callbacks one at a time, and ext-parallel copies every value across its channels, so no array or collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — X27 reached only 42% of this repository's production lines — javascript (75,414 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 120 finding(s)
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×26
Clickable element isn't keyboard-operable app/View/Admin/Config/Setting.html:51— The repo's own CSS styles .image-input-wrapper 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 app/View/Admin/Config/Setting.html:68— The repo's own CSS styles .btn with `cursor: pointer`, so this <span> 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 app/View/Admin/Header.html:348— The repo's own CSS styles .btn 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 app/View/Admin/Manage/Set.html:31— The repo's own CSS styles .image-input-wrapper 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 app/View/Admin/Manage/Set.html:47— The repo's own CSS styles .btn with `cursor: pointer`, so this <span> 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 app/View/Install.html:379— The repo's own CSS styles .chip with `cursor: pointer`, so this <span> 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 app/View/User/Theme/Cartoon/Authentication/Login.html:37— The repo's own CSS styles .image-code with `cursor: pointer`, so this <img> 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 app/View/User/Theme/Cartoon/Authentication/Register.html:86— The repo's own CSS styles .image-code with `cursor: pointer`, so this <img> 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 app/View/User/Theme/Cartoon/Index/Item.html:26— The repo's own CSS styles .shared-button with `cursor: pointer`, so this <span> 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 app/View/User/Theme/Cartoon/Index/Item.html:120— The repo's own CSS styles .captcha-img with `cursor: pointer`, so this <img> 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 assets/admin/controller/shared/store.js:1425— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/developer.js:654— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/developer.js:663— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1217— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1219— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1225— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1231— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1309— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1311— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1327— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1336— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1354— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1356— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1523— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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 assets/admin/controller/store/home.js:1529— The repo's own CSS styles .a-badge with `cursor: pointer`, so this <span> 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.
+ 1 more in this group — see findings.md.
AC2 · Forms & labels· <label> that labels no control · ×23
<label> that labels no control app/View/Admin/Config/Other.html:43— 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 app/View/Admin/Config/Other.html:117— 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 app/View/Admin/Config/Other.html:133— 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 app/View/Admin/Config/Other.html:183— 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 app/View/Admin/Config/Other.html:191— 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 app/View/Admin/Config/Other.html:202— 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 app/View/Admin/Config/Other.html:244— 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 app/View/Admin/Config/Other.html:260— 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 app/View/Admin/Config/Other.html:276— 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 app/View/Admin/Config/Other.html:294— 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 app/View/Admin/Config/Other.html:312— 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 app/View/Admin/Config/Other.html:331— 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 app/View/Admin/Config/Other.html:348— 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 app/View/Admin/Config/Other.html:365— 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 app/View/Admin/Config/Other.html:373— 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 app/View/Admin/Config/Other.html:383— 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 app/View/Admin/Config/Other.html:402— 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 app/View/Admin/Config/Other.html:417— 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 app/View/Admin/Config/Other.html:435— 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 app/View/Admin/Config/Other.html:479— 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 app/View/Admin/Config/Other.html:495— 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 app/View/Admin/Config/Other.html:514— 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 app/View/Admin/Config/Other.html:538— 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.
AC1 · Text alternatives· <img> without a text alternative · ×15
<img> without a text alternative app/View/User/Theme/Cartoon/Common/Header.html:73— 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 app/View/User/Theme/Cartoon/Common/Header.html:187— 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 app/View/User/Theme/Cartoon/Index/Item.html:11— 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 app/View/User/Theme/Cartoon/Index/Item.html:120— 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 app/View/User/Theme/Cartoon/User/Business.html:23— 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 assets/admin/controller/store/home.js:870— 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 assets/admin/controller/store/home.js:871— 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 assets/admin/controller/store/home.js:872— 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 assets/admin/controller/store/home.js:873— 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 assets/admin/controller/store/home.js:957— 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 assets/admin/controller/store/home.js:958— 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 assets/admin/controller/store/home.js:959— 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 assets/admin/controller/store/home.js:960— 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 assets/common/js/component.js:551— 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 assets/static/acg.js:977— 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· <input> without a programmatic label · ×13
<input> without a programmatic label app/View/Admin/Config/Other.html:48— 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 app/View/Admin/Config/Other.html:137— 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 app/View/Admin/Config/Other.html:188— 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 app/View/Admin/Config/Other.html:248— 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 app/View/Admin/Config/Other.html:264— 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 app/View/Admin/Config/Other.html:280— 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 app/View/Admin/Config/Other.html:335— 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 app/View/Admin/Config/Other.html:352— 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 app/View/Admin/Config/Other.html:370— 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 app/View/Admin/Config/Other.html:406— 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 app/View/Admin/Config/Other.html:421— 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 app/View/Admin/Config/Other.html:483— 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 app/View/Admin/Config/Other.html:499— 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.
Malformed <html lang> value "#{lang_code()}" app/View/Admin/Authentication/Lock.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
Malformed <html lang> value "#{lang_code()}" app/View/Admin/Authentication/Login.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
Malformed <html lang> value "#{lang_code()}" app/View/Admin/Config/Wiki.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
Malformed <html lang> value "#{lang_code()}" app/View/Admin/Header.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
Malformed <html lang> value "#{lang_code()}" app/View/User/Theme/Cartoon/Common/Header.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
Malformed <html lang> value "#{lang_code()}" app/View/User/Theme/Cartoon/Index/Header.html:2— The lang value isn't a well-formed BCP-47 language tag (use e.g. "en" or "en-US", not "english"/"en_US"), so assistive tech may apply the wrong language. Use a valid language subtag.
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label app/View/Admin/Config/Other.html:121— 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 app/View/Admin/Config/Other.html:387— 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.
AC2 · Forms & labels· <select> without a programmatic label · ×2
<select> without a programmatic label app/View/Admin/Config/Other.html:298— 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 app/View/Admin/Config/Other.html:519— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
Viewport restricts zoom app/View/User/Submit.html:4— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
Viewport restricts zoom app/View/User/Theme/Cartoon/Common/Header.html:6— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AC5 · ARIA correctness· aria-hidden hides a focusable element · ×2
aria-hidden hides a focusable element app/View/Admin/Authentication/Lock.html:35— aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
aria-hidden hides a focusable element app/View/Admin/Authentication/Login.html:36— aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
<html> without a lang app/View/Rewrite.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC5 · ARIA correctness· Invalid value "#{if $config.callback_ip_whitelist == 1}true#{else}false#{/if}" for aria-expanded · ×1
Invalid value "#{if $config.callback_ip_whitelist == 1}true#{else}false#{/if}" for aria-expanded app/View/Admin/Config/Other.html:67— "#{if $config.callback_ip_whitelist == 1}true#{else}false#{/if}" is not a valid value for aria-expanded — allowed: true, false, undefined.
AC5 · ARIA correctness· aria-hidden on a focusable element · ×1
aria-hidden on a focusable element assets/common/js/jquery.min.js:5339— aria-hidden="true" hides the element from assistive tech but leaves it keyboard-focusable — a confusing dead stop. Remove aria-hidden or make the element non-focusable.
Project dependency cycle REDACTED:14— The projects app → kernel → app form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
Banned license: smarty/smarty — `smarty/smarty` v3.1.46 is in the production `packages` list of this repository's REDACTED — what a `composer install --no-dev` puts in vendor/ — and every licence it declares is one this policy bans (`LGPL-3.0`). Where a package declares several licences it is charged only when all of them are banned. Replace the package, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Hotspot: REDACTED REDACTED:1— REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 1045 in tree.select.layui.define() at line 1. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/Service/Bind/Order.php app/Service/Bind/Order.php:644— app/Service/Bind/Order.php changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in Order.trade at line 644. 1 of those changes was a fix/bug commit, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Service/Bind/Order.php`: 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: app/Controller/User/Api/Commodity.php app/Controller/User/Api/Commodity.php:89— app/Controller/User/Api/Commodity.php changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in Commodity.save at line 89. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/User/Api/Commodity.php`: 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: app/Controller/Admin/Api/Commodity.php app/Controller/Admin/Api/Commodity.php:405— app/Controller/Admin/Api/Commodity.php changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in Commodity.save at line 405. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/Admin/Api/Commodity.php`: 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: app/Controller/Admin/Api/Pay.php app/Controller/Admin/Api/Pay.php:140— app/Controller/Admin/Api/Pay.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in Pay.paymentSaveMap at line 140. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/Admin/Api/Pay.php`: 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: app/Controller/Admin/Api/Store.php app/Controller/Admin/Api/Store.php:1086— app/Controller/Admin/Api/Store.php changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Store.addItem at line 1086. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/Admin/Api/Store.php`: 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: app/Controller/User/Api/Index.php app/Controller/User/Api/Index.php:68— app/Controller/User/Api/Index.php changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Index.commodity at line 68. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/User/Api/Index.php`: 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: app/Controller/Admin/Api/User.php app/Controller/Admin/Api/User.php:85— app/Controller/Admin/Api/User.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in User.save at line 85. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/Admin/Api/User.php`: 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: app/Controller/User/Api/Authentication.php app/Controller/User/Api/Authentication.php:48— app/Controller/User/Api/Authentication.php changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Authentication.register at line 48. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/User/Api/Authentication.php`: 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: app/Service/Bind/Shared.php app/Service/Bind/Shared.php:1032— app/Service/Bind/Shared.php changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in Shared.syncRemoteItem at line 1032. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Service/Bind/Shared.php`: 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: assets/admin/controller/config/index.js assets/admin/controller/config/index.js:144— assets/admin/controller/config/index.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in index._ThemeSetting at line 144. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/config/index.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: assets/admin/controller/trade/commodity.js assets/admin/controller/trade/commodity.js:162— assets/admin/controller/trade/commodity.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in commodity.modal at line 162. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/trade/commodity.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: assets/common/js/component.js assets/common/js/component.js:339— assets/common/js/component.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in Component.popup at line 339. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/common/js/component.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: REDACTED REDACTED:1348— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Config.emailFailureMessage at line 1348. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: assets/common/js/editor/markdown/editorv2.js assets/common/js/editor/markdown/editorv2.js:57— assets/common/js/editor/markdown/editorv2.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in editorv2.register at line 57. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/common/js/editor/markdown/editorv2.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: assets/admin/controller/shared/store.js assets/admin/controller/shared/store.js:350— assets/admin/controller/shared/store.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in store.mountRemoteProductPicker at line 350. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/shared/store.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: app/Controller/User/Api/Security.php app/Controller/User/Api/Security.php:53— app/Controller/User/Api/Security.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Security.personal at line 53. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/User/Api/Security.php`: 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: assets/admin/controller/store/home.js assets/admin/controller/store/home.js:827— assets/admin/controller/store/home.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in home._Bill at line 827. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/store/home.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: assets/static/acg.js assets/static/acg.js:1073— assets/static/acg.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in acg.acgSecretPopup at line 1073. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/static/acg.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: app/Service/Bind/Shop.php app/Service/Bind/Shop.php:124— app/Service/Bind/Shop.php changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Shop.getItem at line 124. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Service/Bind/Shop.php`: 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: assets/admin/controller/trade/order.js assets/admin/controller/trade/order.js:260— assets/admin/controller/trade/order.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in order.mobileDeliverySubmit.<returned closure> at line 260. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/trade/order.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: app/Service/Bind/App.php app/Service/Bind/App.php:216— app/Service/Bind/App.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in App.updatePlugin at line 216. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Service/Bind/App.php`: 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: assets/common/js/util.js assets/common/js/util.js:355— assets/common/js/util.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Util._verifyDialog at line 355. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/common/js/util.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: assets/admin/controller/trade/coupon.js assets/admin/controller/trade/coupon.js:204— assets/admin/controller/trade/coupon.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in coupon.createCoupon at line 204. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- assets/admin/controller/trade/coupon.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: app/Controller/Base/View/User.php app/Controller/Base/View/User.php:55— app/Controller/Base/View/User.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in User.theme at line 55. 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-08..2026-11-06, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-08 04:23:41 -08:00' --until='2026-11-06 04:23:41 -08:00' --full-history --no-merges -- app/Controller/Base/View/User.php`: 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.
+ 26 more in this group — see findings.md.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×39
Untrusted text written into markup unescaped assets/admin/controller/config/index.js:235— `escapeHtml(theme.icon)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/config/lang.js:70— `REGISTRY.map(langCard).join('')` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/config/plugin.js:46— `String(value??'')` 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 assets/admin/controller/config/plugin.js:177— `this.updateNum` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/config/plugin.js:239— `escapeHtml(icon.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/config/plugin.js:395— `escapeHtml(wiki.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/dashboard/index.js:710— `String(value??'')` 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 assets/admin/controller/file/index.js:207— `escapeHtml(previewUrl)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/global.js:116— `item.version` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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 assets/admin/controller/global.js:117— `item.content` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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 assets/admin/controller/global.js:118— `item.update_url` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through the DOM library's `.append()` 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/global.js:119— `item.update_date` is text this program did not author, and it is written into the text of an element through the DOM library's `.append()` 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 assets/admin/controller/global.js:145— `res.data.local` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/global.js:150— ``[ ${i18n('更新')} v${res.data.version} ]`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/global.js:183— ``${res.themePlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/global.js:187— ``${res.generalPlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/global.js:191— ``${res.payPlugin}${i18n('个更新')}`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/manage/manage.js:100— `avatar` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/pay/api.js:405— `hit.icon` is text this program did not author, and it is written into a quoted attribute value through the DOM library's `.html()` 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 assets/admin/controller/pay/plugin.js:72— `this.updateNum` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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 assets/admin/controller/pay/plugin.js:129— `escapeHtml(safeImageUrl(item?.icon))` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/pay/plugin.js:406— `escapeHtml(safeImageUrl(item?.icon))` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped assets/admin/controller/shared/priceTemplate.js:16— `String(value??'')` 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 assets/admin/controller/shared/store.js:217— `String(value??'')` 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 assets/admin/controller/shared/store.js:884— `util.icon("fa-duotone fa-regular fa-rotate-right")+` ${i18n('继续导入失败商品(')}${stats.failed})`` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` 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: lib/codemirror.js assets/static/codemirror/lib/codemirror.js— FileTooLong — 6578 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 5078 over it, 4.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 3019 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 1519 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: mobile/fallback.js assets/admin/js/mobile/fallback.js— FileTooLong — 2616 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 1116 over it, 1.74× 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 — 1864 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 1364 over it, 3.73× 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: mobile/recipes.js assets/admin/js/mobile/recipes.js— FileTooLong — 1554 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 54 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1521 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 100% of them inside a single declaration: Form (1-2161). The bar is 1500 significant lines; this is 21 over it, 1.01× 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: shared/store.js assets/admin/controller/shared/store.js— FileTooLong — 1505 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 5 over it, 1.00× 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 — 1307 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 807 over it, 2.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/home.js assets/admin/controller/store/home.js— FileTooLong — 1274 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 774 over it, 2.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1152 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 652 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: mobile/workflows.js assets/admin/js/mobile/workflows.js— FileTooLong — 1089 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 589 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: trade/commodity.js assets/admin/controller/trade/commodity.js— FileTooLong — 1065 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 565 over it, 2.13× 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: Bind/Order.php app/Service/Bind/Order.php— FileTooLong — 999 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Order (46-1669). The bar is 500 significant lines; this is 499 over it, 2.00× 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: Bind/Ticket.php app/Service/Bind/Ticket.php— FileTooLong — 998 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Ticket (29-1481). The bar is 500 significant lines; this is 498 over it, 2.00× 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: REDACTED REDACTED— FileTooLong — 935 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Config (33-1388). The bar is 500 significant lines; this is 435 over it, 1.87× 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: modules/hex.js assets/static/modules/hex.js— FileTooLong — 919 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 419 over it, 1.84× 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: Api/Store.php app/Controller/Admin/Api/Store.php— FileTooLong — 913 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Store (28-1449). The bar is 500 significant lines; this is 413 over it, 1.83× 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: static/acg.js assets/static/acg.js— FileTooLong — 875 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 83% of them inside a single declaration: acg (96-1066). The bar is 500 significant lines; this is 375 over it, 1.75× 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/util.js assets/common/js/util.js— FileTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: util (1-1276). The bar is 500 significant lines; this is 321 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: markdown/editorv2.js assets/common/js/editor/markdown/editorv2.js— FileTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 318 over it, 1.64× 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: View/Install.html app/View/Install.html— FileTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 297 over it, 1.59× 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: user/ticket.js assets/admin/controller/user/ticket.js— FileTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 242 over it, 1.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: javascript/javascript.js assets/static/codemirror/mode/javascript/javascript.js— FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 233 over it, 1.47× 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: css/css.js assets/static/codemirror/mode/css/css.js— FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 225 over it, 1.45× 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: store/developer.js assets/admin/controller/store/developer.js— FileTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 177 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Swallowed exception (empty catch) REDACTED:156— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:212— 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) kernel/Util/Lang.php:91— 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) kernel/Util/Lang.php:512— 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) kernel/Util/Lang.php:661— 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) kernel/Util/Lang.php:710— 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) kernel/Util/Lang.php:963— 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) kernel/Util/Lang.php:970— 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) assets/user/js/glass.js:489— 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) assets/user/js/webauthn.js:141— `.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) assets/user/js/webauthn.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) assets/user/js/webauthn.js:155— `.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) assets/user/js/webauthn.js:158— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:294— 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) assets/user/controller/security/totp.js:268— 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) assets/static/acg.js:141— 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) assets/static/acg.js:1182— 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) assets/static/jquery.pjax.js:302— 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) assets/static/codemirror/lib/codemirror.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) assets/static/codemirror/lib/codemirror.js:689— 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) assets/static/codemirror/lib/codemirror.js:6599— 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) assets/static/codemirror/lib/codemirror.js:8950— 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) assets/static/codemirror/lib/codemirror.js:9504— 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) assets/static/codemirror/lib/codemirror.js:9730— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:36— 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.
(anonymous)::(anonymous)::onMousedownNode::_docMouseMove (cognitive 229) REDACTED:2968— (anonymous)::(anonymous)::onMousedownNode::_docMouseMove has cognitive complexity 229 (threshold 15). Drivers by points: if/else 46 (118 pts), boolean chains 54, ternaries 11 (42 pts), loops 6 (15 pts) (nesting depth added 112). 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.
(anonymous)::(anonymous)::moveNode (cognitive 75) REDACTED:3551— (anonymous)::(anonymous)::moveNode has cognitive complexity 75 (threshold 15). Drivers by points: if/else 41 (55 pts), boolean chains 14, loops 2 (4 pts), ternaries 2 (nesting depth added 16). 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.
(anonymous)::(anonymous)::checkNodeRelation (cognitive 60) REDACTED:2369— (anonymous)::(anonymous)::checkNodeRelation has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (11 pts), boolean chains 8, ternaries 1 (4 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous)::(anonymous)::makeChkFlag (cognitive 54) REDACTED:2278— (anonymous)::(anonymous)::makeChkFlag has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 3 (15 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 27). 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.
(anonymous)::tokenBaseInner (cognitive 43) REDACTED:101— (anonymous)::tokenBaseInner has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::render (cognitive 34) assets/static/modules/authtree.js:45— (anonymous)::render has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 26, if/else 6 (7 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.
(anonymous)::render (cognitive 34) assets/common/js/component/authtree.js:45— (anonymous)::render has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 26, if/else 6 (7 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.
(anonymous)::(anonymous)::setSonNodeCheckBox (cognitive 33) REDACTED:2542— (anonymous)::(anonymous)::setSonNodeCheckBox has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (8 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous)::(anonymous)::onMousedownNode::_docMouseUp::dropCallback (cognitive 33) REDACTED:3312— (anonymous)::(anonymous)::onMousedownNode::_docMouseUp::dropCallback has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (11 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::(anonymous)::expandCollapseNode (cognitive 32) REDACTED:1203— (anonymous)::(anonymous)::expandCollapseNode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8 (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.
(anonymous)::(anonymous)::_eventProxy (cognitive 29) REDACTED:221— (anonymous)::(anonymous)::_eventProxy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::(anonymous)::onMousedownNode::_docMouseUp (cognitive 29) REDACTED:3266— (anonymous)::(anonymous)::onMousedownNode::_docMouseUp has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::tokenLexer (cognitive 28) REDACTED:300— (anonymous)::tokenLexer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::submit (cognitive 27) assets/admin/controller/trade/order.js:785— (anonymous)::submit has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), other 3, ternaries 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.
(anonymous)::submit (cognitive 27) assets/admin/controller/user/recharge.order.js:271— (anonymous)::submit has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (10 pts), other 3, ternaries 2, 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.
(anonymous)::(anonymous)::setParentNodeCheckBox (cognitive 23) REDACTED:2512— (anonymous)::(anonymous)::setParentNodeCheckBox has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::submit (cognitive 21) assets/admin/controller/trade/card.js:656— (anonymous)::submit has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 5, error handling 1, other 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.
(anonymous)::formatStringFactory::tokenString (cognitive 21) REDACTED:205— (anonymous)::formatStringFactory::tokenString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 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.
(anonymous)::popup::success::(anonymous)::render (cognitive 20) assets/static/modules/hex.js:1102— (anonymous)::popup::success::(anonymous)::render has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13, 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.
(anonymous)::(anonymous)::appendNodes (cognitive 20) REDACTED:977— (anonymous)::(anonymous)::appendNodes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, 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.
(anonymous)::(anonymous)::_eventProxy (cognitive 18) REDACTED:2081— (anonymous)::(anonymous)::_eventProxy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, match/switch 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.
(anonymous)::(anonymous)::transformTozTreeFormat (cognitive 17) REDACTED:712— (anonymous)::(anonymous)::transformTozTreeFormat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 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.
(anonymous)::(anonymous)::asyncNode (cognitive 17) REDACTED:1040— (anonymous)::(anonymous)::asyncNode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous)::tokenBase (cognitive 17) REDACTED:78— (anonymous)::tokenBase has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5 (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.
(anonymous)::_treeToSelect (cognitive 16) assets/static/modules/authtree.js:407— (anonymous)::_treeToSelect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionTooLong: tree.select.layui.define() REDACTED:1— FunctionTooLong — layui.define() runs 3019 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2919 over it, 30.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: hex.layui.define() assets/static/modules/hex.js:1— FunctionTooLong — layui.define() runs 919 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 819 over it, 9.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: authtree.layui.define() assets/common/js/component/authtree.js:9— FunctionTooLong — layui.define() runs 481 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 381 over it, 4.81× 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: commodity.modal assets/admin/controller/trade/commodity.js:162— FunctionTooLong — modal runs 446 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 346 over it, 4.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.
FunctionTooLong: authtree.layui.define() assets/static/modules/authtree.js:9— FunctionTooLong — layui.define() runs 441 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 341 over it, 4.41× 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: menu.KTMenu REDACTED:1526— FunctionTooLong — KTMenu runs 414 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 314 over it, 4.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.
FunctionTooLong: codemirror.addEditorMethods assets/static/codemirror/lib/codemirror.js:8268— FunctionTooLong — addEditorMethods runs 322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: fallback.render assets/admin/js/mobile/fallback.js:2784— FunctionTooLong — render runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: css.CodeMirror.defineMode("css") assets/static/codemirror/mode/css/css.js:14— FunctionTooLong — CodeMirror.defineMode("css") runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: store.mountRemoteProductPicker assets/admin/controller/shared/store.js:350— FunctionTooLong — mountRemoteProductPicker runs 291 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× 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: xml.CodeMirror.defineMode("xml") assets/static/codemirror/mode/xml/xml.js:59— FunctionTooLong — CodeMirror.defineMode("xml") runs 268 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: index._ThemeSetting assets/admin/controller/config/index.js:144— FunctionTooLong — _ThemeSetting runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: commodity.modal assets/user/controller/business/commodity.js:36— FunctionTooLong — modal runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.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.
FunctionTooLong: coupon.createCoupon assets/admin/controller/trade/coupon.js:204— FunctionTooLong — createCoupon 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.
FunctionTooLong: group.CommodityGroupModal assets/admin/controller/user/group.js:181— FunctionTooLong — CommodityGroupModal runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: api.modal assets/admin/controller/pay/api.js:496— FunctionTooLong — modal runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: menu.KTDrawer REDACTED:3267— FunctionTooLong — KTDrawer runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× 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: message.openComposer assets/admin/controller/user/message.js:360— FunctionTooLong — openComposer runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× 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: card.uploadCard assets/admin/controller/trade/card.js:104— FunctionTooLong — uploadCard runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× 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: menu.KTScroll REDACTED:2782— FunctionTooLong — KTScroll runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× 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: commodity.uploadCard assets/admin/controller/trade/commodity.js:793— FunctionTooLong — uploadCard runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: card.uploadCard assets/user/controller/business/card.js:17— FunctionTooLong — uploadCard runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: commodity.uploadCard assets/user/controller/business/commodity.js:341— FunctionTooLong — uploadCard runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemirror.defineOptions assets/static/codemirror/lib/codemirror.js:7708— FunctionTooLong — defineOptions 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.
FunctionTooLong: jquery.pjax.pjax assets/static/jquery.pjax.js:166— FunctionTooLong — pjax 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.
(anonymous)::(anonymous)::onMousedownNode::_docMouseMove (cyclomatic 132) REDACTED:2968— (anonymous)::(anonymous)::onMousedownNode::_docMouseMove has cyclomatic complexity 132 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous)::(anonymous)::moveNode (cyclomatic 57) REDACTED:3551— (anonymous)::(anonymous)::moveNode has cyclomatic complexity 57 (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.
(anonymous)::render (cyclomatic 33) assets/static/modules/authtree.js:45— (anonymous)::render 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.
(anonymous)::render (cyclomatic 33) assets/common/js/component/authtree.js:45— (anonymous)::render 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.
(anonymous)::submit (cyclomatic 32) assets/admin/controller/trade/order.js:785— (anonymous)::submit has cyclomatic complexity 32 (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.
(anonymous)::submit (cyclomatic 31) assets/admin/controller/user/recharge.order.js:271— (anonymous)::submit 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.
(anonymous)::tokenBaseInner (cyclomatic 30) REDACTED:101— (anonymous)::tokenBaseInner 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.
(anonymous)::(anonymous)::makeChkFlag (cyclomatic 29) REDACTED:2278— (anonymous)::(anonymous)::makeChkFlag 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.
(anonymous)::(anonymous)::onMousedownNode::_docMouseUp (cyclomatic 28) REDACTED:3266— (anonymous)::(anonymous)::onMousedownNode::_docMouseUp 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.
(anonymous)::(anonymous)::checkNodeRelation (cyclomatic 27) REDACTED:2369— (anonymous)::(anonymous)::checkNodeRelation 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.
(anonymous)::tokenLexer (cyclomatic 26) REDACTED:300— (anonymous)::tokenLexer 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.
(anonymous)::submit (cyclomatic 25) assets/admin/controller/trade/card.js:656— (anonymous)::submit 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.
(anonymous)::(anonymous)::_eventProxy (cyclomatic 24) REDACTED:221— (anonymous)::(anonymous)::_eventProxy 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.
(anonymous)::(anonymous)::expandCollapseNode (cyclomatic 22) REDACTED:1203— (anonymous)::(anonymous)::expandCollapseNode 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.
(anonymous)::popup::success::(anonymous)::render (cyclomatic 21) assets/static/modules/hex.js:1102— (anonymous)::popup::success::(anonymous)::render 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.
(anonymous)::(anonymous)::setSonNodeCheckBox (cyclomatic 20) REDACTED:2542— (anonymous)::(anonymous)::setSonNodeCheckBox 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.
(anonymous)::(anonymous)::init::expandNode (cyclomatic 17) REDACTED:1804— (anonymous)::(anonymous)::init::expandNode 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.
(anonymous)::(anonymous)::_eventProxy (cyclomatic 17) REDACTED:2081— (anonymous)::(anonymous)::_eventProxy 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.
(anonymous)::(anonymous)::appendNodes (cyclomatic 16) REDACTED:977— (anonymous)::(anonymous)::appendNodes 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.
(anonymous)::(anonymous)::setParentNodeCheckBox (cyclomatic 16) REDACTED:2512— (anonymous)::(anonymous)::setParentNodeCheckBox 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.
MethodTooLong: Order.trade app/Service/Bind/Order.php:644— MethodTooLong — trade runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: Component.popup assets/common/js/component.js:339— MethodTooLong — popup runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Store.addItem app/Controller/Admin/Api/Store.php:1086— MethodTooLong — addItem runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× 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: _Dict.constructor assets/admin/js/dict.js:2— MethodTooLong — constructor 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: Index.commodity app/Controller/User/Api/Index.php:68— MethodTooLong — commodity runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Commodity.save app/Controller/Admin/Api/Commodity.php:405— MethodTooLong — save runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Util._verifyDialog assets/common/js/util.js:355— MethodTooLong — _verifyDialog runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Commodity.save app/Controller/User/Api/Commodity.php:89— MethodTooLong — save 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: User.save app/Controller/Admin/Api/User.php:85— MethodTooLong — save runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Form.createForm REDACTED:1899— MethodTooLong — createForm 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: Manage.save app/Controller/Admin/Api/Manage.php:120— MethodTooLong — save 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: CommodityGroup.mobileCommodityTree app/Controller/Admin/Api/CommodityGroup.php:214— MethodTooLong — mobileCommodityTree runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Category.safeCategoryDeleteImpact app/Controller/Admin/Api/Category.php:83— MethodTooLong — safeCategoryDeleteImpact runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Mcp.tools app/Service/Bind/Mcp.php:54— MethodTooLong — tools 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: Commodity.commodityDeleteImpact app/Controller/Admin/Api/Commodity.php:141— MethodTooLong — commodityDeleteImpact runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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: Coupon.save app/Controller/Admin/Api/Coupon.php:254— MethodTooLong — save runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.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.
ClassTooLong: Form REDACTED:1— ClassTooLong — 1521 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 1121 over it, 3.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: Ticket app/Service/Bind/Ticket.php:29— ClassTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 573 over it, 2.43× 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: Order app/Service/Bind/Order.php:46— ClassTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 557 over it, 2.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Config REDACTED:32— ClassTooLong — 907 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 507 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: Store app/Controller/Admin/Api/Store.php:27— ClassTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 492 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: acg assets/static/acg.js:1— ClassTooLong — 729 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 329 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Shared app/Service/Bind/Shared.php:21— ClassTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 206 over it, 1.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Commodity app/Controller/Admin/Api/Commodity.php:29— ClassTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 194 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Card app/Controller/Admin/Api/Card.php:26— ClassTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 184 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Lang kernel/Util/Lang.php:18— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 112 over it, 1.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: Security app/Controller/User/Api/Security.php:23— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 31 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: Pay app/Controller/Admin/Api/Pay.php:32— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Category app/Controller/Admin/Api/Category.php:33— ClassTooLong — 441 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 41 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.
ClassTooLong: Mcp app/Service/Bind/Mcp.php:36— ClassTooLong — 433 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 33 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Order app/Controller/Admin/Api/Order.php:25— ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 13 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: Form REDACTED:1— TooManyMethods — 83 methods. The bar is 30 methods; this is 53 over it, 2.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: Table REDACTED:61— TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Util assets/common/js/util.js:1— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.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: Ticket app/Service/Bind/Ticket.php:29— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: Config REDACTED:32— 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: Format assets/common/js/format.js:1— 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: Search assets/common/js/component/search.js:1— 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: Shared app/Service/Bind/Shared.php:21— 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: Store app/Controller/Admin/Api/Store.php: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: Lang kernel/Util/Lang.php:18— 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: Client app/Util/Client.php:14— 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: Order app/Service/Bind/Order.php:46— 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: App REDACTED:18— 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: Security app/Controller/User/Api/Security.php:23— 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 (6 lines × 2) app/Controller/Admin/Api/Order.php:640— app/Controller/Admin/Api/Order.php:640-645 | app/Controller/Admin/Api/RechargeOrder.php:492-497 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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) app/Interceptor/ManageSession.php:34— app/Interceptor/ManageSession.php:34-39 | app/Interceptor/UserSession.php:28-33 — 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) app/Util/RichHtml.php:138— app/Util/RichHtml.php:138-143 | kernel/Waf/Firewall.php:117-122 — 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 `app/Util/RichHtml.php:138` 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) app/Interceptor/Business.php:40— app/Interceptor/Business.php:40-45 | app/Interceptor/Store.php:39-44 — 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) app/Interceptor/Owner.php:38— app/Interceptor/Owner.php:38-43 | app/Interceptor/Super.php:38-43 — before extracting anything, compare `app/Interceptor/Owner.php` and `app/Interceptor/Super.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) app/Service/ManageSessionManager.php:147— app/Service/ManageSessionManager.php:147-152 | app/Service/UserSessionManager.php:152-157 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 × 2) app/Util/Date.php:140— app/Util/Date.php:140-145 | kernel/Util/Date.php:155-160 — 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) app/Service/ManageSessionManager.php:137— app/Service/ManageSessionManager.php:137-142 | app/Service/UserSessionManager.php:142-147 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 × 2) app/Controller/Base/View/User.php:105— app/Controller/Base/View/User.php:105-110 | app/Controller/Base/View/UserPlugin.php:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) app/Controller/User/Api/Card.php:251— app/Controller/User/Api/Card.php:251-256 | app/Controller/User/Api/Card.php:264-269 — both copies are in the same file, so extract the 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) app/Controller/User/Api/Security.php:252— app/Controller/User/Api/Security.php:252-257 | app/Controller/User/Api/Security.php:279-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.
Duplicated block (6 lines × 2) app/Service/Bind/Shared.php:808— app/Service/Bind/Shared.php:808-813 | app/Service/Bind/Shared.php:826-831 — both copies are in the same file, so extract the 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) app/Controller/Admin/Api/Card.php:172— app/Controller/Admin/Api/Card.php:172-178 | app/Controller/Admin/Api/Coupon.php: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 `app/Controller/Admin/Api/Card.php:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) app/Controller/Admin/Api/Coupon.php:516— app/Controller/Admin/Api/Coupon.php:516-522 | app/Controller/Admin/Api/Coupon.php:560-566 — both copies are in the same file, so extract the 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) app/Controller/Admin/Api/Order.php:648— app/Controller/Admin/Api/Order.php:648-654 | app/Controller/Admin/Api/RechargeOrder.php:500-506 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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) app/Controller/Admin/Api/Order.php:659— app/Controller/Admin/Api/Order.php:659-665 | app/Controller/Admin/Api/RechargeOrder.php:511-517 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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 `app/Controller/Admin/Api/Order.php:659` 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) app/Controller/Admin/Api/Upload.php:71— app/Controller/Admin/Api/Upload.php:71-77 | app/Controller/User/Api/Upload.php:82-88 — 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 `app/Controller/Admin/Api/Upload.php:71` 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) app/Service/Bind/Ticket.php:386— app/Service/Bind/Ticket.php:386-392 | app/Service/Bind/Ticket.php:411-417 — both copies are in the same file, so extract the 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) app/Service/ManageWebauthnService.php:78— app/Service/ManageWebauthnService.php:78-84 | app/Service/UserWebauthnService.php:104-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/Service/ManageWebauthnService.php:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/Service/ManageWebauthnService.php:85` calls `JSONException`, `getMessage`, `query` and `app/Service/UserWebauthnService.php:111` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) app/Util/CardFile/Purge.php:48— app/Util/CardFile/Purge.php:48-54 | app/Util/CardFile/Purge.php:92-98 — both copies are in the same file, so extract the 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 `app/Util/CardFile/Purge.php:48` 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) app/Controller/User/Api/Security.php:233— app/Controller/User/Api/Security.php:233-239 | app/Controller/User/Api/Security.php:618-624 — both copies are in the same file, so extract the 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 `app/Controller/User/Api/Security.php:233` 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.
AC3 · Page structure· Page without a main landmark · ×8
Page without a main landmark app/View/Admin/Config/Wiki.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 app/View/Admin/Header.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 app/View/LegalTerms.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 app/View/Rewrite.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 app/View/User/Submit.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 app/View/User/Theme/Cartoon/Authentication/Header.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 app/View/User/Theme/Cartoon/Common/Header.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 app/View/User/Theme/Cartoon/Index/Header.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Swallowed exception (caught, then discarded) kernel/Util/Lang.php:652— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) kernel/Util/Lang.php:877— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) kernel/Util/Lang.php:898— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) kernel/Util/Lang.php:1095— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) kernel/Util/Lang.php:1134— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) kernel/Util/RequestLogger.php:150— `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) assets/static/acg.js:395— `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.
Swallowed exception (caught, then discarded) assets/common/js/editor/markdown/editorv2.js:431— `catch (err)` 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 block (12 lines × 2) app/Controller/Admin/Api/Order.php:49— app/Controller/Admin/Api/Order.php:49-60 | app/Controller/Admin/Api/RechargeOrder.php:45-56 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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 `app/Controller/Admin/Api/Order.php:49` 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) app/Controller/Shared/Commodity.php:444— app/Controller/Shared/Commodity.php:444-455 | app/Controller/User/Api/Index.php:335-346 — 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 `app/Controller/Shared/Commodity.php:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) app/Service/Bind/Message.php:159— app/Service/Bind/Message.php:159-170 | app/Service/Bind/Message.php:174-185 — both copies are in the same file, so extract the 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 `app/Service/Bind/Message.php:159` 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) app/Service/Bind/Order.php:680— app/Service/Bind/Order.php:680-691 | app/Service/Bind/Shop.php:150-161 — 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) app/Service/ManageSessionManager.php:77— app/Service/ManageSessionManager.php:77-88 | app/Service/UserSessionManager.php:77-88 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 (12 lines × 2) app/Service/ManageSessionManager.php:262— app/Service/ManageSessionManager.php:262-273 | app/Service/UserSessionManager.php:271-282 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 (12 lines × 2) app/Controller/Admin/Api/Card.php:698— app/Controller/Admin/Api/Card.php:698-709 | app/Controller/Admin/Api/Card.php:717-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) app/Controller/Admin/Api/Upload.php:145— app/Controller/Admin/Api/Upload.php:145-152 | app/Controller/User/Api/Upload.php:181-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Upload.php:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/Controller/User/Api/Authentication.php:207— app/Controller/User/Api/Authentication.php:207-214 | app/Controller/User/Api/Authentication.php:232-239 — both copies are in the same file, so extract the 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 `app/Controller/User/Api/Authentication.php:207` 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) app/Controller/User/Api/Authentication.php:273— app/Controller/User/Api/Authentication.php:273-280 | app/Controller/User/Api/Authentication.php:299-306 — both copies are in the same file, so extract the 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 `app/Controller/User/Api/Authentication.php:273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) app/Model/Config.php:561— app/Model/Config.php:561-568 | app/Model/Config.php:620-627 — both copies are in the same file, so extract the 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 `app/Model/Config.php:561` 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) app/Service/ManageSessionManager.php:40— app/Service/ManageSessionManager.php:40-47 | app/Service/UserSessionManager.php:44-51 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 (8 lines × 2) app/Controller/Admin/Api/Message.php:82— app/Controller/Admin/Api/Message.php:82-89 | app/Controller/User/Api/Message.php:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) app/Controller/Admin/Api/Card.php:387— app/Controller/Admin/Api/Card.php:387-400 | app/Controller/User/Api/Card.php:132-145 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Card.php:387` 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 (14 lines × 2) app/Controller/Admin/Api/Card.php:571— app/Controller/Admin/Api/Card.php:571-584 | app/Controller/Admin/Api/CardFile.php:274-287 — 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 (14 lines × 2) app/Service/Bind/Message.php:1046— app/Service/Bind/Message.php:1046-1059 | app/Service/Bind/Ticket.php:1367-1380 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/Service/Bind/Message.php:1044` calls `getimagesize`, `is_array`, `strtolower` and `app/Service/Bind/Ticket.php:1366` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) app/Service/Bind/Order.php:572— app/Service/Bind/Order.php:572-585 | app/Service/Bind/Order.php:597-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/Util/Tree.php:17— app/Util/Tree.php:17-30 | kernel/Util/Tree.php:16-29 — before extracting anything, compare `app/Util/Tree.php` and `kernel/Util/Tree.php` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:251— app/Controller/Admin/Api/BusinessLevel.php:251-260 | app/Controller/Admin/Api/Group.php:206-215 — before extracting anything, compare `app/Controller/Admin/Api/BusinessLevel.php` and `app/Controller/Admin/Api/Group.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 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 `app/Controller/Admin/Api/BusinessLevel.php:251` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) app/Controller/Admin/Api/Manage.php:206— app/Controller/Admin/Api/Manage.php:206-215 | app/Controller/Admin/Api/Manage.php:306-315 — both copies are in the same file, so extract the 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) app/Controller/Admin/Api/User.php:388— app/Controller/Admin/Api/User.php:388-397 | app/Controller/Admin/Api/User.php:515-524 — both copies are in the same file, so extract the 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 `app/Controller/Admin/Api/User.php:388` 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) app/Service/Bind/Message.php:92— app/Service/Bind/Message.php:92-101 | app/Service/Bind/Message.php:272-281 — both copies are in the same file, so extract the 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) app/Util/UploadPurge.php:104— app/Util/UploadPurge.php:104-113 | app/Util/UploadPurge.php:115-124 — both copies are in the same file, so extract the 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) app/Controller/Admin/Api/Commodity.php:645— app/Controller/Admin/Api/Commodity.php:645-649 | app/Controller/Admin/Api/Commodity.php:698-704 — both copies are in the same file, so extract the 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 `app/Controller/Admin/Api/Commodity.php:645` 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) app/Controller/Admin/Api/Manage.php:485— app/Controller/Admin/Api/Manage.php:485-489 | app/Controller/User/Api/Security.php:668-672 — 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 (5 lines × 2) app/Controller/User/Api/Bill.php:31— app/Controller/User/Api/Bill.php:31-35 | app/Controller/User/Api/Cash.php:153-157 — 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) app/Service/Bind/Order.php:296— app/Service/Bind/Order.php:296-300 | app/Service/Bind/Order.php:437-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/Service/Bind/Order.php:296` 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) app/Service/Bind/Shared.php:819— app/Service/Bind/Shared.php:819-823 | app/Service/Bind/Shared.php:836-840 — both copies are in the same file, so extract the 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 `app/Service/Bind/Shared.php:819` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/Service/Bind/Shared.php:826` calls `array_key_exists`, `is_array`, `foreach` and `app/Service/Bind/Shared.php:842` 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.
python.CodeMirror.defineMode("python")::tokenBaseInner (cognitive 43) REDACTED:101— python.CodeMirror.defineMode("python")::tokenBaseInner has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (python.CodeMirror.defineMode("python")::tokenBase, python.CodeMirror.defineMode("python")::formatStringFactory::tokenString, python.CodeMirror.defineMode("python")::tokenLexer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
python.CodeMirror.defineMode("python")::tokenLexer (cognitive 29) REDACTED:300— python.CodeMirror.defineMode("python")::tokenLexer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (python.CodeMirror.defineMode("python")::tokenBase, python.CodeMirror.defineMode("python")::tokenBaseInner, python.CodeMirror.defineMode("python")::formatStringFactory::tokenString) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
python.CodeMirror.defineMode("python")::formatStringFactory::tokenString (cognitive 21) REDACTED:205— python.CodeMirror.defineMode("python")::formatStringFactory::tokenString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 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. This shape REPEATS in the file: 3 other methods here (python.CodeMirror.defineMode("python")::tokenBase, python.CodeMirror.defineMode("python")::tokenBaseInner, python.CodeMirror.defineMode("python")::tokenLexer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
python.CodeMirror.defineMode("python")::tokenBase (cognitive 16) REDACTED:78— python.CodeMirror.defineMode("python")::tokenBase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (python.CodeMirror.defineMode("python")::tokenBaseInner, python.CodeMirror.defineMode("python")::formatStringFactory::tokenString, python.CodeMirror.defineMode("python")::tokenLexer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
addEditorMethods::getHelpers (cognitive 17) assets/static/codemirror/lib/codemirror.js:8388— addEditorMethods::getHelpers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
addEditorMethods::getTokenTypeAt (cognitive 16) assets/static/codemirror/lib/codemirror.js:8362— addEditorMethods::getTokenTypeAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (7 pts), 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.
addEditorMethods::addWidget (cognitive 16) assets/static/codemirror/lib/codemirror.js:8458— addEditorMethods::addWidget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
addEditorMethods::findWordAt (cognitive 16) assets/static/codemirror/lib/codemirror.js:8573— addEditorMethods::findWordAt has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, if/else 3 (4 pts), loops 2 (4 pts), 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.
(anonymous) (cognitive 16) assets/common/js/csp-bind.js:169— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 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.
(anonymous) (cognitive 16) assets/admin/controller/config/other.js:210— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 1. Of this number, 11 points are the body's own statements and 5 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.
(anonymous) (cognitive 16) assets/admin/controller/config/plugin.js:535— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 546, restartPlugins::(anonymous)::(anonymous)::done, restartPlugins::(anonymous)::(anonymous)::done::done, …). 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.
(anonymous) (cognitive 16) assets/admin/controller/manage/passkey.js:109— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 4 (5 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 127, 119, 133, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×4
Edited copy of a member (33 corresponding lines) app/Controller/User/Api/Order.php:79— app/Controller/User/Api/Order.php:79-112 | app/Controller/User/Api/RechargeNotification.php:30-62 — 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.
Edited copy of a member (33 corresponding lines) app/Service/Bind/Message.php:1027— app/Service/Bind/Message.php:1027-1059 | app/Service/Bind/Ticket.php:1347-1380 — 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.
Edited copy of a member (33 corresponding lines) app/Util/CardFile/Purge.php:40— app/Util/CardFile/Purge.php:40-73 | app/Util/CardFile/Purge.php:84-116 — 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.
Edited copy of a member (33 corresponding lines) app/Controller/Admin/Api/Order.php:183— app/Controller/Admin/Api/Order.php:183-236 | app/Controller/Admin/Api/RechargeOrder.php:156-188 — 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 (10 corresponding lines) · ×4
Edited copy of a member (10 corresponding lines) app/Controller/Admin/Api/Manage.php:626— app/Controller/Admin/Api/Manage.php:626-635 | app/Controller/User/Api/Security.php:747-756 — 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) app/Controller/User/Api/Authentication.php:187— app/Controller/User/Api/Authentication.php:187-196 | app/Controller/User/Api/Authentication.php:253-262 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) REDACTED:89— REDACTED:89-98 | REDACTED:106-115 — 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) app/Model/UserGroup.php:45— app/Model/UserGroup.php:45-56 | app/Model/UserGroup.php:65-74 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×4
Edited copy of a member (5 corresponding lines) app/Util/CardFile/Purge.php:391— app/Util/CardFile/Purge.php:391-395 | app/Util/CardFile/Purge.php:400-404 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) app/Controller/Admin/Api/Message.php:53— app/Controller/Admin/Api/Message.php:53-57 | app/Controller/User/Api/Ticket.php:45-49 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) app/Controller/Admin/Api/CommodityGroup.php:126— app/Controller/Admin/Api/CommodityGroup.php:126-130 | app/Controller/Admin/Api/Group.php:132-137 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) app/Interceptor/Owner.php:25— app/Interceptor/Owner.php:25-29 | app/Interceptor/Super.php:25-29 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 2) app/Controller/Admin/Api/Card.php:777— app/Controller/Admin/Api/Card.php:777-787 | app/Controller/User/Api/Card.php:197-207 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/Controller/User/Api/Master.php:107— app/Controller/User/Api/Master.php:107-117 | app/Controller/User/Api/Master.php:261-271 — both copies are in the same file, so extract the 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 (11 lines × 2) app/Service/Bind/Message.php:1027— app/Service/Bind/Message.php:1027-1037 | app/Service/Bind/Ticket.php:1347-1357 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/Service/Bind/Ticket.php:1359` calls `getimagesize`, `is_array`, `strtolower` and `app/Service/Bind/Message.php:1038` 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) app/Controller/Admin/Api/Coupon.php:423— app/Controller/Admin/Api/Coupon.php:423-433 | app/Controller/Admin/Api/Coupon.php:442-452 — both copies are in the same file, so extract the 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–9 lines × 2) app/Controller/Admin/Api/Card.php:214— app/Controller/Admin/Api/Card.php:214-221 | app/Controller/Admin/Api/Order.php:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–9 lines × 2) app/Model/Config.php:318— app/Model/Config.php:318-325 | app/Model/Config.php:375-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/Model/Config.php:375` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `app/Model/Config.php:365` calls `useExclusiveLock`, `use`, `decodeCache` and `app/Model/Config.php:316` 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–9 lines × 2) app/Service/Bind/App.php:60— app/Service/Bind/App.php:60-68 | app/Service/Bind/App.php:646-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/Service/Bind/App.php:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) app/Util/CallbackIpWhitelist.php:134— app/Util/CallbackIpWhitelist.php:134-142 | app/Util/Client.php:210-217 — 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.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) app/Service/Bind/Message.php:1064— app/Service/Bind/Message.php:1064-1100 | app/Service/Bind/Ticket.php:1410-1444 — 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.
Edited copy of a member (35 corresponding lines) app/Controller/Base/View/Manage.php:17— app/Controller/Base/View/Manage.php:17-53 | app/Controller/Base/View/ManagePlugin.php:16-50 — 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.
Edited copy of a member (35 corresponding lines) app/Service/ManageSessionManager.php:193— app/Service/ManageSessionManager.php:193-227 | app/Service/UserSessionManager.php:202-236 — 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 (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) app/Controller/User/Api/Master.php:125— app/Controller/User/Api/Master.php:125-144 | app/Controller/User/Api/Master.php:279-298 — 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) app/Controller/User/Api/Index.php:490— app/Controller/User/Api/Index.php:490-515 | app/Controller/User/Api/Recharge.php:27-46 — 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) app/Service/ManageSessionManager.php:254— app/Service/ManageSessionManager.php:254-273 | app/Service/UserSessionManager.php: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 (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) app/Service/Bind/Ticket.php:375— app/Service/Bind/Ticket.php:375-395 | app/Service/Bind/Ticket.php:400-420 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) app/Controller/Admin/Api/Order.php:503— app/Controller/Admin/Api/Order.php:503-525 | app/Controller/Admin/Api/RechargeOrder.php:446-466 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) app/Service/ManageWebauthnService.php:263— app/Service/ManageWebauthnService.php:263-283 | app/Service/UserWebauthnService.php:350-370 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×3
Edited copy of a member (13 corresponding lines) app/Util/SharedPayload.php:119— app/Util/SharedPayload.php:119-138 | app/Util/SharedPayload.php:184-196 — 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) app/Service/ManageSessionManager.php:173— app/Service/ManageSessionManager.php:173-185 | app/Service/UserSessionManager.php:178-194 — 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) kernel/Waf/Firewall.php:194— kernel/Waf/Firewall.php:194-210 | kernel/Waf/Firewall.php:220-232 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×3
Edited copy of a member (2 corresponding lines) app/Controller/Admin/Api/Message.php:28— app/Controller/Admin/Api/Message.php:28-29 | app/Controller/User/Api/Message.php:35-36 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (2 corresponding lines) app/Controller/Admin/Api/Ticket.php:21— app/Controller/Admin/Api/Ticket.php:21-22 | app/Controller/User/Api/Ticket.php:23-24 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (2 corresponding lines) app/Service/ManageSessionManager.php:283— app/Service/ManageSessionManager.php:283-284 | app/Service/UserSessionManager.php:292-293 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) app/Controller/Admin/Api/CommodityGroup.php:46— app/Controller/Admin/Api/CommodityGroup.php:46-61 | app/Controller/Admin/Api/CommodityGroup.php:80-95 — both copies are in the same file, so extract the 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 `app/Controller/Admin/Api/CommodityGroup.php:46` 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) app/Controller/Admin/Api/Coupon.php:341— app/Controller/Admin/Api/Coupon.php:341-356 | app/Controller/User/Api/Coupon.php:139-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Coupon.php:341` 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) app/Service/ManageSessionManager.php:91— app/Service/ManageSessionManager.php:91-106 | app/Service/UserSessionManager.php:91-106 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 (13 lines × 2) app/Controller/Admin/Api/Order.php:626— app/Controller/Admin/Api/Order.php:626-638 | app/Controller/Admin/Api/RechargeOrder.php:478-490 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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 `app/Controller/Admin/Api/Order.php:626` 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) app/Controller/User/Api/Card.php:38— app/Controller/User/Api/Card.php:38-50 | app/Controller/User/Api/Coupon.php:39-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) app/Service/ManageSessionManager.php:298— app/Service/ManageSessionManager.php:298-310 | app/Util/UserAgent.php:22-34 — 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) app/Controller/Admin/Api/Upload.php:101— app/Controller/Admin/Api/Upload.php:101-109 | app/Controller/User/Api/Upload.php:111-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) app/Service/Bind/ManageSSO.php:80— app/Service/Bind/ManageSSO.php:80-88 | app/Service/Bind/ManageSSO.php:141-149 — both copies are in the same file, so extract the 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) app/Util/SharedPayload.php:126— app/Util/SharedPayload.php:126-134 | app/Util/SharedPayload.php:187-195 — both copies are in the same file, so extract the 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 (29 lines × 2 locations) assets/admin/controller/config/plugin.js:47— assets/admin/controller/config/plugin.js:47 · assets/admin/controller/dashboard/index.js:711 — 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 (29 lines × 2 locations) assets/admin/controller/trade/card.js:46— assets/admin/controller/trade/card.js:46 · assets/admin/controller/trade/coupon.js:47 — 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 (29 lines × 2 locations) assets/admin/js/dict.js:83— assets/admin/js/dict.js:83 · assets/user/js/dict.js:21 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
(anonymous).mount::upload (cyclomatic 49) assets/admin/controller/trade/card-file-upload.js:603— (anonymous).mount::upload has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous).mount::paint (cyclomatic 16) assets/admin/controller/trade/card-file-upload.js:799— (anonymous).mount::paint 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.
python.CodeMirror.defineMode("python")::tokenBaseInner (cyclomatic 30) REDACTED:101— python.CodeMirror.defineMode("python")::tokenBaseInner 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. This shape REPEATS in the file: one other method here (python.CodeMirror.defineMode("python")::tokenLexer) 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.
python.CodeMirror.defineMode("python")::tokenLexer (cyclomatic 26) REDACTED:300— python.CodeMirror.defineMode("python")::tokenLexer has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (python.CodeMirror.defineMode("python")::tokenBaseInner) 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.
(anonymous) (cyclomatic 23) assets/admin/controller/trade/coupon.js:677— (anonymous) has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cyclomatic 23) assets/static/codemirror/addon/fold/brace-fold.js:14— (anonymous) has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 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.
click (cyclomatic 20) assets/admin/controller/config/plugin.js:302— click has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 304, (anonymous)::success::(anonymous)::(anonymous)::done, a function literal at line 324, …). 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.
click (cyclomatic 20) assets/admin/controller/pay/plugin.js:425— click has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 427, (anonymous)::success::(anonymous)::(anonymous)::done, a function literal at line 447, …). 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.
(anonymous).mount::upload (cognitive 75) assets/admin/controller/trade/card-file-upload.js:603— (anonymous).mount::upload has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 17, ternaries 6 (12 pts), error handling 3 (6 pts), loops 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.
(anonymous).mount::paint (cognitive 22) assets/admin/controller/trade/card-file-upload.js:799— (anonymous).mount::paint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, ternaries 2 (3 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.
click (cognitive 17) assets/admin/controller/config/plugin.js:302— click has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, other 2, ternaries 2. None of this is in the body itself: all 17 points belong to 11 function items inside it that branch (a function literal at line 304, (anonymous)::success::(anonymous)::(anonymous)::done, a function literal at line 322, …). 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.
click (cognitive 17) assets/admin/controller/pay/plugin.js:425— click has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, other 2, ternaries 2. None of this is in the body itself: all 17 points belong to 11 function items inside it that branch (a function literal at line 427, (anonymous)::success::(anonymous)::(anonymous)::done, a function literal at line 445, …). 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) app/Controller/User/Api/Security.php:442— app/Controller/User/Api/Security.php:442-471 | app/Controller/User/Api/Security.php:481-503 | app/Controller/User/Api/Security.php:513-530 | app/Controller/User/Api/Security.php:564-581 — 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) app/Service/Bind/Message.php:92— app/Service/Bind/Message.php:92-106 | app/Service/Bind/Message.php:221-230 | app/Service/Bind/Message.php:269-283 | app/Service/Bind/Ticket.php:843-868 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) app/Controller/User/Pay.php:28— app/Controller/User/Pay.php:28-65 | app/Controller/User/Recharge.php:86-125 — 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.
Edited copy of a member (38 corresponding lines) app/Service/ManageSessionManager.php:26— app/Service/ManageSessionManager.php:26-66 | app/Service/UserSessionManager.php:32-69 — 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 copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) app/Controller/User/Api/Master.php:153— app/Controller/User/Api/Master.php:153-170 | app/Controller/User/Api/Master.php:308-333 — 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) kernel/Waf/Firewall.php:237— kernel/Waf/Firewall.php:237-254 | kernel/Waf/Firewall.php:259-278 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) app/Controller/Admin/Api/Card.php:564— app/Controller/Admin/Api/Card.php:564-588 | app/Controller/Admin/Api/CardFile.php:268-291 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) app/Controller/Admin/Api/Upload.php:139— app/Controller/Admin/Api/Upload.php:139-162 | app/Controller/User/Api/Upload.php:175-201 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) app/Controller/Admin/Api/Upload.php:94— app/Controller/Admin/Api/Upload.php:94-109 | app/Controller/User/Api/Upload.php: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) app/Util/Plugin.php:52— app/Util/Plugin.php:52-70 | app/Util/Plugin.php:82-96 — 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 (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) app/Service/Bind/Pay.php:234— app/Service/Bind/Pay.php:234-250 | app/Util/Theme.php:74-89 — 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) REDACTED:281— REDACTED:281-296 | app/Controller/Admin/Api/Store.php:197-213 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×2
Edited copy of a member (12 corresponding lines) app/Service/ManageSessionManager.php:157— app/Service/ManageSessionManager.php:157-168 | app/Service/UserSessionManager.php:162-173 — 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) app/Controller/Admin/Api/Category.php:243— app/Controller/Admin/Api/Category.php:243-254 | app/Controller/Admin/Api/RechargeOrder.php:200-218 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) app/Controller/User/Api/Dict.php:29— app/Controller/User/Api/Dict.php:29-36 | app/Controller/User/Api/Dict.php:45-54 | app/Controller/User/Api/Dict.php:62-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) REDACTED:221— REDACTED:221-231 | REDACTED:375-382 | REDACTED:387-397 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) app/Interceptor/ManageSession.php:86— app/Interceptor/ManageSession.php:86-92 | app/Interceptor/UserSession.php:54-60 — 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) app/Service/ManageSessionManager.php:126— app/Service/ManageSessionManager.php:126-132 | app/Service/UserSessionManager.php:131-137 — 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) app/Controller/Admin/Api/Store.php:1395— app/Controller/Admin/Api/Store.php:1395-1400 | app/Controller/Admin/Api/Store.php:1410-1420 — 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) REDACTED:553— REDACTED:553-558 | app/Service/Bind/Email.php:256-261 — 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 (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) app/Service/UserWebauthnService.php:381— app/Service/UserWebauthnService.php:381-384 | app/Util/IpWhitelist.php:309-312 — 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) app/Controller/Admin/Authentication.php:28— app/Controller/Admin/Authentication.php:28-31 | app/Controller/User/Authentication.php:25-30 — 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 (24 lines × 2) app/Controller/Admin/Api/Card.php:349— app/Controller/Admin/Api/Card.php:349-372 | app/Controller/User/Api/Card.php:93-116 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Card.php:349` 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. 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, `app/Controller/User/Api/Card.php:92` calls `query`, `where`, `getUser` and `app/Controller/Admin/Api/Card.php:349` 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 (24 lines × 2) app/Controller/Admin/Api/Coupon.php:358— app/Controller/Admin/Api/Coupon.php:358-381 | app/Controller/User/Api/Coupon.php:156-179 — 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 `app/Controller/Admin/Api/Coupon.php:358` 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 after the matched lines, `app/Controller/Admin/Api/Coupon.php:383` calls `log`, `getManage` and `app/Controller/User/Api/Coupon.php:181` 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 (20 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:44— app/Controller/Admin/Api/BusinessLevel.php:44-63 | app/Controller/Admin/Api/Group.php:37-56 — before extracting anything, compare `app/Controller/Admin/Api/BusinessLevel.php` and `app/Controller/Admin/Api/Group.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 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 `app/Controller/Admin/Api/BusinessLevel.php:44` 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 (20 lines × 2) app/Controller/User/Pay.php:46— app/Controller/User/Pay.php:46-65 | app/Controller/User/Recharge.php:106-125 — before extracting anything, compare `app/Controller/User/Pay.php` and `app/Controller/User/Recharge.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) app/Controller/Admin/Api/Card.php:83— app/Controller/Admin/Api/Card.php:83-91 | app/Controller/Admin/Api/Coupon.php:79-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) app/Controller/Admin/Api/Store.php:610— app/Controller/Admin/Api/Store.php:610-618 | app/Service/Bind/Message.php:115-124 — 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 `app/Controller/Admin/Api/Store.php:610` 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–9 lines × 3) app/Controller/Admin/Api/Card.php:879— app/Controller/Admin/Api/Card.php:879-886 | app/Controller/Admin/Api/Card.php:930-937 | app/Controller/Admin/Api/Order.php:184-192 — 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 (8–9 lines × 3) app/Controller/Base/View/Manage.php:24— app/Controller/Base/View/Manage.php:24-32 | app/Controller/Base/View/ManagePlugin.php:22-30 | app/Controller/Base/View/UserPlugin.php:21-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) app/Controller/User/Api/Authentication.php:210— app/Controller/User/Api/Authentication.php:210-216 | app/Controller/User/Api/Authentication.php:235-241 | app/Controller/User/Api/Security.php:335-341 — 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) app/Controller/User/Api/Authentication.php:276— app/Controller/User/Api/Authentication.php:276-282 | app/Controller/User/Api/Authentication.php:302-308 | app/Controller/User/Api/Security.php:362-368 — 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.
Outbound HTTP without resilience app/Pay/Base.php:77— `new Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/Util/Http.php:22— `new \GuzzleHttp\Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Duplicated block (55 lines × 2 locations) assets/admin/controller/trade/commodity.js:333— assets/admin/controller/trade/commodity.js:333 · assets/user/controller/business/commodity.js:147 — 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 (55 lines × 2 locations) assets/admin/controller/trade/commodity.js:414— assets/admin/controller/trade/commodity.js:414 · assets/user/controller/business/commodity.js:224 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (44 lines × 2 locations) assets/admin/controller/user/index.js:481— assets/admin/controller/user/index.js:481 · assets/admin/controller/user/index.js:529 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (44 lines × 2 locations) assets/user/controller/business/card.js:343— assets/user/controller/business/card.js:343 · assets/user/controller/business/coupon.js:313 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (41 lines × 2 locations) assets/admin/controller/config/plugin.js:158— assets/admin/controller/config/plugin.js:158 · assets/admin/controller/pay/plugin.js:52 — 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 (41 lines × 2 locations) assets/user/controller/business/card.js:103— assets/user/controller/business/card.js:103 · assets/user/controller/business/commodity.js:426 — 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 (36 lines × 2 locations) assets/admin/controller/store/home.js:1221— assets/admin/controller/store/home.js:1221 · assets/admin/controller/store/home.js:1519 — 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 (36 lines × 2 locations) assets/static/acg.js:298— assets/static/acg.js:298 · assets/static/pay.js:24 — 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 (28 lines × 2 locations) assets/admin/controller/trade/order.js:298— assets/admin/controller/trade/order.js:298 · assets/admin/controller/user/index.js:95 — 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 (28 lines × 2 locations) assets/user/controller/security/email.js:19— assets/user/controller/security/email.js:19 · assets/user/controller/security/phone.js:19 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Complex function render (cyclomatic 33, cognitive 34) assets/common/js/component/authtree.js:45— render has cyclomatic complexity 33 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function render (cyclomatic 33, cognitive 34) assets/static/modules/authtree.js:45— render has cyclomatic complexity 33 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative app/View/User/Theme/Cartoon/Index/Closed.html:76— 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.
AC3 · Page structure· Data table has no header cells · ×1
Data table has no header cells app/View/Admin/Config/Security.html:339— A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
AC3 · Page structure· Heading level jumps from h1 to h3 · ×1
Heading level jumps from h1 to h3 app/View/LegalTerms.html:421— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure· Heading level jumps from h4 to h6 · ×1
Heading level jumps from h4 to h6 app/View/User/Theme/Cartoon/Index/Item.html:146— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC4 · Keyboard semantics· Anchor without href · ×1
Anchor without href app/View/Admin/Header.html:312— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×1
Modal dialog does not manage focus app/View/User/Theme/Cartoon/Common/Header.html:170— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
tree.select.layui.define() (cyclomatic 1045) REDACTED:1— tree.select.layui.define() has cyclomatic complexity 1045 (threshold 15). Most of this is not in the body itself: 4 of the 1045 points are its own statements and the rest belongs to 199 function literals inside it that branch (lines 2968, 3551, 2278, …). 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.
hex.layui.define() (cyclomatic 268) assets/static/modules/hex.js:1— hex.layui.define() has cyclomatic complexity 268 (threshold 15). Of this number, 34 points are the body's own statements and 234 belong to 32 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.
fallback.render (cyclomatic 177) assets/admin/js/mobile/fallback.js:2784— fallback.render has cyclomatic complexity 177 (threshold 15). Of this number, 52 points are the body's own statements and 125 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.
codemirror.addEditorMethods (cyclomatic 139) assets/static/codemirror/lib/codemirror.js:8268— codemirror.addEditorMethods has cyclomatic complexity 139 (threshold 15). Of this number, 35 points are the body's own statements and 104 belong to 32 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.
authtree.layui.define() (cyclomatic 133) assets/common/js/component/authtree.js:9— authtree.layui.define() has cyclomatic complexity 133 (threshold 15). Most of this is not in the body itself: 1 of the 133 points is its own statement and the rest belongs to 30 function literals inside it that branch (lines 45, 277, 381, …). 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.
authtree.layui.define() (cyclomatic 124) assets/static/modules/authtree.js:9— authtree.layui.define() has cyclomatic complexity 124 (threshold 15). Most of this is not in the body itself: 1 of the 124 points is its own statement and the rest belongs to 26 function literals inside it that branch (lines 45, 275, 379, …). 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.
Order.trade (cyclomatic 119) app/Service/Bind/Order.php:644— Order.trade has cyclomatic complexity 119 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
css.CodeMirror.defineMode("css") (cyclomatic 114) assets/static/codemirror/mode/css/css.js:14— css.CodeMirror.defineMode("css") has cyclomatic complexity 114 (threshold 15). Of this number, 35 points are the body's own statements and 79 belong to 16 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
KTMenu (cyclomatic 109) REDACTED:1526— KTMenu has cyclomatic complexity 109 (threshold 15). Most of this is not in the body itself: 3 of the 109 points are its own statements and the rest belongs to 67 function items inside it that branch (_showDropdown, _hideAccordions, _dismiss, …). 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.
commodity (cyclomatic 100) assets/static/acg.js:652— commodity has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 1 of the 100 points is its own statement and the rest belongs to 14 function items inside it that branch (a function literal at line 658, a function literal at line 908, (anonymous)::fnEnd, …). 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.
popup (cyclomatic 99) assets/common/js/component.js:339— popup has cyclomatic complexity 99 (threshold 15). Of this number, 44 points are the body's own statements and 55 belong to 19 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.
_ThemeSetting (cyclomatic 76) assets/admin/controller/config/index.js:144— _ThemeSetting has cyclomatic complexity 76 (threshold 15). Most of this is not in the body itself: 3 of the 76 points are its own statements and the rest belongs to 34 function items inside it that branch (modal, a function literal at line 266, runThemeAct, …). 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.
register (cyclomatic 74) assets/common/js/editor/markdown/editorv2.js:57— register has cyclomatic complexity 74 (threshold 15). Of this number, 28 points are the body's own statements and 46 belong to 41 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.
Commodity.save (cyclomatic 73) app/Controller/User/Api/Commodity.php:89— Commodity.save has cyclomatic complexity 73 (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.
(anonymous) (cyclomatic 73) assets/static/codemirror/lib/codemirror.js:370— (anonymous) has cyclomatic complexity 73 (threshold 15). Most of this is not in the body itself: 1 of the 73 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 393, charType, BidiSpan). 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.
fallback.renderToolbar (cyclomatic 71) assets/admin/js/mobile/fallback.js:2193— fallback.renderToolbar has cyclomatic complexity 71 (threshold 15). Of this number, 33 points are the body's own statements and 38 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.
mountRemoteProductPicker (cyclomatic 71) assets/admin/controller/shared/store.js:350— mountRemoteProductPicker has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 3 of the 71 points are its own statements and the rest belongs to 36 function items inside it that branch (collectScrollParents, updateSelection, onClick, …). 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.
#getPreprocessColumn (cyclomatic 71) REDACTED:1382— #getPreprocessColumn has cyclomatic complexity 71 (threshold 15). Of this number, 16 points are the body's own statements and 55 belong to 17 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
done (cyclomatic 67) assets/admin/controller/store/home.js:1261— done has cyclomatic complexity 67 (threshold 15). Most of this is not in the body itself: 8 of the 67 points are its own statements and the rest belongs to 52 function items inside it that branch (show, done, formatter, …). 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.
Manage.save (cyclomatic 62) app/Controller/Admin/Api/Manage.php:120— Manage.save has cyclomatic complexity 62 (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.
Commodity.save (cyclomatic 60) app/Controller/Admin/Api/Commodity.php:405— Commodity.save 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.
CommodityGroupModal (cyclomatic 60) assets/admin/controller/user/group.js:181— CommodityGroupModal has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 1 of the 60 points is its own statement and the rest belongs to 22 function items inside it that branch (a function literal at line 264, complete::applyMobileSearch, a function literal at line 334, …). 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.
Pay.paymentSaveMap (cyclomatic 59) app/Controller/Admin/Api/Pay.php:140— Pay.paymentSaveMap has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
presentPopup (cyclomatic 57) REDACTED:1130— presentPopup has cyclomatic complexity 57 (threshold 15). Of this number, 31 points are the body's own statements and 26 belong to 11 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.
codemirror.insertLineContent (cyclomatic 56) assets/static/codemirror/lib/codemirror.js:1921— codemirror.insertLineContent has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
User.save (cyclomatic 53) app/Controller/Admin/Api/User.php:85— User.save has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codemirror.drawSelectionRange (cyclomatic 52) assets/static/codemirror/lib/codemirror.js:3202— codemirror.drawSelectionRange has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 7 of the 52 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 3232, drawForLine::wrapX, add, …). 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.
createCoupon (cyclomatic 50) assets/admin/controller/trade/coupon.js:204— createCoupon has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 5 of the 50 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 209, a function literal at line 314, a function literal at line 250, …). 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.
fallback.openFilters (cyclomatic 49) assets/admin/js/mobile/fallback.js:2055— fallback.openFilters has cyclomatic complexity 49 (threshold 15). Of this number, 25 points are the body's own statements and 24 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BusinessLevel.validatedSaveMap (cyclomatic 49) app/Controller/Admin/Api/BusinessLevel.php:41— BusinessLevel.validatedSaveMap has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Store.addItem (cyclomatic 48) app/Controller/Admin/Api/Store.php:1086— Store.addItem 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.
_Auth (cyclomatic 47) assets/admin/controller/store/home.js:516— _Auth has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 4 of the 47 points are its own statements and the rest belongs to 25 function items inside it that branch (complete::_register_captcha::done, complete, a function literal at line 694, …). 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.
Order.valuation (cyclomatic 46) app/Service/Bind/Order.php:192— Order.valuation has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
click (cyclomatic 45) assets/admin/controller/shared/store.js:1446— click has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 2 of the 45 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 1454, a function literal at line 1487, a function literal at line 1516, …). 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.
api.confirmPayDelete (cyclomatic 44) assets/admin/controller/pay/api.js:99— api.confirmPayDelete has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 3 of the 44 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 105, 116, 164, …). 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.
codemirror.markText (cyclomatic 44) assets/static/codemirror/lib/codemirror.js:5968— codemirror.markText has cyclomatic complexity 44 (threshold 15). Of this number, 34 points are the body's own statements and 10 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.
(anonymous).attach.openMenu (cyclomatic 44) assets/admin/controller/trade/category-tree.js:750— (anonymous).attach.openMenu has cyclomatic complexity 44 (threshold 15). Of this number, 27 points are the body's own statements and 17 belong to 12 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.
javascript.CodeMirror.defineMode("javascript").tokenBase (cyclomatic 43) assets/static/codemirror/mode/javascript/javascript.js:66— javascript.CodeMirror.defineMode("javascript").tokenBase 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.
(anonymous).tokenBase (cyclomatic 43) assets/static/codemirror/mode/javascript/javascript.js:66— (anonymous).tokenBase 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.
Group.validatedSaveMap (cyclomatic 42) app/Controller/Admin/Api/Group.php:34— Group.validatedSaveMap has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
modal (cyclomatic 42) assets/admin/controller/trade/commodity.js:162— modal has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 9 of the 42 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 562, complete::(anonymous)::change, a function literal at line 170, …). 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.
codemirror.findPosH (cyclomatic 41) assets/static/codemirror/lib/codemirror.js:8708— codemirror.findPosH has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body's own statements and 13 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.
#createOptions (cyclomatic 41) REDACTED:1587— #createOptions has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 2 of the 41 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 1724, queryParams, a function literal at line 1689, …). 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.
(anonymous) (cyclomatic 41) assets/static/codemirror/lib/codemirror.js:14— (anonymous) has cyclomatic complexity 41 (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.
javascript.CodeMirror.defineMode("javascript").statement (cyclomatic 40) assets/static/codemirror/mode/javascript/javascript.js:368— javascript.CodeMirror.defineMode("javascript").statement has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous).statement (cyclomatic 40) assets/static/codemirror/mode/javascript/javascript.js:368— (anonymous).statement has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
workflows.renderPageActions (cyclomatic 39) assets/admin/js/mobile/workflows.js:1067— workflows.renderPageActions has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 belong to 7 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.
Util._verifyDialog (cyclomatic 39) assets/common/js/util.js:355— Util._verifyDialog has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 12 of the 39 points are its own statements and the rest belongs to 9 function items inside it that branch (submit, a function literal at line 423, close, …). 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.
Category.save (cyclomatic 39) app/Controller/Admin/Api/Category.php:431— Category.save 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.
jquery.pjax.pjax (cyclomatic 38) assets/static/jquery.pjax.js:166— jquery.pjax.pjax has cyclomatic complexity 38 (threshold 15). Of this number, 16 points are the body's own statements and 22 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
workflows.syncSettingsNavigation (cyclomatic 37) assets/admin/js/mobile/workflows.js:768— workflows.syncSettingsNavigation has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codemirror.moveVisually (cyclomatic 37) assets/static/codemirror/lib/codemirror.js:6912— codemirror.moveVisually has cyclomatic complexity 37 (threshold 15). Of this number, 25 points are the body's own statements and 12 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.
UploadGuard.contentError (cyclomatic 37) app/Util/UploadGuard.php:42— UploadGuard.contentError has cyclomatic complexity 37 (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.
javascript.CodeMirror.defineMode("javascript").indent (cyclomatic 36) assets/static/codemirror/mode/javascript/javascript.js:895— javascript.CodeMirror.defineMode("javascript").indent has cyclomatic complexity 36 (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.
ticket.detail.renderRelated (cyclomatic 36) assets/user/controller/user/ticket.detail.js:179— ticket.detail.renderRelated has cyclomatic complexity 36 (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.
glass.refreshMessageCenter (cyclomatic 36) assets/user/js/glass.js:234— glass.refreshMessageCenter has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 243, 284). 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.
confirmPayDelete::done (cyclomatic 36) assets/admin/controller/pay/api.js:105— confirmPayDelete::done has cyclomatic complexity 36 (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.
(anonymous).indent (cyclomatic 36) assets/static/codemirror/mode/javascript/javascript.js:895— (anonymous).indent 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.
home._ShowRebindPlan (cyclomatic 35) assets/admin/controller/store/home.js:1067— home._ShowRebindPlan has cyclomatic complexity 35 (threshold 15). Of this number, 16 points are the body's own statements and 19 belong to 7 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.
fallback.renderTreeContext (cyclomatic 35) assets/admin/js/mobile/fallback.js:2628— fallback.renderTreeContext has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codemirror.measureCharInner (cyclomatic 35) assets/static/codemirror/lib/codemirror.js:2489— codemirror.measureCharInner has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Image.createThumbnail (cyclomatic 35) app/Service/Bind/Image.php:27— Image.createThumbnail has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fallback.renderSelectionDock (cyclomatic 34) assets/admin/js/mobile/fallback.js:2329— fallback.renderSelectionDock has cyclomatic complexity 34 (threshold 15). Of this number, 16 points are the body's own statements and 18 belong to 5 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.
overlay.focusInvalid (cyclomatic 34) REDACTED:1063— overlay.focusInvalid has cyclomatic complexity 34 (threshold 15). Of this number, 28 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.
Form.constructor (cyclomatic 34) REDACTED:3— Form.constructor has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 28, 22). 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. This is NOT this file's highest cyclomatic complexity: Form.createForm (cyclomatic 40) 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.
codemirror.onScrollWheel (cyclomatic 34) assets/static/codemirror/lib/codemirror.js:4509— codemirror.onScrollWheel has cyclomatic complexity 34 (threshold 15). Of this number, 27 points are the body's own statements and 7 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.
CommodityGroup.mobileCommodityTree (cyclomatic 34) app/Controller/Admin/Api/CommodityGroup.php:214— CommodityGroup.mobileCommodityTree 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.
Coupon.couponExportQuery (cyclomatic 34) app/Controller/Admin/Api/Coupon.php:115— Coupon.couponExportQuery 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.
Authentication.register (cyclomatic 34) app/Controller/User/Api/Authentication.php:48— Authentication.register 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.
message.openComposer (cyclomatic 33) assets/admin/controller/user/message.js:360— message.openComposer has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 491, 479, 505, …). 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.
codemirror.leftButtonSelect (cyclomatic 33) assets/static/codemirror/lib/codemirror.js:7475— codemirror.leftButtonSelect has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (extendTo, extend, a function literal at line 7601, …). 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.
refreshMessageCenter::success (cyclomatic 33) assets/user/js/glass.js:243— refreshMessageCenter::success 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.
order.$(".btn-app-export").off().on() (cyclomatic 32) assets/admin/controller/trade/order.js:743— order.$(".btn-app-export").off().on() has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 785, 828). 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.
Form.getData (cyclomatic 32) REDACTED:977— Form.getData has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 992, 980, 982, …). 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. This is NOT this file's highest cyclomatic complexity: Form.createForm (cyclomatic 40) 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.
codemirror.stretchSpansOverChange (cyclomatic 32) assets/static/codemirror/lib/codemirror.js:1372— codemirror.stretchSpansOverChange 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.
codemirror.buildToken (cyclomatic 32) assets/static/codemirror/lib/codemirror.js:1801— codemirror.buildToken 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.
codemirror.registerEventHandlers (cyclomatic 32) assets/static/codemirror/lib/codemirror.js:7960— codemirror.registerEventHandlers has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 8018, a function literal at line 8002, a function literal at line 7965, …). 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.
codemirror.ContentEditableInput.pollContent (cyclomatic 32) assets/static/codemirror/lib/codemirror.js:9058— codemirror.ContentEditableInput.pollContent 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.
Coupon.save (cyclomatic 32) app/Controller/Admin/Api/Coupon.php:254— Coupon.save 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.
Manage.set (cyclomatic 32) app/Controller/Admin/Api/Manage.php:370— Manage.set 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.
Shared.syncRemoteItem (cyclomatic 32) app/Service/Bind/Shared.php:1032— Shared.syncRemoteItem 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.
recharge.order.$(".btn-app-export").off().on() (cyclomatic 31) assets/admin/controller/user/recharge.order.js:222— recharge.order.$(".btn-app-export").off().on() has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 271, 314). 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.
Component.previewMessage (cyclomatic 31) assets/common/js/component.js:176— Component.previewMessage has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 238, 262, 222, …). 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.
codemirror.skipAtomicInner (cyclomatic 31) assets/static/codemirror/lib/codemirror.js:5202— codemirror.skipAtomicInner 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.
Message.save (cyclomatic 31) app/Service/Bind/Message.php:722— Message.save 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.
applyModal (cyclomatic 31) assets/admin/controller/shared/priceTemplate.js:194— applyModal has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 242, a function literal at line 262, a function literal at line 314, …). 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.
(anonymous).attach.onKey (cyclomatic 31) assets/admin/controller/trade/category-tree.js:1041— (anonymous).attach.onKey has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
click (cyclomatic 31) assets/admin/controller/user/cash.js:114— click 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 10 function items inside it that branch (yes, success, a function literal at line 141, …). 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.
mobileAccountSubmit (cyclomatic 31) assets/admin/controller/user/index.js:44— mobileAccountSubmit has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 47, a function literal at line 95, (anonymous)::(anonymous)::done, …). 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.
fallback.renderReferenceCard (cyclomatic 30) assets/admin/js/mobile/fallback.js:441— fallback.renderReferenceCard has cyclomatic complexity 30 (threshold 15). Of this number, 29 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.
codemirror.TextMarker.clear (cyclomatic 30) assets/static/codemirror/lib/codemirror.js:5858— codemirror.TextMarker.clear 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.
Order.orderExportQuery (cyclomatic 30) app/Controller/Admin/Api/Order.php:72— Order.orderExportQuery 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.
Index.commodity (cyclomatic 30) app/Controller/User/Api/Index.php:68— Index.commodity 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.
PriceTemplate.applyToConfig (cyclomatic 30) app/Model/PriceTemplate.php:78— PriceTemplate.applyToConfig 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.
Order.getTradeAmount (cyclomatic 30) app/Service/Bind/Order.php:1510— Order.getTradeAmount 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.
ready.flushReadyQueue (cyclomatic 29) REDACTED:72— ready.flushReadyQueue has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 139, a function literal at line 95, execute, …). 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.
Query.get (cyclomatic 29) app/Service/Bind/Query.php:152— Query.get 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.
done (cyclomatic 29) assets/admin/controller/store/developer.js:621— done has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 26 function items inside it that branch (formatter, formatter, click, …). 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.
mobileDeliverySubmit (cyclomatic 29) assets/admin/controller/trade/order.js:257— mobileDeliverySubmit has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 260, a function literal at line 298, (anonymous)::(anonymous)::done, …). 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.
addWidget (cyclomatic 29) REDACTED:474— addWidget has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 11 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. This is NOT this file's highest cyclomatic complexity: createForm (cyclomatic 40) 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.
workflows.invalidFormField (cyclomatic 28) assets/admin/js/mobile/workflows.js:271— workflows.invalidFormField has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 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.
Util.post (cyclomatic 28) assets/common/js/util.js:242— Util.post has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 285, reject, a function literal at line 297, …). 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.
codemirror.makeChangeFromHistory (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:5341— codemirror.makeChangeFromHistory has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 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.
codemirror.applyTextInput (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:8146— codemirror.applyTextInput 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.
codemirror.locateNodeInLineView (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:9280— codemirror.locateNodeInLineView has cyclomatic complexity 28 (threshold 15). Of this number, 18 points are the body's own statements and 10 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.
codemirror.TextareaInput.onContextMenu (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:9608— codemirror.TextareaInput.onContextMenu has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (rehide, rehide::poll, prepareSelectAllHack). 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.
xml.CodeMirror.defineMode("xml").indent (cyclomatic 28) assets/static/codemirror/mode/xml/xml.js:340— xml.CodeMirror.defineMode("xml").indent 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.
Category.save (cyclomatic 28) app/Controller/User/Api/Category.php:54— Category.save 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.
(anonymous).indent (cyclomatic 28) assets/static/codemirror/mode/xml/xml.js:340— (anonymous).indent 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.
index.mobileAccountSubmit.<returned closure> (cyclomatic 27) assets/admin/controller/user/index.js:47— index.mobileAccountSubmit.<returned closure> has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 4 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.
codemirror.updateDisplayIfNeeded (cyclomatic 27) assets/static/codemirror/lib/codemirror.js:4104— codemirror.updateDisplayIfNeeded has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
css.CodeMirror.defineMode("css").tokenBase (cyclomatic 27) assets/static/codemirror/mode/css/css.js:40— css.CodeMirror.defineMode("css").tokenBase 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.
runImportTask (cyclomatic 27) assets/admin/controller/shared/store.js:1031— runImportTask 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 4 function literals inside it that branch (lines 1047, 1116, 1128, …). 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.
click (cyclomatic 27) assets/admin/controller/shared/store.js:1570— click 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 16 function items inside it that branch ((anonymous)::submit, a function literal at line 1646, (anonymous)::renderComplete, …). 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.
(anonymous).tokenBase (cyclomatic 27) assets/static/codemirror/mode/css/css.js:40— (anonymous).tokenBase 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.
index.renderChart (cyclomatic 26) assets/admin/controller/dashboard/index.js:298— index.renderChart has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 5 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.
card.$(".btn-app-export").off().on() (cyclomatic 26) assets/admin/controller/trade/card.js:611— card.$(".btn-app-export").off().on() has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 656, 683). 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.
order.mobileDeliverySubmit.<returned closure> (cyclomatic 26) assets/admin/controller/trade/order.js:260— order.mobileDeliverySubmit.<returned closure> has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 belong to 4 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.
menu.KTDrawer (cyclomatic 26) REDACTED:3267— menu.KTDrawer has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 10 function items inside it that branch (_getOption, _handlers, _update, …). 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.
codemirror.ContentEditableInput.showPrimarySelection (cyclomatic 26) assets/static/codemirror/lib/codemirror.js:8917— codemirror.ContentEditableInput.showPrimarySelection 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.
codemirror.TextareaInput.poll (cyclomatic 26) assets/static/codemirror/lib/codemirror.js:9548— codemirror.TextareaInput.poll has cyclomatic complexity 26 (threshold 15). Of this number, 22 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.
message.normalizeMessage (cyclomatic 26) assets/user/controller/user/message.js:24— message.normalizeMessage has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
glass.normalizeMessage (cyclomatic 26) assets/user/js/glass.js:142— glass.normalizeMessage has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RechargeOrder.exportQuery (cyclomatic 26) app/Controller/Admin/Api/RechargeOrder.php:64— RechargeOrder.exportQuery 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.
Store.remoteWidget (cyclomatic 26) app/Controller/Admin/Api/Store.php:523— Store.remoteWidget 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.
Security.personal (cyclomatic 26) app/Controller/User/Api/Security.php:53— Security.personal 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.
Email.sendRecipients (cyclomatic 26) app/Service/Bind/Email.php:42— Email.sendRecipients 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.
Order.calcAmount (cyclomatic 26) app/Service/Bind/Order.php:120— Order.calcAmount 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.
treeMetadata (cyclomatic 26) assets/admin/js/mobile/fallback.js:2547— treeMetadata has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2556, resolveDepth, a function literal at line 2582, …). 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.
set.saveSettings (cyclomatic 25) assets/admin/controller/manage/set.js:159— set.saveSettings has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 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.
order.showRefund (cyclomatic 25) assets/admin/controller/trade/order.js:159— order.showRefund has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 175, a function literal at line 202, a function literal at line 223, …). 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.
message.validateCompose (cyclomatic 25) assets/admin/controller/user/message.js:275— message.validateCompose 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.
fallback.detailContent (cyclomatic 25) assets/admin/js/mobile/fallback.js:1395— fallback.detailContent has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1417, 1414, 1424). 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.
codemirror.regChange (cyclomatic 25) assets/static/codemirror/lib/codemirror.js:3002— codemirror.regChange 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.
passkey.add (cyclomatic 25) assets/user/controller/security/passkey.js:235— passkey.add 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.
message.renderCartoonMobile (cyclomatic 25) assets/user/controller/user/message.js:231— message.renderCartoonMobile 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.
Store.sharedDomain (cyclomatic 25) app/Controller/Admin/Api/Store.php:75— Store.sharedDomain 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.
_Save (cyclomatic 25) assets/admin/controller/config/index.js:505— _Save has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 7 function items inside it that branch (submitSettings::done, submitSettings, guardDesktopPjaxLeave, …). 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.
(anonymous).attach (cyclomatic 25) assets/admin/controller/trade/category-tree.js:230— (anonymous).attach has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1290, 1287, 1313, …). 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.
Install.html.renderDbResult (cyclomatic 24) app/View/Install.html:1175— Install.html.renderDbResult 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.
store.fitImportPopupHeight (cyclomatic 24) assets/admin/controller/shared/store.js:62— store.fitImportPopupHeight has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
home._Bill (cyclomatic 24) assets/admin/controller/store/home.js:827— home._Bill has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 880, 900, 928, …). 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.
navigation.menuContent (cyclomatic 24) assets/admin/js/mobile/navigation.js:125— navigation.menuContent has cyclomatic complexity 24 (threshold 15). Of this number, 19 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.
Form.destroy (cyclomatic 24) REDACTED:2035— Form.destroy has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 2076, 2041, 2051, …). 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. This is NOT this file's highest cyclomatic complexity: Form.createForm (cyclomatic 40) 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.
codemirror.onKeyDown (cyclomatic 24) assets/static/codemirror/lib/codemirror.js:7242— codemirror.onKeyDown has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
comment-fold.CodeMirror.registerGlobalHelper("fold","comment") (cyclomatic 24) assets/static/codemirror/addon/fold/comment-fold.js:16— comment-fold.CodeMirror.registerGlobalHelper("fold","comment") 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.
Card.save (cyclomatic 24) app/Controller/Admin/Api/Card.php:333— Card.save 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.
Store.save (cyclomatic 24) app/Controller/Admin/Api/Store.php:890— Store.save 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.
User.theme (cyclomatic 24) app/Controller/Base/View/User.php:55— User.theme 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.
Shared.AdjustmentPrice (cyclomatic 24) app/Service/Bind/Shared.php:803— Shared.AdjustmentPrice 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.
UploadPurge.stageForDeletion (cyclomatic 24) app/Util/UploadPurge.php:88— UploadPurge.stageForDeletion 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.
#getSelectionRowState (cyclomatic 24) REDACTED:806— #getSelectionRowState has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 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.
(anonymous) (cyclomatic 24) assets/static/codemirror/addon/fold/comment-fold.js:16— (anonymous) 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.confirmFileDelete (cyclomatic 23) assets/admin/controller/file/index.js:108— index.confirmFileDelete has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 114, 148, 152). 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.
fallback.renderCardSubtitle (cyclomatic 23) assets/admin/js/mobile/fallback.js:655— fallback.renderCardSubtitle has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fallback.cardActionIcon (cyclomatic 23) assets/admin/js/mobile/fallback.js:1777— fallback.cardActionIcon 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.
overlay.handleNavigationClick (cyclomatic 23) REDACTED:1285— overlay.handleNavigationClick 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, 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.
codemirror.buildLineContent (cyclomatic 23) assets/static/codemirror/lib/codemirror.js:1734— codemirror.buildLineContent 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.
codemirror.onDrop (cyclomatic 23) assets/static/codemirror/lib/codemirror.js:6532— codemirror.onDrop has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codemirror.indentLine (cyclomatic 23) assets/static/codemirror/lib/codemirror.js:8078— codemirror.indentLine 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.
brace-fold.CodeMirror.registerHelper("fold","brace") (cyclomatic 23) assets/static/codemirror/addon/fold/brace-fold.js:14— brace-fold.CodeMirror.registerHelper("fold","brace") has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 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.
javascript.CodeMirror.defineMode("javascript").findFatArrow (cyclomatic 23) assets/static/codemirror/mode/javascript/javascript.js:185— javascript.CodeMirror.defineMode("javascript").findFatArrow 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.
Card.edit (cyclomatic 23) app/Controller/Admin/Api/Card.php:630— Card.edit 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.
Config.putManyLocked (cyclomatic 23) app/Model/Config.php:528— Config.putManyLocked 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.
initializeTable (cyclomatic 23) assets/admin/controller/pay/api.js:726— initializeTable has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 24 function items inside it that branch (formatter, formatter, formatter, …). 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.
modal (cyclomatic 23) assets/admin/controller/shared/priceTemplate.js:45— modal has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 116, complete::(anonymous)::change, a function literal at line 127, …). 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.
armAutofill (cyclomatic 23) assets/user/controller/auth/login.js:176— armAutofill has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to 2 function items inside it that branch. 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.
openSecret (cyclomatic 23) assets/user/controller/user/purchase.record.js:16— openSecret has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous).findFatArrow (cyclomatic 23) assets/static/codemirror/mode/javascript/javascript.js:185— (anonymous).findFatArrow 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.
Install.html.renderDb (cyclomatic 22) app/View/Install.html:1070— Install.html.renderDb has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1132, 1101, 1104, …). 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.renderChannels (cyclomatic 22) assets/admin/controller/dashboard/index.js:560— index.renderChannels 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 2 function items inside it that branch (a function literal at line 573, syncToggle). 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.
store.modal (cyclomatic 22) assets/admin/controller/shared/store.js:1273— store.modal 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 4 function literals inside it that branch (lines 1295, 1289, 1301, …). 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.
coupon.$(".btn-app-export").off().on() (cyclomatic 22) assets/admin/controller/trade/coupon.js:677— coupon.$(".btn-app-export").off().on() 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.
fallback.controlAvailable (cyclomatic 22) assets/admin/js/mobile/fallback.js:936— fallback.controlAvailable 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.
workflows.markSemanticPage (cyclomatic 22) assets/admin/js/mobile/workflows.js:687— workflows.markSemanticPage has cyclomatic complexity 22 (threshold 15). 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, 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.
workflows.syncContextNavigation (cyclomatic 22) assets/admin/js/mobile/workflows.js:874— workflows.syncContextNavigation has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 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.
workflows.discoverActions (cyclomatic 22) assets/admin/js/mobile/workflows.js:973— workflows.discoverActions has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 985, 1003, 975, …). 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.
codemirror.nodeAndOffsetInLineMap (cyclomatic 22) assets/static/codemirror/lib/codemirror.js:2441— codemirror.nodeAndOffsetInLineMap 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.
codemirror.defineOptions (cyclomatic 22) assets/static/codemirror/lib/codemirror.js:7708— codemirror.defineOptions 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 12 function items inside it that branch (a function literal at line 7774, option, a function literal at line 7739, …). 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.
codemirror.CodeMirror (cyclomatic 22) assets/static/codemirror/lib/codemirror.js:7883— codemirror.CodeMirror has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 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.
javascript.CodeMirror.defineMode("javascript").expressionInner (cyclomatic 22) assets/static/codemirror/mode/javascript/javascript.js:430— javascript.CodeMirror.defineMode("javascript").expressionInner 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.
recharge.updateSummary (cyclomatic 22) assets/user/controller/user/recharge.js:136— recharge.updateSummary 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.
ticket.detail.sanitizeHtml (cyclomatic 22) assets/user/controller/user/ticket.detail.js:42— ticket.detail.sanitizeHtml 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 3 function items inside it that branch (a function literal at line 56, a function literal at line 71, cleanUrl). 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.
Category.safeCategoryDeleteImpact (cyclomatic 22) app/Controller/Admin/Api/Category.php:83— Category.safeCategoryDeleteImpact 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.
Config.emailFailureMessage (cyclomatic 22) REDACTED:1348— Config.emailFailureMessage 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.
App.updatePlugin (cyclomatic 22) app/Service/Bind/App.php:216— App.updatePlugin 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.
Currency.convertAll (cyclomatic 22) app/Service/Bind/Currency.php:131— Currency.convertAll 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.
Order.getCost (cyclomatic 22) app/Service/Bind/Order.php:376— Order.getCost 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.
Purge.orphanFiles (cyclomatic 22) app/Util/CardFile/Purge.php:315— Purge.orphanFiles 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.
configureShell (cyclomatic 22) assets/admin/controller/config/wiki.mobile.js:190— configureShell has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 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 210, shellClickHandler, a function literal at line 214, …). 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.
normalizeImportRequest (cyclomatic 22) assets/admin/controller/shared/store.js:254— normalizeImportRequest 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.
openSecret (cyclomatic 22) assets/user/controller/dashboard/index.js:14— openSecret has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 5 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.
(anonymous) (cyclomatic 22) assets/user/controller/user/message.js:1— (anonymous) 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.
(anonymous).expressionInner (cyclomatic 22) assets/static/codemirror/mode/javascript/javascript.js:430— (anonymous).expressionInner 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.
api.showTestResult (cyclomatic 21) assets/admin/controller/pay/api.js:320— api.showTestResult has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.uploadCard (cyclomatic 21) assets/admin/controller/trade/card.js:104— card.uploadCard has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 139, a function literal at line 213, refresh, …). 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.
commodity.confirmCommodityDelete (cyclomatic 21) assets/admin/controller/trade/commodity.js:112— commodity.confirmCommodityDelete has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 117, 158, 159). 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.
commodity.uploadCard (cyclomatic 21) assets/admin/controller/trade/commodity.js:793— commodity.uploadCard has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 828, a function literal at line 902, refresh, …). 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.
menu.KTMenu.initGlobalHandlers (cyclomatic 21) REDACTED:2398— menu.KTMenu.initGlobalHandlers has cyclomatic complexity 21 (threshold 15). 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 2400, 2480, 2458, …). 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.
fallback.renderLedgerCard (cyclomatic 21) assets/admin/js/mobile/fallback.js:728— fallback.renderLedgerCard 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.
fallback.definitionValue (cyclomatic 21) assets/admin/js/mobile/fallback.js:861— fallback.definitionValue has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
workflows.visible (cyclomatic 21) assets/admin/js/mobile/workflows.js:106— workflows.visible 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.
ready.bind (cyclomatic 21) REDACTED:328— ready.bind 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 2 function literals inside it that branch (lines 353, 382). 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.
codemirror.coordsCharInner (cyclomatic 21) assets/static/codemirror/lib/codemirror.js:2753— codemirror.coordsCharInner has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.
codemirror.highlightWorker (cyclomatic 21) assets/static/codemirror/lib/codemirror.js:3991— codemirror.highlightWorker has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 3998, 4027). 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.
codemirror.ContentEditableInput.init (cyclomatic 21) assets/static/codemirror/lib/codemirror.js:8808— codemirror.ContentEditableInput.init has cyclomatic complexity 21 (threshold 15). 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 items inside it that branch (onCopyCut, a function literal at line 8824, belongsToInput, …). 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.
javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js:459— javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma 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.
javascript.CodeMirror.defineMode("javascript").classBody (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js:777— javascript.CodeMirror.defineMode("javascript").classBody 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.
Commodity.fastEnable (cyclomatic 21) app/Controller/Admin/Api/Commodity.php:880— Commodity.fastEnable 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.
User.changeAccountBalance (cyclomatic 21) app/Controller/Admin/Api/User.php:290— User.changeAccountBalance 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.
Card.save (cyclomatic 21) app/Controller/User/Api/Card.php:75— Card.save 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.
Cash.submit (cyclomatic 21) app/Controller/User/Api/Cash.php:35— Cash.submit 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.card (cyclomatic 21) app/Controller/User/Api/Index.php:298— Index.card 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.
App.rebindPlan (cyclomatic 21) app/Service/Bind/App.php:367— App.rebindPlan 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.
Shop.getItem (cyclomatic 21) app/Service/Bind/Shop.php:124— Shop.getItem 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.
SharedCurrency.config (cyclomatic 21) app/Util/SharedCurrency.php:145— SharedCurrency.config 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.
UploadGuard.sanitizeImage (cyclomatic 21) app/Util/UploadGuard.php:97— UploadGuard.sanitizeImage 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.
KTUtil.slide (cyclomatic 21) REDACTED:896— KTUtil.slide has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 10 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.
modal (cyclomatic 21) assets/admin/controller/pay/api.js:496— modal has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
#openColumnDetail (cyclomatic 21) REDACTED:443— #openColumnDetail has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 6 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.
(anonymous).atBlock (cyclomatic 21) assets/static/codemirror/mode/css/css.js:275— (anonymous).atBlock 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.
(anonymous).maybeoperatorNoComma (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js:459— (anonymous).maybeoperatorNoComma 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.
(anonymous).classBody (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js:777— (anonymous).classBody 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.
coupon.confirmCouponDelete (cyclomatic 20) assets/admin/controller/trade/coupon.js:107— coupon.confirmCouponDelete has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 113, 127, 140, …). 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.
fallback.relativeTimeTimestamp (cyclomatic 20) assets/admin/js/mobile/fallback.js:122— fallback.relativeTimeTimestamp 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fallback.configureShellSearch (cyclomatic 20) assets/admin/js/mobile/fallback.js:806— fallback.configureShellSearch 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.
fallback.cardOfferContent (cyclomatic 20) assets/admin/js/mobile/fallback.js:1814— fallback.cardOfferContent has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 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.
overlay.closeTransientInput (cyclomatic 20) REDACTED:419— overlay.closeTransientInput 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.
viewport.updateViewportVars (cyclomatic 20) assets/admin/js/mobile/viewport.js:88— viewport.updateViewportVars has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
viewport.keepPageFieldVisible (cyclomatic 20) assets/admin/js/mobile/viewport.js:137— viewport.keepPageFieldVisible has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 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.
Util.redactDebugValue::clone (cyclomatic 20) assets/common/js/util.js:158— Util.redactDebugValue::clone 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.
codemirror.bidiSimplify (cyclomatic 20) assets/static/codemirror/lib/codemirror.js:7613— codemirror.bidiSimplify 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.
Panel.save (cyclomatic 20) REDACTED:303— Panel.save has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 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.
Commodity.commodityDeleteImpact (cyclomatic 20) app/Controller/Admin/Api/Commodity.php:141— Commodity.commodityDeleteImpact 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.
Config.consumeTestSendQuota (cyclomatic 20) REDACTED:580— Config.consumeTestSendQuota 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.
RechargeOrder.verifyExportToken (cyclomatic 20) app/Controller/Admin/Api/RechargeOrder.php:255— RechargeOrder.verifyExportToken has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Coupon.save (cyclomatic 20) app/Controller/User/Api/Coupon.php:62— Coupon.save 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.
Order.callbackTest (cyclomatic 20) app/Controller/User/Api/Order.php:129— Order.callbackTest 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.
Message.cleanContent (cyclomatic 20) app/Service/Bind/Message.php:155— Message.cleanContent 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.
Order.assertCouponApplicable (cyclomatic 20) app/Service/Bind/Order.php:341— Order.assertCouponApplicable 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.
Order.commodityHasPositiveValue (cyclomatic 20) app/Service/Bind/Order.php:563— Order.commodityHasPositiveValue 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.
Order.orderSuccess (cyclomatic 20) app/Service/Bind/Order.php:1170— Order.orderSuccess 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.
Query.save (cyclomatic 20) app/Service/Bind/Query.php:284— Query.save 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.
sanitizeInlineHtml (cyclomatic 20) assets/common/js/component.js:106— sanitizeInlineHtml has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 132, normalizeLink, normalizeColor, …). 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.
sanitizePluginDisplayHtml (cyclomatic 20) assets/admin/controller/config/plugin.js:44— sanitizePluginDisplayHtml has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 59, normalizeColor, walk, …). 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.
normalizeRemoteProductGroups (cyclomatic 20) assets/admin/controller/shared/store.js:305— normalizeRemoteProductGroups has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 318, 312). 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.
(anonymous).confirmDelete (cyclomatic 20) assets/admin/controller/trade/category-actions.js:21— (anonymous).confirmDelete has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 9 function items inside it that branch (done, a function literal at line 63, a function literal at line 23, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous).attach.openActions (cyclomatic 20) assets/admin/controller/trade/category-tree.js:1158— (anonymous).attach.openActions has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 11 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.
(anonymous).attach (cyclomatic 20) assets/admin/controller/trade/drag-sort.js:148— (anonymous).attach has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 7 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.
other.$("#currency-convert-btn").off().on() (cyclomatic 19) assets/admin/controller/config/other.js:210— other.$("#currency-convert-btn").off().on() has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 4 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.
workflows.mount (cyclomatic 19) assets/admin/js/mobile/workflows.js:1274— workflows.mount has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1342, 1327, 1323, …). 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.
acg.acgSecretPopup (cyclomatic 19) assets/static/acg.js:1073— acg.acgSecretPopup has cyclomatic complexity 19 (threshold 15). Of this number, 14 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.
codemirror.conflictingCollapsedRange (cyclomatic 19) assets/static/codemirror/lib/codemirror.js:1535— codemirror.conflictingCollapsedRange 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.
codemirror.calculateScrollPos (cyclomatic 19) assets/static/codemirror/lib/codemirror.js:3499— codemirror.calculateScrollPos 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.
codemirror.onMouseDown (cyclomatic 19) assets/static/codemirror/lib/codemirror.js:7335— codemirror.onMouseDown 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.
codemirror.domTextBetween (cyclomatic 19) assets/static/codemirror/lib/codemirror.js:9208— codemirror.domTextBetween has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (walk, close, addText). 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.
javascript.CodeMirror.defineMode("javascript").objprop (cyclomatic 19) assets/static/codemirror/mode/javascript/javascript.js:522— javascript.CodeMirror.defineMode("javascript").objprop 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.
Panel.render (cyclomatic 19) REDACTED:222— Panel.render has cyclomatic complexity 19 (threshold 15). Of this number, 14 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.
Card.cardExportQuery (cyclomatic 19) app/Controller/Admin/Api/Card.php:147— Card.cardExportQuery 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.
Order.verifyOrderExportToken (cyclomatic 19) app/Controller/Admin/Api/Order.php:278— Order.verifyOrderExportToken has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Pay.paymentDeleteImpact (cyclomatic 19) app/Controller/Admin/Api/Pay.php:307— Pay.paymentDeleteImpact 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.
CommodityOrder.data (cyclomatic 19) app/Controller/User/Api/CommodityOrder.php:77— CommodityOrder.data 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.
Image.downloadRemoteImage (cyclomatic 19) app/Service/Bind/Image.php:256— Image.downloadRemoteImage 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.
Message.siteBaseUrl (cyclomatic 19) app/Service/Bind/Message.php:286— Message.siteBaseUrl 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.
Ticket.normalizeTicket (cyclomatic 19) app/Service/Bind/Ticket.php:265— Ticket.normalizeTicket 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.
Ticket.cleanContent (cyclomatic 19) app/Service/Bind/Ticket.php:750— Ticket.cleanContent 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.
Purge.collect (cyclomatic 19) app/Util/CardFile/Purge.php:188— Purge.collect has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
UploadPurge.inspectUploadPath (cyclomatic 19) app/Util/UploadPurge.php:30— UploadPurge.inspectUploadPath 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.
GridTracks.track (cyclomatic 19) kernel/Waf/Css/GridTracks.php:37— GridTracks.track 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.
sanitizeRichHtml (cyclomatic 19) assets/common/js/component.js:43— sanitizeRichHtml has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 56, a function literal at line 72, walk). 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.
(anonymous) (cyclomatic 19) assets/admin/controller/config/other.js:210— (anonymous) has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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.
normalizeImportTask (cyclomatic 19) assets/admin/controller/shared/store.js:730— normalizeImportTask has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous).attach.onMobilePointerDown (cyclomatic 19) assets/admin/controller/trade/drag-sort.js:1028— (anonymous).attach.onMobilePointerDown has cyclomatic complexity 19 (threshold 15). Of this number, 17 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.
requestAudienceCount (cyclomatic 19) assets/admin/controller/user/message.js:143— requestAudienceCount has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (done, error, fail). 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.
alignReferenceCards (cyclomatic 19) assets/admin/js/mobile/fallback.js:52— alignReferenceCards has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 62, 78, 60, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
(anonymous).top (cyclomatic 19) assets/static/codemirror/mode/css/css.js:160— (anonymous).top 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.
(anonymous).objprop (cyclomatic 19) assets/static/codemirror/mode/javascript/javascript.js:522— (anonymous).objprop 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.
home.requestPurchase (cyclomatic 18) assets/admin/controller/store/home.js:288— home.requestPurchase has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 299, send, a function literal at line 310, …). 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.
ticket.sanitizeRichHtml (cyclomatic 18) assets/admin/controller/user/ticket.js:111— ticket.sanitizeRichHtml 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 117, 132). 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.
menu.KTScroll::_getAutoHeight (cyclomatic 18) REDACTED:2896— menu.KTScroll::_getAutoHeight 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.
fallback.cardSubtitle (cyclomatic 18) assets/admin/js/mobile/fallback.js:598— fallback.cardSubtitle has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 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. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
fallback.updateTreeCollapsePresentation (cyclomatic 18) assets/admin/js/mobile/fallback.js:2716— fallback.updateTreeCollapsePresentation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2718). 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. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
overlay.setupDirtyTracking (cyclomatic 18) REDACTED:508— overlay.setupDirtyTracking 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 4 function items inside it that branch (editorKey, captureBaseline, controlClick, …). 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.
overlay.setupSheetDrag::pointerDown (cyclomatic 18) REDACTED:745— overlay.setupSheetDrag::pointerDown 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.
overlay.openActions (cyclomatic 18) REDACTED:901— overlay.openActions has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 905, 916). 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.
Form.disposeControl (cyclomatic 18) REDACTED:170— Form.disposeControl 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: Form.createForm (cyclomatic 40) 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.
editorv2.register.destroy (cyclomatic 18) assets/common/js/editor/markdown/editorv2.js:980— editorv2.register.destroy has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
codemirror.removeReadOnlyRanges (cyclomatic 18) assets/static/codemirror/lib/codemirror.js:1445— codemirror.removeReadOnlyRanges has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
codemirror.endOperation_finish (cyclomatic 18) assets/static/codemirror/lib/codemirror.js:3910— codemirror.endOperation_finish 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.
codemirror.onKeyPress (cyclomatic 18) assets/static/codemirror/lib/codemirror.js:7286— codemirror.onKeyPress 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.
codemirror.TextareaInput.init (cyclomatic 18) assets/static/codemirror/lib/codemirror.js:9353— codemirror.TextareaInput.init 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 7 function items inside it that branch (prepareCopyCut, a function literal at line 9365, a function literal at line 9399, …). 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.
javascript.CodeMirror.defineMode("javascript").typeexpr (cyclomatic 18) assets/static/codemirror/mode/javascript/javascript.js:610— javascript.CodeMirror.defineMode("javascript").typeexpr 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.
ticket.create.updateSummary (cyclomatic 18) assets/user/controller/user/ticket.create.js:96— ticket.create.updateSummary 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.
ticket.create.submitTicket (cyclomatic 18) assets/user/controller/user/ticket.create.js:225— ticket.create.submitTicket has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
Category.verifyCategoryDeleteToken (cyclomatic 18) app/Controller/Admin/Api/Category.php:289— Category.verifyCategoryDeleteToken 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.
Config.security (cyclomatic 18) REDACTED:724— Config.security 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.
PriceTemplate.computePrice (cyclomatic 18) app/Controller/Admin/Api/PriceTemplate.php:328— PriceTemplate.computePrice 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.
Pay.savePluginConfig (cyclomatic 18) app/Service/Bind/Pay.php:396— Pay.savePluginConfig 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.
Shop.substationPriceIncrease (cyclomatic 18) app/Service/Bind/Shop.php:383— Shop.substationPriceIncrease has cyclomatic complexity 18 (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.
CategoryTree.forAdmin (cyclomatic 18) app/Util/CategoryTree.php:52— CategoryTree.forAdmin 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.
PluginPacker.pack (cyclomatic 18) app/Util/PluginPacker.php:209— PluginPacker.pack 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.
Waf.wafPost (cyclomatic 18) app/Util/Waf.php:19— Waf.wafPost 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.
(anonymous).parseResponse (cyclomatic 18) assets/admin/controller/trade/card-file-upload.js:214— (anonymous).parseResponse 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.
(anonymous).attach.nodesHtml (cyclomatic 18) assets/admin/controller/trade/category-tree.js:363— (anonymous).attach.nodesHtml has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 366). 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.
(anonymous) (cyclomatic 18) assets/admin/controller/trade/commodity.js:1382— (anonymous) 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 7 function items inside it that branch (submitBatchSettings, a function literal at line 1411, a function literal at line 1393, …). 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.
click (cyclomatic 18) assets/admin/controller/user/recharge.order.js:132— click has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 4 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.
renderToolbar::(anonymous)::syncSourceState (cyclomatic 18) assets/admin/js/mobile/fallback.js:2270— renderToolbar::(anonymous)::syncSourceState 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.
#mobileDisplayValue (cyclomatic 18) REDACTED:726— #mobileDisplayValue 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.
register.destroy (cyclomatic 18) assets/common/js/editor/markdown/editorv2.js:980— register.destroy has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous).typeexpr (cyclomatic 18) assets/static/codemirror/mode/javascript/javascript.js:610— (anonymous).typeexpr 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.
google2fa.$("#g2fa-bind-btn").off().on() (cyclomatic 17) assets/admin/controller/config/google2fa.js:87— google2fa.$("#g2fa-bind-btn").off().on() 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 8 function literals inside it that branch (lines 90, 143, 134, …). 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.
wiki.mobile.destroy (cyclomatic 17) assets/admin/controller/config/wiki.mobile.js:311— wiki.mobile.destroy 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.
store.importTaskLogText (cyclomatic 17) assets/admin/controller/shared/store.js:822— store.importTaskLogText has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 824). 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.
commodity.$(".handle").off().on() (cyclomatic 17) assets/admin/controller/trade/commodity.js:1382— commodity.$(".handle").off().on() 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 6 function items inside it that branch (submitBatchSettings, a function literal at line 1411, a function literal at line 1422, …). 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.
ticket.pollMessages (cyclomatic 17) assets/admin/controller/user/ticket.js:504— ticket.pollMessages has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 525, finishPoll). 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.
ticket.sendReply (cyclomatic 17) assets/admin/controller/user/ticket.js:637— ticket.sendReply has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 655, 642, 668, …). 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.
fallback.compactCardDefinitions (cyclomatic 17) assets/admin/js/mobile/fallback.js:330— fallback.compactCardDefinitions has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (add). 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. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
fallback.renderTreeToggle (cyclomatic 17) assets/admin/js/mobile/fallback.js:2744— fallback.renderTreeToggle 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, 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: fallback.alignReferenceCards (cyclomatic 19) 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.
fallback.rebuild (cyclomatic 17) assets/admin/js/mobile/fallback.js:3217— fallback.rebuild 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 one function literal inside it that branches (line 3220). 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. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
overlay.api.closeAll (cyclomatic 17) REDACTED:1372— overlay.api.closeAll has cyclomatic complexity 17 (threshold 15). Of this number, 10 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.
recipes.rechargeOrderSubtitleField (cyclomatic 17) assets/admin/js/mobile/recipes.js:419— recipes.rechargeOrderSubtitleField 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.
Search.#setField (cyclomatic 17) assets/common/js/component/search.js:413— Search.#setField 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editorv2.register.sizeImages.text (cyclomatic 17) assets/common/js/editor/markdown/editorv2.js:747— editorv2.register.sizeImages.text has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 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.
css.CodeMirror.defineMode("css").indent (cyclomatic 17) assets/static/codemirror/mode/css/css.js:391— css.CodeMirror.defineMode("css").indent 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.
ticket.create.initRemoteSelect (cyclomatic 17) assets/user/controller/user/ticket.create.js:40— ticket.create.initRemoteSelect 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 6 function literals inside it that branch (lines 60, 59, 72, …). 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.
glass.initMessageCenter (cyclomatic 17) assets/user/js/glass.js:327— glass.initMessageCenter has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 337, 370, 378, …). 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.
glass.initTheme (cyclomatic 17) assets/user/js/glass.js:503— glass.initTheme has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (apply, resolve, mode, …). 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.
Card.saveFiles (cyclomatic 17) app/Controller/Admin/Api/Card.php:456— Card.saveFiles 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.
Category.status (cyclomatic 17) app/Controller/Admin/Api/Category.php:710— Category.status has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Config.configHttpUrl (cyclomatic 17) REDACTED:409— Config.configHttpUrl 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.
Business.saveConfig (cyclomatic 17) app/Controller/User/Api/Business.php:111— Business.saveConfig 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.
Master.setCommodity (cyclomatic 17) app/Controller/User/Api/Master.php:213— Master.setCommodity 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.
Currency.convertCommodityConfigs (cyclomatic 17) app/Service/Bind/Currency.php:370— Currency.convertCommodityConfigs 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.
Recharge.trade (cyclomatic 17) app/Service/Bind/Recharge.php:40— Recharge.trade 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.
Shop.getCategory (cyclomatic 17) app/Service/Bind/Shop.php:36— Shop.getCategory 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.
Ticket.applyFilters (cyclomatic 17) app/Service/Bind/Ticket.php:141— Ticket.applyFilters 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.
Ticket.delete (cyclomatic 17) app/Service/Bind/Ticket.php:1149— Ticket.delete 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.
Client.headerIpCandidates (cyclomatic 17) app/Util/Client.php:346— Client.headerIpCandidates 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.
Csp.deriveSource (cyclomatic 17) app/Util/Csp.php:417— Csp.deriveSource 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.
OrderRefund.run (cyclomatic 17) app/Util/OrderRefund.php:81— OrderRefund.run 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.
SkuStock.outages (cyclomatic 17) app/Util/SkuStock.php:29— SkuStock.outages 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.
Lang.collect (cyclomatic 17) kernel/Util/Lang.php:562— Lang.collect 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.
Lang.transObjectList (cyclomatic 17) kernel/Util/Lang.php:1052— Lang.transObjectList 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.
Shadow.layer (cyclomatic 17) kernel/Waf/Css/Shadow.php:45— Shadow.layer 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.
(anonymous) (cyclomatic 17) assets/admin/controller/config/google2fa.js:87— (anonymous) 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 9 function items inside it that branch (a function literal at line 90, a function literal at line 143, (anonymous)::submit, …). 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.
renderConfigForm (cyclomatic 17) assets/admin/controller/pay/plugin.js:236— renderConfigForm has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
importItemRequest (cyclomatic 17) assets/admin/controller/shared/store.js:950— importItemRequest has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 966, 950, 999). 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.
(anonymous).cardForm.submit (cyclomatic 17) assets/admin/controller/trade/card-file-upload.js:1164— (anonymous).cardForm.submit 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 4 function items inside it that branch (send::done, send, send::error, …). 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.
(anonymous).attach.treeHtml (cyclomatic 17) assets/admin/controller/trade/category-tree.js:389— (anonymous).attach.treeHtml 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous).attach.endDrag (cyclomatic 17) assets/admin/controller/trade/category-tree.js:985— (anonymous).attach.endDrag has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous).attach.bindHost (cyclomatic 17) assets/admin/controller/trade/category-tree.js:1108— (anonymous).attach.bindHost has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 1110, 1125, 1146, …). 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.
confirmCommodityDelete::done (cyclomatic 17) assets/admin/controller/trade/commodity.js:117— confirmCommodityDelete::done 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.
(anonymous).attach.groupBlocks (cyclomatic 17) assets/admin/controller/trade/drag-sort.js:207— (anonymous).attach.groupBlocks has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 241, a function literal at line 224, isDescendantOf, …). 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.
copyConfiguredField (cyclomatic 17) assets/admin/js/mobile/fallback.js:1020— copyConfiguredField has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openSheet (cyclomatic 17) REDACTED:829— openSheet has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 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.
register.sizeImages (cyclomatic 17) assets/common/js/editor/markdown/editorv2.js:745— register.sizeImages has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 747, (anonymous)::get, a function literal at line 751, …). 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.
(anonymous).indent (cyclomatic 17) assets/static/codemirror/mode/css/css.js:391— (anonymous).indent 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.
Install.html.testDb (cyclomatic 16) app/View/Install.html:1149— Install.html.testDb 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 2 function literals inside it that branch (lines 1160, 1167). 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. This is NOT this file's highest cyclomatic complexity: Install.html.renderEnv (cyclomatic 19) 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.
fallback.sanitizeTree (cyclomatic 16) assets/admin/js/mobile/fallback.js:228— fallback.sanitizeTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 234, 233). 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. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
fallback.inlineInputEditor (cyclomatic 16) assets/admin/js/mobile/fallback.js:1196— fallback.inlineInputEditor has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: fallback.alignReferenceCards (cyclomatic 19) 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.
navigation.handleClick (cyclomatic 16) assets/admin/js/mobile/navigation.js:255— navigation.handleClick has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
overlay.finalize (cyclomatic 16) REDACTED:360— overlay.finalize has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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.
overlay.firstInvalidField (cyclomatic 16) REDACTED:1041— overlay.firstInvalidField 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.
overlay.handleKey (cyclomatic 16) REDACTED:1307— overlay.handleKey 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.
workflows.cloneLabel (cyclomatic 16) assets/admin/js/mobile/workflows.js:91— workflows.cloneLabel 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.
workflows.addPageFormGuard (cyclomatic 16) assets/admin/js/mobile/workflows.js:503— workflows.addPageFormGuard 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 items inside it that branch (mark, clearInvalid, click, …). 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.
codemirror.updateLineGutter (cyclomatic 16) assets/static/codemirror/lib/codemirror.js:2177— codemirror.updateLineGutter 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.
codemirror.patchDisplay (cyclomatic 16) assets/static/codemirror/lib/codemirror.js:4225— codemirror.patchDisplay has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
codemirror.addChangeToHistory (cyclomatic 16) assets/static/codemirror/lib/codemirror.js:4896— codemirror.addChangeToHistory 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.
codemirror.makeChangeSingleDocInEditor (cyclomatic 16) assets/static/codemirror/lib/codemirror.js:5469— codemirror.makeChangeSingleDocInEditor has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
foldcode.doFold (cyclomatic 16) assets/static/codemirror/addon/fold/foldcode.js:14— foldcode.doFold has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
foldgutter.updateFoldInfo (cyclomatic 16) REDACTED:73— foldgutter.updateFoldInfo 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 one function literal inside it that branches (line 80). 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.
xml.CodeMirror.defineMode("xml").inText (cyclomatic 16) assets/static/codemirror/mode/xml/xml.js:69— xml.CodeMirror.defineMode("xml").inText 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.
Treasure.show (cyclomatic 16) assets/user/js/treasure.js:45— Treasure.show has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.plugins (cyclomatic 16) REDACTED:121— App.plugins 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.
Commodity.reorder (cyclomatic 16) app/Controller/Admin/Api/Commodity.php:726— Commodity.reorder 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.
Plugin.wikiRes (cyclomatic 16) app/Controller/Admin/Plugin.php:189— Plugin.wikiRes 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.
Authentication.password (cyclomatic 16) app/Controller/User/Api/Authentication.php:582— Authentication.password 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.
Currency.convertIniMoney (cyclomatic 16) app/Service/Bind/Currency.php:430— Currency.convertIniMoney 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.
Message.sendEmailBatch (cyclomatic 16) app/Service/Bind/Message.php:373— Message.sendEmailBatch 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.
Ticket.visibleCommodityQuery (cyclomatic 16) app/Service/Bind/Ticket.php:553— Ticket.visibleCommodityQuery 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.
Helper.isInstall (cyclomatic 16) app/Util/Helper.php:61— Helper.isInstall 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.
Plugin.hook (cyclomatic 16) kernel/Util/Plugin.php:132— Plugin.hook 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.
(anonymous).openEditor (cyclomatic 16) assets/admin/controller/trade/category-actions.js:98— (anonymous).openEditor has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 159, done, complete, …). 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.
openSkuStock (cyclomatic 16) assets/admin/controller/trade/commodity.js:1470— openSkuStock has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 1480, a function literal at line 1471, (anonymous)::esc, …). 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.
registerUserPicker (cyclomatic 16) assets/admin/controller/user/message.js:217— registerUserPicker has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (remoteMethod::error, remoteMethod::done, remoteMethod::fail, …). 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.
(anonymous).inText (cyclomatic 16) assets/static/codemirror/mode/xml/xml.js:69— (anonymous).inText 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.
tree.select.layui.define() (cognitive 1209) REDACTED:1— tree.select.layui.define() has cognitive complexity 1209 (threshold 15). Drivers by points: if/else 465 (709 pts), boolean chains 252, ternaries 58 (124 pts), loops 67 (114 pts), match/switch 6 (9 pts), error handling 1 (nesting depth added 360). Most of this is not in the body itself: 3 of the 1209 points are its own statements and the rest belongs to 199 function literals inside it that branch (lines 2968, 3551, 2369, …). 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.
commodity (cognitive 297) assets/static/acg.js:652— commodity has cognitive complexity 297 (threshold 15). Drivers by points: if/else 72 (187 pts), loops 10 (54 pts), ternaries 7 (38 pts), boolean chains 18 (nesting depth added 190). None of this is in the body itself: all 297 points belong to 14 function items inside it that branch (a function literal at line 658, a function literal at line 908, (anonymous)::categoryWholesale, …). 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.
hex.layui.define() (cognitive 235) assets/static/modules/hex.js:1— hex.layui.define() has cognitive complexity 235 (threshold 15). Drivers by points: if/else 84 (142 pts), boolean chains 55, ternaries 14 (25 pts), loops 3 (5 pts), match/switch 5, error handling 1 (3 pts) (nesting depth added 73). Of this number, 33 points are the body's own statements and 202 belong to 32 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.
Order.trade (cognitive 186) app/Service/Bind/Order.php:644— Order.trade has cognitive complexity 186 (threshold 15). Drivers by points: if/else 84 (135 pts), boolean chains 31, ternaries 7 (12 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent 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 177) assets/admin/js/mobile/fallback.js:2784— render has cognitive complexity 177 (threshold 15). Drivers by points: boolean chains 90, if/else 48 (59 pts), ternaries 20 (24 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 17). Of this number, 50 points are the body's own statements and 127 belong to 31 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.
insertLineContent (cognitive 147) assets/static/codemirror/lib/codemirror.js:1921— insertLineContent has cognitive complexity 147 (threshold 15). Drivers by points: if/else 23 (84 pts), ternaries 5 (25 pts), loops 7 (22 pts), boolean chains 16 (nesting depth added 96). 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.
KTMenu (cognitive 142) REDACTED:1526— KTMenu has cognitive complexity 142 (threshold 15). Drivers by points: if/else 90 (106 pts), boolean chains 19, loops 7 (11 pts), ternaries 6 (nesting depth added 20). Most of this is not in the body itself: 2 of the 142 points are its own statements and the rest belongs to 67 function items inside it that branch (_dismiss, _isItemSubShown, _showDropdown, …). 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.
popup (cognitive 132) assets/common/js/component.js:339— popup has cognitive complexity 132 (threshold 15). Drivers by points: if/else 44 (65 pts), boolean chains 20, ternaries 13 (17 pts), error handling 6 (11 pts), loops 3 (10 pts), other 9 (nesting depth added 37). Of this number, 47 points are the body's own statements and 85 belong to 19 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.
(anonymous) (cognitive 124) assets/static/codemirror/lib/codemirror.js:370— (anonymous) has cognitive complexity 124 (threshold 15). Drivers by points: if/else 29 (49 pts), loops 16 (34 pts), boolean chains 21, ternaries 8 (20 pts) (nesting depth added 50). None of this is in the body itself: all 124 points belong to 3 function items inside it that branch (a function literal at line 393, charType, BidiSpan). 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.
#getPreprocessColumn (cognitive 121) REDACTED:1382— #getPreprocessColumn has cognitive complexity 121 (threshold 15). Drivers by points: if/else 31 (77 pts), ternaries 10 (20 pts), boolean chains 17, other 6, match/switch 1 (nesting depth added 56). Most of this is not in the body itself: 12 of the 121 points are its own statements and the rest belongs to 17 function items inside it that branch (formatter, a function literal at line 1451, formatter, …). 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.
authtree.layui.define() (cognitive 113) assets/common/js/component/authtree.js:9— authtree.layui.define() has cognitive complexity 113 (threshold 15). Drivers by points: if/else 50 (70 pts), boolean chains 18, ternaries 14, loops 11 (nesting depth added 20). None of this is in the body itself: all 113 points belong to 30 function literals inside it that branch (lines 45, 409, 346, …). 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.
skipAtomicInner (cognitive 105) assets/static/codemirror/lib/codemirror.js:5202— skipAtomicInner has cognitive complexity 105 (threshold 15). Drivers by points: ternaries 12 (55 pts), if/else 11 (42 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 75). 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.
authtree.layui.define() (cognitive 104) assets/static/modules/authtree.js:9— authtree.layui.define() has cognitive complexity 104 (threshold 15). Drivers by points: if/else 46 (65 pts), boolean chains 15, ternaries 13, loops 11 (nesting depth added 19). None of this is in the body itself: all 104 points belong to 26 function literals inside it that branch (lines 45, 407, 344, …). 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.
CommodityGroupModal (cognitive 103) assets/admin/controller/user/group.js:181— CommodityGroupModal has cognitive complexity 103 (threshold 15). Drivers by points: if/else 23 (54 pts), ternaries 7 (21 pts), boolean chains 20, loops 2 (6 pts), other 2 (nesting depth added 49). None of this is in the body itself: all 103 points belong to 22 function items inside it that branch (complete, a function literal at line 264, a function literal at line 334, …). 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.
Order.valuation (cognitive 90) app/Service/Bind/Order.php:192— Order.valuation has cognitive complexity 90 (threshold 15). Drivers by points: if/else 27 (52 pts), ternaries 7 (17 pts), loops 4 (11 pts), boolean chains 10 (nesting depth added 42). 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.
register (cognitive 88) assets/common/js/editor/markdown/editorv2.js:57— register has cognitive complexity 88 (threshold 15). Drivers by points: if/else 33 (41 pts), boolean chains 25, ternaries 13 (17 pts), error handling 3, other 2 (nesting depth added 12). Of this number, 31 points are the body's own statements and 57 belong to 41 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.
Commodity.save (cognitive 85) app/Controller/User/Api/Commodity.php:89— Commodity.save has cognitive complexity 85 (threshold 15). Drivers by points: if/else 33 (45 pts), boolean chains 30, ternaries 7 (8 pts), loops 2 (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
drawSelectionRange (cognitive 81) assets/static/codemirror/lib/codemirror.js:3202— drawSelectionRange has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 16 (22 pts), boolean chains 12 (nesting depth added 30). Most of this is not in the body itself: 14 of the 81 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 3232, drawForLine::wrapX, add, …). 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.
Pay.paymentSaveMap (cognitive 80) app/Controller/Admin/Api/Pay.php:140— Pay.paymentSaveMap has cognitive complexity 80 (threshold 15). Drivers by points: if/else 32 (49 pts), boolean chains 19, ternaries 3 (7 pts), loops 4 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ThemeSetting (cognitive 80) assets/admin/controller/config/index.js:144— _ThemeSetting has cognitive complexity 80 (threshold 15). Drivers by points: if/else 41 (46 pts), boolean chains 24, other 4, ternaries 4, error handling 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 80 points are its own statements and the rest belongs to 34 function items inside it that branch (modal, runThemeAct, a function literal at line 266, …). 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.
Commodity.save (cognitive 78) app/Controller/Admin/Api/Commodity.php:405— Commodity.save has cognitive complexity 78 (threshold 15). Drivers by points: if/else 35 (52 pts), boolean chains 18, ternaries 5 (6 pts), loops 2 (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.
mountRemoteProductPicker (cognitive 78) assets/admin/controller/shared/store.js:350— mountRemoteProductPicker has cognitive complexity 78 (threshold 15). Drivers by points: if/else 32 (34 pts), ternaries 20 (27 pts), boolean chains 16, loops 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 78 points are its own statements and the rest belongs to 36 function items inside it that branch (updateSelection, updateExpandButton, onClick, …). 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.
Store.addItem (cognitive 72) app/Controller/Admin/Api/Store.php:1086— Store.addItem has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (42 pts), ternaries 7 (13 pts), boolean chains 11, error handling 1 (2 pts), loops 2, match/switch 1 (2 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.
coupon.createCoupon (cognitive 71) assets/admin/controller/trade/coupon.js:204— coupon.createCoupon has cognitive complexity 71 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 16, ternaries 5 (11 pts), loops 3 (10 pts) (nesting depth added 28). Most of this is not in the body itself: 3 of the 71 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 209, 314, 250, …). 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.
Email.sendRecipients (cognitive 70) app/Service/Bind/Email.php:42— Email.sendRecipients has cognitive complexity 70 (threshold 15). Drivers by points: if/else 10 (33 pts), ternaries 4 (14 pts), loops 5 (11 pts), error handling 3 (9 pts), boolean chains 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
done (cognitive 68) assets/admin/controller/store/home.js:1261— done has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (36 pts), boolean chains 26, ternaries 4 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 10 of the 68 points are its own statements and the rest belongs to 52 function items inside it that branch (a function literal at line 1399, done, formatter, …). 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.
Manage.save (cognitive 67) app/Controller/Admin/Api/Manage.php:120— Manage.save has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 31, if/else 23 (28 pts), ternaries 5 (6 pts), error handling 2 (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.
BusinessLevel.validatedSaveMap (cognitive 64) app/Controller/Admin/Api/BusinessLevel.php:41— BusinessLevel.validatedSaveMap has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 24, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#createOptions (cognitive 64) REDACTED:1587— #createOptions has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 12, loops 4 (9 pts), ternaries 3 (5 pts), other 1 (nesting depth added 23). Most of this is not in the body itself: 1 of the 64 points is its own statement and the rest belongs to 20 function items inside it that branch (queryParams, a function literal at line 1724, a function literal at line 1689, …). 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.
stretchSpansOverChange (cognitive 64) assets/static/codemirror/lib/codemirror.js:1372— stretchSpansOverChange has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 4 (9 pts), boolean chains 8, ternaries 2 (6 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
User.save (cognitive 63) app/Controller/Admin/Api/User.php:85— User.save has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 20, loops 2, 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.
renderToolbar (cognitive 62) assets/admin/js/mobile/fallback.js:2193— renderToolbar has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 29, ternaries 12 (17 pts), if/else 15 (16 pts) (nesting depth added 6). Of this number, 31 points are the body's own statements and 31 belong to 14 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
javascript.CodeMirror.defineMode("javascript").tokenBase (cognitive 57) assets/static/codemirror/mode/javascript/javascript.js:66— javascript.CodeMirror.defineMode("javascript").tokenBase has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 14 (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.
Category.save (cognitive 57) app/Controller/Admin/Api/Category.php:431— Category.save has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 11, ternaries 6 (9 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildToken (cognitive 57) assets/static/codemirror/lib/codemirror.js:1801— buildToken has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (37 pts), ternaries 3 (8 pts), boolean chains 7, loops 2 (5 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.
(anonymous).tokenBase (cognitive 57) assets/static/codemirror/mode/javascript/javascript.js:66— (anonymous).tokenBase has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 14 (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.
codemirror.leftButtonSelect (cognitive 56) assets/static/codemirror/lib/codemirror.js:7475— codemirror.leftButtonSelect has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (45 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 17). Of this number, 19 points are the body's own statements and 37 belong to 6 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.commodity (cognitive 56) app/Controller/User/Api/Index.php:68— Index.commodity has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 4 (8 pts), boolean chains 5, error handling 2 (5 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.
Config.putManyLocked (cognitive 54) app/Model/Config.php:528— Config.putManyLocked has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (32 pts), error handling 4 (10 pts), loops 4 (7 pts), ternaries 2 (5 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.
Group.validatedSaveMap (cognitive 53) app/Controller/Admin/Api/Group.php:34— Group.validatedSaveMap has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 23, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PriceTemplate.applyToConfig (cognitive 51) app/Model/PriceTemplate.php:78— PriceTemplate.applyToConfig has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 8 (15 pts), boolean chains 6, error handling 2, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openFilters (cognitive 51) assets/admin/js/mobile/fallback.js:2055— openFilters has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 21, if/else 16 (19 pts), ternaries 7 (11 pts) (nesting depth added 7). Of this number, 24 points are the body's own statements and 27 belong to 6 function items inside it that branch. To reduce it, split the body: 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.
Coupon.couponExportQuery (cognitive 50) app/Controller/Admin/Api/Coupon.php:115— Coupon.couponExportQuery has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 12, loops 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.
codemirror.findPosH (cognitive 49) assets/static/codemirror/lib/codemirror.js:8708— codemirror.findPosH has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 5 (16 pts), boolean chains 15, loops 1 (2 pts) (nesting depth added 27). 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.
Query.get (cognitive 49) app/Service/Bind/Query.php:152— Query.get has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 9 (16 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
measureCharInner (cognitive 49) assets/static/codemirror/lib/codemirror.js:2489— measureCharInner has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 10, loops 4 (9 pts), ternaries 4 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous).attach.openMenu (cognitive 48) assets/admin/controller/trade/category-tree.js:750— (anonymous).attach.openMenu has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 16, if/else 12 (13 pts) (nesting depth added 7). Of this number, 25 points are the body's own statements and 23 belong to 12 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.
codemirror.markText (cognitive 47) assets/static/codemirror/lib/codemirror.js:5968— codemirror.markText has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 11, loops 1 (3 pts), ternaries 2 (nesting depth added 10). Of this number, 38 points are the body's own statements and 9 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.
Shared.AdjustmentPrice (cognitive 47) app/Service/Bind/Shared.php:803— Shared.AdjustmentPrice has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 6 (18 pts), loops 6 (14 pts), if/else 7 (10 pts), boolean chains 5 (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.
moveVisually (cognitive 47) assets/static/codemirror/lib/codemirror.js:6912— moveVisually has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 12 (16 pts), boolean chains 10, loops 1 (nesting depth added 13). Of this number, 31 points are the body's own statements and 16 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.
CommodityGroup.mobileCommodityTree (cognitive 46) app/Controller/Admin/Api/CommodityGroup.php:214— CommodityGroup.mobileCommodityTree has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 14 (16 pts), boolean chains 6 (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.
Currency.convertCommodityConfigs (cognitive 46) app/Service/Bind/Currency.php:370— Currency.convertCommodityConfigs has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (37 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 30). 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.
_Auth (cognitive 46) assets/admin/controller/store/home.js:516— _Auth has cognitive complexity 46 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 15, error handling 1, other 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 46 points are its own statements and the rest belongs to 25 function items inside it that branch (complete::_register_captcha::done, a function literal at line 701, complete, …). 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.
renderTreeContext (cognitive 46) assets/admin/js/mobile/fallback.js:2628— renderTreeContext has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 8 (15 pts), boolean chains 14 (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.
(anonymous).statement (cognitive 46) assets/static/codemirror/mode/javascript/javascript.js:368— (anonymous).statement has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 9, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
javascript.CodeMirror.defineMode("javascript").statement (cognitive 45) assets/static/codemirror/mode/javascript/javascript.js:368— javascript.CodeMirror.defineMode("javascript").statement has cognitive complexity 45 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
codemirror.onScrollWheel (cognitive 44) assets/static/codemirror/lib/codemirror.js:4509— codemirror.onScrollWheel has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 13, loops 2 (5 pts) (nesting depth added 14). Of this number, 35 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.
modal (cognitive 44) assets/admin/controller/trade/commodity.js:162— modal has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 13, other 6, ternaries 6, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 22 function items inside it that branch (complete::(anonymous)::change, a function literal at line 562, applySharedPremiumMode, …). 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.
click (cognitive 43) assets/admin/controller/shared/store.js:1446— click has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22, boolean chains 17, other 2, ternaries 2. Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 17 function items inside it that branch (a function literal at line 1454, a function literal at line 1487, a function literal at line 1516, …). 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.
brace-fold.CodeMirror.registerHelper("fold","brace") (cognitive 42) assets/static/codemirror/addon/fold/brace-fold.js:14— brace-fold.CodeMirror.registerHelper("fold","brace") has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 19). Of this number, 29 points are the body's own statements and 13 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.
runImportTask (cognitive 42) assets/admin/controller/shared/store.js:1031— runImportTask has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 6 (12 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 16). Most of this is not in the body itself: 4 of the 42 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1047, 1116, 1128, …). 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.
(anonymous) (cognitive 42) assets/static/codemirror/addon/fold/brace-fold.js:14— (anonymous) has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 19). Of this number, 29 points are the body's own statements and 13 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.
(anonymous).indent (cognitive 42) assets/static/codemirror/mode/javascript/javascript.js:895— (anonymous).indent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 14, ternaries 5 (10 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
menu.KTScroll::_getAutoHeight (cognitive 41) REDACTED:2896— menu.KTScroll::_getAutoHeight has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (6 pts), boolean chains 2 (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.
Order.orderExportQuery (cognitive 41) app/Controller/Admin/Api/Order.php:72— Order.orderExportQuery has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 11, loops 5, 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.
Store.remoteWidget (cognitive 41) app/Controller/Admin/Api/Store.php:523— Store.remoteWidget has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 7, ternaries 3 (6 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.confirmPayDelete (cognitive 40) assets/admin/controller/pay/api.js:99— api.confirmPayDelete has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 27, if/else 8, ternaries 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 105, 116, 164, …). 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.
xml.CodeMirror.defineMode("xml").indent (cognitive 40) assets/static/codemirror/mode/xml/xml.js:340— xml.CodeMirror.defineMode("xml").indent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 9, loops 3 (5 pts), ternaries 1 (2 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.
Commodity.commodityDeleteImpact (cognitive 40) app/Controller/Admin/Api/Commodity.php:141— Commodity.commodityDeleteImpact has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (9 pts), ternaries 3 (6 pts), boolean chains 2 (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.
_ShowRebindPlan (cognitive 40) assets/admin/controller/store/home.js:1067— _ShowRebindPlan has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 18 (21 pts), if/else 9 (12 pts), boolean chains 6, loops 1 (nesting depth added 6). Most of this is not in the body itself: 13 of the 40 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 1129, row, a function literal at line 1158, …). 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.
(anonymous) (cognitive 40) assets/static/codemirror/lib/codemirror.js:14— (anonymous) has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 20, if/else 11 (12 pts), loops 4, ternaries 4 (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.
(anonymous).indent (cognitive 40) assets/static/codemirror/mode/xml/xml.js:340— (anonymous).indent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 9, loops 3 (5 pts), ternaries 1 (2 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.
workflows.renderPageActions (cognitive 39) assets/admin/js/mobile/workflows.js:1067— workflows.renderPageActions has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 26, if/else 10 (12 pts), ternaries 1 (nesting depth added 2). Of this number, 22 points are the body's own statements and 17 belong to 7 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.
javascript.CodeMirror.defineMode("javascript").findFatArrow (cognitive 39) assets/static/codemirror/mode/javascript/javascript.js:185— javascript.CodeMirror.defineMode("javascript").findFatArrow has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Order.calcAmount (cognitive 39) app/Service/Bind/Order.php:120— Order.calcAmount has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 8, loops 3 (7 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Order.getCost (cognitive 39) app/Service/Bind/Order.php:376— Order.getCost has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 5 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Order.getTradeAmount (cognitive 39) app/Service/Bind/Order.php:1510— Order.getTradeAmount has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 10, loops 1 (2 pts), ternaries 1 (2 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.
clear (cognitive 39) assets/static/codemirror/lib/codemirror.js:5858— clear has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 9, 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.
(anonymous) (cognitive 39) assets/static/codemirror/addon/fold/comment-fold.js:16— (anonymous) has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 7, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous).findFatArrow (cognitive 39) assets/static/codemirror/mode/javascript/javascript.js:185— (anonymous).findFatArrow has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comment-fold.CodeMirror.registerGlobalHelper("fold","comment") (cognitive 38) assets/static/codemirror/addon/fold/comment-fold.js:16— comment-fold.CodeMirror.registerGlobalHelper("fold","comment") has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Card.save (cognitive 38) app/Controller/Admin/Api/Card.php:333— Card.save has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (31 pts), ternaries 3, error handling 1 (2 pts), boolean chains 1, 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.
User.theme (cognitive 38) app/Controller/Base/View/User.php:55— User.theme has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4, ternaries 2 (4 pts), 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.
Security.personal (cognitive 38) app/Controller/User/Api/Security.php:53— Security.personal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 6, loops 3, ternaries 1 (3 pts), error handling 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.
invalidFormField (cognitive 38) assets/admin/js/mobile/workflows.js:271— invalidFormField has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 12, ternaries 3 (5 pts), loops 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nodeAndOffsetInLineMap (cognitive 38) assets/static/codemirror/lib/codemirror.js:2441— nodeAndOffsetInLineMap has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (9 pts), boolean chains 7, ternaries 1 (4 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.
fallback.renderReferenceCard (cognitive 37) assets/admin/js/mobile/fallback.js:441— fallback.renderReferenceCard has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 13, ternaries 4 (5 pts) (nesting depth added 8). Of this number, 36 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.
Coupon.save (cognitive 37) app/Controller/Admin/Api/Coupon.php:254— Coupon.save has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 8, error handling 1 (2 pts), ternaries 2, 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.
Authentication.register (cognitive 37) app/Controller/User/Api/Authentication.php:48— Authentication.register has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 10, error handling 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.
Category.save (cognitive 37) app/Controller/User/Api/Category.php:54— Category.save has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 10, ternaries 3 (4 pts), loops 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.
Index.card (cognitive 37) app/Controller/User/Api/Index.php:298— Index.card has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4 (9 pts), boolean chains 2, ternaries 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.
Plugin.hook (cognitive 37) kernel/Util/Plugin.php:132— Plugin.hook has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 1 (5 pts), boolean chains 4, loops 1 (2 pts) (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.
_verifyDialog (cognitive 37) assets/common/js/util.js:355— _verifyDialog has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 14, if/else 13, ternaries 10. Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 423, submit, a function literal at line 489, …). 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.
_Bill (cognitive 37) assets/admin/controller/store/home.js:827— _Bill has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 6 (10 pts), boolean chains 5 (nesting depth added 15). Most of this is not in the body itself: 13 of the 37 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 880, complete, complete, …). 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.
openComposer (cognitive 37) assets/admin/controller/user/message.js:360— openComposer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 12, ternaries 6 (8 pts) (nesting depth added 4). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 15 function items inside it that branch (submit::save::done, submit, submit::save::error, …). 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.
applyTextInput (cognitive 37) assets/static/codemirror/lib/codemirror.js:8146— applyTextInput has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 9, ternaries 3 (6 pts), loops 2 (5 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.
Order.orderSuccess (cognitive 36) app/Service/Bind/Order.php:1170— Order.orderSuccess has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 2 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shared.syncRemoteItem (cognitive 36) app/Service/Bind/Shared.php:1032— Shared.syncRemoteItem has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 9, ternaries 5 (7 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.
Purge.orphanFiles (cognitive 36) app/Util/CardFile/Purge.php:315— Purge.orphanFiles has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 6 (10 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UploadGuard.jpegOrientation (cognitive 36) app/Util/UploadGuard.php:192— UploadGuard.jpegOrientation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 3 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· post (cognitive 36) · ×1
post (cognitive 36) assets/common/js/util.js:242— post has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 9 (10 pts), boolean chains 4, error handling 1 (nesting depth added 11). Of this number, 19 points are the body's own statements and 17 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registerEventHandlers (cognitive 36) assets/static/codemirror/lib/codemirror.js:7960— registerEventHandlers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 8018, a function literal at line 8002, a function literal at line 7965, …). 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.
Category.safeCategoryDeleteImpact (cognitive 35) app/Controller/Admin/Api/Category.php:83— Category.safeCategoryDeleteImpact has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 9 (14 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RechargeOrder.exportQuery (cognitive 35) app/Controller/Admin/Api/RechargeOrder.php:64— RechargeOrder.exportQuery has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 10, loops 4 (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.
Card.save (cognitive 35) app/Controller/User/Api/Card.php:75— Card.save has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 3, 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.
Message.save (cognitive 35) app/Service/Bind/Message.php:722— Message.save has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 10, ternaries 4 (6 pts), loops 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.
initMessageCenter (cognitive 35) assets/user/js/glass.js:327— initMessageCenter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 19). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 337, a function literal at line 370, a function literal at line 378, …). 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.
makeChangeFromHistory (cognitive 35) assets/static/codemirror/lib/codemirror.js:5341— makeChangeFromHistory has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 10, ternaries 4 (6 pts), loops 3 (nesting depth added 7). Of this number, 28 points are the body's own statements and 7 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.
onDrop (cognitive 35) assets/static/codemirror/lib/codemirror.js:6532— onDrop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 2 (6 pts), error handling 1 (2 pts) (nesting depth added 14). Of this number, 28 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.
codemirror.regChange (cognitive 34) assets/static/codemirror/lib/codemirror.js:3002— codemirror.regChange has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
codemirror.indentLine (cognitive 34) assets/static/codemirror/lib/codemirror.js:8078— codemirror.indentLine has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 2 (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.
codemirror.addEditorMethods (cognitive 34) assets/static/codemirror/lib/codemirror.js:8268— codemirror.addEditorMethods has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 34. 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.
css.CodeMirror.defineMode("css") (cognitive 34) assets/static/codemirror/mode/css/css.js:14— css.CodeMirror.defineMode("css") has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 33, if/else 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.
glass.refreshMessageCenter (cognitive 34) assets/user/js/glass.js:234— glass.refreshMessageCenter has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (12 pts), ternaries 8 (9 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 243, 284). 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.
App.update (cognitive 34) app/Service/Bind/App.php:427— App.update has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), ternaries 1 (4 pts), error handling 1 (3 pts), loops 2 (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.
Currency.convertIniMoney (cognitive 34) app/Service/Bind/Currency.php:430— Currency.convertIniMoney has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (12 pts), boolean chains 3, error handling 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.
Image.createThumbnail (cognitive 34) app/Service/Bind/Image.php:27— Image.createThumbnail has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 5, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shop.getCategory (cognitive 34) app/Service/Bind/Shop.php:36— Shop.getCategory has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
syncSettingsNavigation (cognitive 34) assets/admin/js/mobile/workflows.js:768— syncSettingsNavigation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13, boolean chains 11, ternaries 10. Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 774, setActive, updateActive, …). 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.
buildLineContent (cognitive 34) assets/static/codemirror/lib/codemirror.js:1734— buildLineContent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 9, ternaries 3 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
coordsCharInner (cognitive 34) assets/static/codemirror/lib/codemirror.js:2753— coordsCharInner has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (24 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 13). Of this number, 31 points are the body's own statements and 3 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.
endOfLine (cognitive 34) assets/static/codemirror/lib/codemirror.js:6884— endOfLine has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 6 (13 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
menu.KTDrawer (cognitive 33) REDACTED:3267— menu.KTDrawer has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (27 pts), boolean chains 6 (nesting depth added 2). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 10 function items inside it that branch (_getOption, _update, _handlers, …). 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.
Manage.set (cognitive 33) app/Controller/Admin/Api/Manage.php:370— Manage.set has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 13, 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.
SharedCurrency.config (cognitive 33) app/Util/SharedCurrency.php:145— SharedCurrency.config has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (9 pts), boolean chains 4, error handling 2, ternaries 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.
SkuStock.outages (cognitive 33) app/Util/SkuStock.php:29— SkuStock.outages has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
flushReadyQueue (cognitive 33) REDACTED:72— flushReadyQueue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 7, ternaries 3, loops 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 139, execute, a function literal at line 95, …). 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.
renderSelectionDock (cognitive 33) assets/admin/js/mobile/fallback.js:2329— renderSelectionDock has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 14, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 13 function items inside it that branch (actionIcon, a function literal at line 2360, a function literal at line 2423, …). 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.
pollContent (cognitive 33) assets/static/codemirror/lib/codemirror.js:9058— pollContent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, loops 4 (5 pts), ternaries 3 (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.
renderRelated (cognitive 33) assets/user/controller/user/ticket.detail.js:179— renderRelated has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, ternaries 7 (14 pts), if/else 2 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous).inText (cognitive 33) assets/static/codemirror/mode/xml/xml.js:69— (anonymous).inText has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 2 (5 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.
menu.KTMenu.initGlobalHandlers (cognitive 32) REDACTED:2398— menu.KTMenu.initGlobalHandlers has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 12). None of this is in the body itself: all 32 points belong to 7 function literals inside it that branch (lines 2400, 2480, 2458, …). 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.
overlay.focusInvalid (cognitive 32) REDACTED:1063— overlay.focusInvalid has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 14, if/else 12 (14 pts), ternaries 4 (nesting depth added 2). Of this number, 26 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.
Form.getData (cognitive 32) REDACTED:977— Form.getData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 12, match/switch 1, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 992, 980, 982, …). 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.
css.CodeMirror.defineMode("css").tokenBase (cognitive 32) assets/static/codemirror/mode/css/css.js:40— css.CodeMirror.defineMode("css").tokenBase has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 7 (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.
App.rebindPlan (cognitive 32) app/Service/Bind/App.php:367— App.rebindPlan has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 5 (8 pts), boolean chains 5, 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.
priceTemplate.applyModal (cognitive 31) assets/admin/controller/shared/priceTemplate.js:194— priceTemplate.applyModal has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (14 pts), boolean chains 12, if/else 5 (nesting depth added 2). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 242, 262, 314, …). 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.
javascript.CodeMirror.defineMode("javascript").indent (cognitive 31) assets/static/codemirror/mode/javascript/javascript.js:895— javascript.CodeMirror.defineMode("javascript").indent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 13, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Email.sendCaptcha (cognitive 31) app/Service/Bind/Email.php:374— Email.sendCaptcha has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (30 pts), match/switch 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Order.commodityHasPositiveValue (cognitive 31) app/Service/Bind/Order.php:563— Order.commodityHasPositiveValue has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 3 (4 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.
(anonymous).attach.onKey (cognitive 31) assets/admin/controller/trade/category-tree.js:1041— (anonymous).attach.onKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8, ternaries 1 (4 pts), match/switch 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#setField (cognitive 31) assets/common/js/component/search.js:413— #setField has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 3 (7 pts), boolean chains 5, error handling 1 (4 pts) (nesting depth added 13). Of this number, 27 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.
onContextMenu (cognitive 31) assets/static/codemirror/lib/codemirror.js:9608— onContextMenu has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (rehide, prepareSelectAllHack, rehide::poll, …). 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.
(anonymous).tokenBase (cognitive 31) assets/static/codemirror/mode/css/css.js:40— (anonymous).tokenBase has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 6 (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.
Install.html.renderDbResult (cognitive 30) app/View/Install.html:1175— Install.html.renderDbResult has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 2 (7 pts), boolean chains 5, match/switch 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.
card.uploadCard (cognitive 30) assets/admin/controller/trade/card.js:104— card.uploadCard has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (10 pts), ternaries 7, boolean chains 3 (nesting depth added 10). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 139, a function literal at line 213, refresh, …). 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.
order.$(".btn-app-export").off().on() (cognitive 30) assets/admin/controller/trade/order.js:743— order.$(".btn-app-export").off().on() has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (12 pts), ternaries 3, error handling 1 (nesting depth added 1). None of this is in the body itself: all 30 points belong to 2 function literals inside it that branch (lines 785, 828). 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.
codemirror.updateHeightsInViewport (cognitive 30) assets/static/codemirror/lib/codemirror.js:3358— codemirror.updateHeightsInViewport has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 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.
xml.CodeMirror.defineMode("xml").inText (cognitive 30) assets/static/codemirror/mode/xml/xml.js:69— xml.CodeMirror.defineMode("xml").inText has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3, ternaries 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.
Plugin.getPlugins (cognitive 30) app/Controller/Admin/Api/Plugin.php:24— Plugin.getPlugins has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Query.save (cognitive 30) app/Service/Bind/Query.php:284— Query.save has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 4 (5 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.
Shop.getItem (cognitive 30) app/Service/Bind/Shop.php:124— Shop.getItem has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 1 (4 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UploadPurge.stageForDeletion (cognitive 30) app/Util/UploadPurge.php:88— UploadPurge.stageForDeletion has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 12, loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
previewMessage (cognitive 30) assets/common/js/component.js:176— previewMessage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13, boolean chains 11, ternaries 5 (6 pts) (nesting depth added 1). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 238, end, success, …). 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.
refreshMessageCenter::success (cognitive 30) assets/user/js/glass.js:243— refreshMessageCenter::success has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), ternaries 9 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
presentPopup (cognitive 30) REDACTED:1130— presentPopup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 22, ternaries 11, error handling 4 (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.
overlay.firstInvalidField (cognitive 29) REDACTED:1041— overlay.firstInvalidField has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 6, error handling 2 (5 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
passkey.add (cognitive 29) assets/user/controller/security/passkey.js:235— passkey.add has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 10, error handling 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
App.plugins (cognitive 29) REDACTED:121— App.plugins has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Category.status (cognitive 29) app/Controller/Admin/Api/Category.php:710— Category.status has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (11 pts), boolean chains 5 (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.
Pay.getPluginInfo (cognitive 29) app/Service/Bind/Pay.php:257— Pay.getPluginInfo has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 5 (11 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
configureShell (cognitive 29) assets/admin/controller/config/wiki.mobile.js:190— configureShell has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, error handling 2 (4 pts), ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (shellClickHandler, a function literal at line 210, a function literal at line 214, …). 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.
click (cognitive 29) assets/admin/controller/shared/store.js:1570— click has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6, ternaries 3 (4 pts), other 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 16 function items inside it that branch ((anonymous)::submit, a function literal at line 1646, (anonymous)::renderComplete, …). 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.
addWidget (cognitive 29) REDACTED:474— addWidget has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 6 (7 pts), boolean chains 6, match/switch 1, other 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 14 belong to 11 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.
#getSelectionRowState (cognitive 29) REDACTED:806— #getSelectionRowState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, error handling 3 (5 pts), ternaries 2 (3 pts), other 2 (nesting depth added 6). Of this number, 26 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conflictingCollapsedRange (cognitive 29) assets/static/codemirror/lib/codemirror.js:1535— conflictingCollapsedRange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 9, ternaries 2 (8 pts), loops 1 (2 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.
recharge.order.$(".btn-app-export").off().on() (cognitive 28) assets/admin/controller/user/recharge.order.js:222— recharge.order.$(".btn-app-export").off().on() has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (12 pts), ternaries 2, error handling 1 (nesting depth added 1). None of this is in the body itself: all 28 points belong to 2 function literals inside it that branch (lines 271, 314). 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.
workflows.markSemanticPage (cognitive 28) assets/admin/js/mobile/workflows.js:687— workflows.markSemanticPage has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, ternaries 6 (13 pts), if/else 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 13 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.
App.getUpdates (cognitive 28) REDACTED:229— App.getUpdates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 pts), ternaries 2 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Message.sendEmailBatch (cognitive 28) app/Service/Bind/Message.php:373— Message.sendEmailBatch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (6 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.headerIpCandidates (cognitive 28) app/Util/Client.php:346— Client.headerIpCandidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (6 pts), boolean chains 2, 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.
Lang.scanExtensionPacks (cognitive 28) kernel/Util/Lang.php:741— Lang.scanExtensionPacks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
confirmPayDelete::done (cognitive 28) assets/admin/controller/pay/api.js:105— confirmPayDelete::done has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 19, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
modal (cognitive 28) assets/admin/controller/pay/api.js:496— modal has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 5 (6 pts), loops 2 (5 pts), boolean chains 2, other 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 9 function items inside it that branch (change, fillConfigs, change, …). 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.
done (cognitive 28) assets/admin/controller/store/developer.js:621— done has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, other 2, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 26 function items inside it that branch (formatter, formatter, click, …). 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.
syncContextNavigation (cognitive 28) assets/admin/js/mobile/workflows.js:874— syncContextNavigation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 14 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.
(anonymous) (cognitive 28) assets/user/controller/user/message.js:1— (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
card.$(".btn-app-export").off().on() (cognitive 27) assets/admin/controller/trade/card.js:611— card.$(".btn-app-export").off().on() has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (8 pts), ternaries 5 (6 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 656, 683). 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.
codemirror.removeReadOnlyRanges (cognitive 27) assets/static/codemirror/lib/codemirror.js:1445— codemirror.removeReadOnlyRanges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 10). Of this number, 18 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.
jquery.pjax.onPjaxPopstate (cognitive 27) assets/static/jquery.pjax.js:424— jquery.pjax.onPjaxPopstate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4 (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.
Card.edit (cognitive 27) app/Controller/Admin/Api/Card.php:630— Card.edit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7, 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.
App.updatePlugin (cognitive 27) app/Service/Bind/App.php:216— App.updatePlugin has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 3 (6 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ticket.delete (cognitive 27) app/Service/Bind/Ticket.php:1149— Ticket.delete has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (6 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bind (cognitive 27) REDACTED:328— bind has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 7). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 353, 382, 330, …). 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.
click (cognitive 27) assets/admin/controller/user/cash.js:114— click has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, ternaries 8, if/else 7, other 1. Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (success, yes, a function literal at line 141, …). 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.
treeMetadata (cognitive 27) assets/admin/js/mobile/fallback.js:2547— treeMetadata has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 10, ternaries 4 (nesting depth added 2). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2556, resolveDepth, a function literal at line 2582, …). 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.
markedSpansAfter (cognitive 27) assets/static/codemirror/lib/codemirror.js:1352— markedSpansAfter has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (15 pts), boolean chains 6, if/else 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
init (cognitive 27) assets/static/codemirror/lib/codemirror.js:8808— init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3, loops 1 (nesting depth added 6). None of this is in the body itself: all 27 points belong to 11 function items inside it that branch (onCopyCut, belongsToInput, a function literal at line 8824, …). 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.
showPrimarySelection (cognitive 27) assets/static/codemirror/lib/codemirror.js:8917— showPrimarySelection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 10, ternaries 1 (2 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.
index.renderChart (cognitive 26) assets/admin/controller/dashboard/index.js:298— index.renderChart has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 5, if/else 5 (nesting depth added 3). Of this number, 15 points are the body's own statements and 11 belong to 5 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.
fallback.detailContent (cognitive 26) assets/admin/js/mobile/fallback.js:1395— fallback.detailContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 9, error handling 1 (2 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1417, 1414, 1424). 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.
codemirror.copyHistoryArray (cognitive 26) assets/static/codemirror/lib/codemirror.js:5040— codemirror.copyHistoryArray has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message.renderCartoonMobile (cognitive 26) assets/user/controller/user/message.js:231— message.renderCartoonMobile has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 6 (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.
Card.cardExportQuery (cognitive 26) app/Controller/Admin/Api/Card.php:147— Card.cardExportQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, loops 4, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config.consumeTestSendQuota (cognitive 26) REDACTED:580— Config.consumeTestSendQuota has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 4, ternaries 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.
CommodityOrder.data (cognitive 26) app/Controller/User/Api/CommodityOrder.php:77— CommodityOrder.data has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 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.
Currency.convertAll (cognitive 26) app/Service/Bind/Currency.php:131— Currency.convertAll has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (4 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.
Image.downloadRemoteImage (cognitive 26) app/Service/Bind/Image.php:256— Image.downloadRemoteImage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (4 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.
GridTracks.track (cognitive 26) kernel/Waf/Css/GridTracks.php:37— GridTracks.track has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, ternaries 2 (3 pts), 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.
KTUtil.slide (cognitive 26) REDACTED:896— KTUtil.slide has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, ternaries 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 4 belong to 10 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.
validateCompose (cognitive 26) assets/admin/controller/user/message.js:275— validateCompose has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 6, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
renderCardSubtitle (cognitive 26) assets/admin/js/mobile/fallback.js:655— renderCardSubtitle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 25 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.
runMode (cognitive 26) assets/static/codemirror/lib/codemirror.js:1211— runMode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
highlightWorker (cognitive 26) assets/static/codemirror/lib/codemirror.js:3991— highlightWorker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 3998, 4027). 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.
render (cognitive 26) REDACTED:222— render has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 7, if/else 6 (7 pts) (nesting depth added 6). Of this number, 15 points are the body's own statements and 11 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.
sanitizeHtml (cognitive 26) assets/user/controller/user/ticket.detail.js:42— sanitizeHtml has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, ternaries 2, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 56, a function literal at line 71, cleanUrl, …). 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.
order.showRefund (cognitive 25) assets/admin/controller/trade/order.js:159— order.showRefund has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 9, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 175, a function literal at line 202, a function literal at line 223, …). 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.
Form.disposeControl (cognitive 25) REDACTED:170— Form.disposeControl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (5 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Form.destroy (cognitive 25) REDACTED:2035— Form.destroy has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), error handling 3 (5 pts), ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 2076, 2041, 2051, …). 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.
Loading.show (cognitive 25) assets/common/js/component/loading.js:15— Loading.show has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 5 (12 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.
codemirror.alignHorizontally (cognitive 25) assets/static/codemirror/lib/codemirror.js:4281— codemirror.alignHorizontally has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemirror.locateNodeInLineView (cognitive 25) assets/static/codemirror/lib/codemirror.js:9280— codemirror.locateNodeInLineView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 5 (12 pts), loops 5 (6 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.
javascript.CodeMirror.defineMode("javascript").expressionInner (cognitive 25) assets/static/codemirror/mode/javascript/javascript.js:430— javascript.CodeMirror.defineMode("javascript").expressionInner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Message.siteBaseUrl (cognitive 25) app/Service/Bind/Message.php:286— Message.siteBaseUrl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, ternaries 2 (4 pts), error handling 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.
Order.assertCouponApplicable (cognitive 25) app/Service/Bind/Order.php:341— Order.assertCouponApplicable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, 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.
Shop.substationPriceIncrease (cognitive 25) app/Service/Bind/Shop.php:383— Shop.substationPriceIncrease has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 9, boolean chains 1, ternaries 1 (nesting depth added 8). 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.
Ticket.visibleCommodityQuery (cognitive 25) app/Service/Bind/Ticket.php:553— Ticket.visibleCommodityQuery has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 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.
UploadGuard.contentError (cognitive 25) app/Util/UploadGuard.php:42— UploadGuard.contentError has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (8 pts), ternaries 2 (3 pts), match/switch 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Shadow.layer (cognitive 25) kernel/Waf/Css/Shadow.php:45— Shadow.layer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 6 (10 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_Save (cognitive 25) assets/admin/controller/config/index.js:505— _Save has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 7, other 1 (nesting depth added 1). None of this is in the body itself: all 25 points belong to 7 function items inside it that branch (submitSettings::done, submitSettings, guardDesktopPjaxLeave, …). 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.
sanitizePluginDisplayHtml (cognitive 25) assets/admin/controller/config/plugin.js:44— sanitizePluginDisplayHtml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, ternaries 3, other 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 59, normalizeColor, walk, …). 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.
mobileDeliverySubmit (cognitive 25) assets/admin/controller/trade/order.js:257— mobileDeliverySubmit has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 4, other 3. None of this is in the body itself: all 25 points belong to 5 function items inside it that branch (a function literal at line 260, a function literal at line 298, (anonymous)::(anonymous)::done, …). 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.
mobileAccountSubmit (cognitive 25) assets/admin/controller/user/index.js:44— mobileAccountSubmit has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 8, other 4, ternaries 4. None of this is in the body itself: all 25 points belong to 5 function items inside it that branch (a function literal at line 47, a function literal at line 95, (anonymous)::(anonymous)::done, …). 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.
#openColumnDetail (cognitive 25) REDACTED:443— #openColumnDetail has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 4, other 2 (nesting depth added 6). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 447, a function literal at line 457, a function literal at line 460, …). 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.
updateLineGutter (cognitive 25) assets/static/codemirror/lib/codemirror.js:2177— updateLineGutter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scrollPosIntoView (cognitive 25) assets/static/codemirror/lib/codemirror.js:3455— scrollPosIntoView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (8 pts), boolean chains 2, 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.
patchDisplay (cognitive 25) assets/static/codemirror/lib/codemirror.js:4225— patchDisplay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 10). Of this number, 22 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.
locateNodeInLineView::find (cognitive 25) assets/static/codemirror/lib/codemirror.js:9301— locateNodeInLineView::find has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 2 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous).expressionInner (cognitive 25) assets/static/codemirror/mode/javascript/javascript.js:430— (anonymous).expressionInner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
set.saveSettings (cognitive 24) assets/admin/controller/manage/set.js:159— set.saveSettings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 11, ternaries 1. Of this number, 14 points are the body's own statements and 10 belong to 4 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.
commodity.uploadCard (cognitive 24) assets/admin/controller/trade/commodity.js:793— commodity.uploadCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7, loops 3 (7 pts), ternaries 7, boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 828, a function literal at line 902, refresh, …). 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.
Config.security (cognitive 24) REDACTED:724— Config.security has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3, error handling 2, 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.
Store.sharedDomain (cognitive 24) app/Controller/Admin/Api/Store.php:75— Store.sharedDomain has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 7, ternaries 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Store.save (cognitive 24) app/Controller/Admin/Api/Store.php:890— Store.save has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, ternaries 4, error handling 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Cash.submit (cognitive 24) app/Controller/User/Api/Cash.php:35— Cash.submit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coupon.save (cognitive 24) app/Controller/User/Api/Coupon.php:62— Coupon.save has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1, ternaries 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.
File.copyDirectory (cognitive 24) app/Util/File.php:25— File.copyDirectory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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.
menuContent (cognitive 24) assets/admin/js/mobile/navigation.js:125— menuContent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 5 (nesting depth added 1). Of this number, 18 points are the body's own statements and 6 belong to 6 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.
bidiSimplify (cognitive 24) assets/static/codemirror/lib/codemirror.js:7613— bidiSimplify has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7 (9 pts), boolean chains 6 (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.
defineOptions (cognitive 24) assets/static/codemirror/lib/codemirror.js:7708— defineOptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (6 pts), boolean chains 4, loops 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 29 function items inside it that branch (a function literal at line 7774, option, a function literal at line 7743, …). 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.
store.modal (cognitive 23) assets/admin/controller/shared/store.js:1273— store.modal has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (7 pts), if/else 6 (nesting depth added 2). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1295, 1289, 1301, …). 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.
lifecycle.mount (cognitive 23) assets/admin/js/mobile/lifecycle.js:62— lifecycle.mount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
navigation.handleClick (cognitive 23) assets/admin/js/mobile/navigation.js:255— navigation.handleClick has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 19 points are the body's own statements and 4 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.
codemirror.normalizeKeyMap (cognitive 23) assets/static/codemirror/lib/codemirror.js:6774— codemirror.normalizeKeyMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemirror.onMouseDown (cognitive 23) assets/static/codemirror/lib/codemirror.js:7335— codemirror.onMouseDown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, 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.
codemirror.domTextBetween::walk (cognitive 23) assets/static/codemirror/lib/codemirror.js:9224— codemirror.domTextBetween::walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 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.
javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma (cognitive 23) assets/static/codemirror/mode/javascript/javascript.js:459— javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, ternaries 3 (4 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.
recharge.updateSummary (cognitive 23) assets/user/controller/user/recharge.js:136— recharge.updateSummary has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7, boolean chains 5 (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.
Commodity.fastEnable (cognitive 23) app/Controller/Admin/Api/Commodity.php:880— Commodity.fastEnable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, 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.
Commodity.inventoryState (cognitive 23) app/Controller/Shared/Commodity.php:241— Commodity.inventoryState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commodity.inventory (cognitive 23) app/Controller/Shared/Commodity.php:299— Commodity.inventory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (6 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Business.saveConfig (cognitive 23) app/Controller/User/Api/Business.php:111— Business.saveConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (21 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.
Master.setCommodity (cognitive 23) app/Controller/User/Api/Master.php:213— Master.setCommodity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 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.
Pay.savePluginConfig (cognitive 23) app/Service/Bind/Pay.php:396— Pay.savePluginConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (5 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.
Shop.getItemStock (cognitive 23) app/Service/Bind/Shop.php:270— Shop.getItemStock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Csp.extraSources (cognitive 23) app/Util/Csp.php:216— Csp.extraSources has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (9 pts), boolean chains 2, 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.
Lang.mapTag (cognitive 23) kernel/Util/Lang.php:383— Lang.mapTag has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 5 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lang.transObjectList (cognitive 23) kernel/Util/Lang.php:1052— Lang.transObjectList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (3 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sanitizeRichHtml (cognitive 23) assets/common/js/component.js:43— sanitizeRichHtml has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, other 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 56, a function literal at line 72, walk). 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.
renderChannels (cognitive 23) assets/admin/controller/dashboard/index.js:560— renderChannels has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 6, boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 573, syncToggle, a function literal at line 566, …). 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.
(anonymous).attach (cognitive 23) assets/admin/controller/trade/category-tree.js:230— (anonymous).attach has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1290, 1278, 1287, …). 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.
definitionValue (cognitive 23) assets/admin/js/mobile/fallback.js:861— definitionValue has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, error handling 3 (6 pts), if/else 5, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cardOfferContent (cognitive 23) assets/admin/js/mobile/fallback.js:1814— cardOfferContent has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), error handling 2 (4 pts), ternaries 3 (nesting depth added 3). Of this number, 14 points are the body's own statements and 9 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.
markedSpansBefore (cognitive 23) assets/static/codemirror/lib/codemirror.js:1340— markedSpansBefore has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (11 pts), boolean chains 6, if/else 2 (4 pts), loops 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.
calculateScrollPos (cognitive 23) assets/static/codemirror/lib/codemirror.js:3499— calculateScrollPos has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 9 (10 pts), boolean chains 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.
endOperation_finish (cognitive 23) assets/static/codemirror/lib/codemirror.js:3910— endOperation_finish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeMirror (cognitive 23) assets/static/codemirror/lib/codemirror.js:7883— CodeMirror has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 2). Of this number, 20 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.
poll (cognitive 23) assets/static/codemirror/lib/codemirror.js:9548— poll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 5 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.
findMatchingClose (cognitive 23) assets/static/codemirror/addon/fold/xml-fold.js:91— findMatchingClose has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 3, 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.
(anonymous).atBlock (cognitive 23) assets/static/codemirror/mode/css/css.js:275— (anonymous).atBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 2 (5 pts), 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, 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.
(anonymous).maybeoperatorNoComma (cognitive 23) assets/static/codemirror/mode/javascript/javascript.js:459— (anonymous).maybeoperatorNoComma has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, ternaries 3 (4 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.
index.mobileAccountSubmit.<returned closure> (cognitive 22) assets/admin/controller/user/index.js:47— index.mobileAccountSubmit.<returned closure> has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 8, ternaries 4 (5 pts) (nesting depth added 1). Of this number, 13 points are the body's own statements and 9 belong to 4 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.
ticket.sanitizeRichHtml (cognitive 22) assets/admin/controller/user/ticket.js:111— ticket.sanitizeRichHtml has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 117, 132). 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.
fallback.cardActionIcon (cognitive 22) assets/admin/js/mobile/fallback.js:1777— fallback.cardActionIcon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, 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.
workflows.mount (cognitive 22) assets/admin/js/mobile/workflows.js:1274— workflows.mount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1342, 1327, 1323, …). 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.
codemirror.triggerElectric (cognitive 22) assets/static/codemirror/lib/codemirror.js:8204— codemirror.triggerElectric has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xml-fold.findMatchingOpen (cognitive 22) assets/static/codemirror/addon/fold/xml-fold.js:112— xml-fold.findMatchingOpen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2 (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.openSecret (cognitive 22) assets/user/controller/dashboard/index.js:14— index.openSecret has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 5, if/else 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 4 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.
purchase.record.openSecret (cognitive 22) assets/user/controller/user/purchase.record.js:16— purchase.record.openSecret has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 5, if/else 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 4 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.saveFiles (cognitive 22) app/Controller/Admin/Api/Card.php:456— Card.saveFiles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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.
File.data (cognitive 22) REDACTED:53— File.data has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 4, if/else 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.
Store.remoteItemTree (cognitive 22) app/Controller/Admin/Api/Store.php:252— Store.remoteItemTree has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, error handling 1 (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.
Order.callbackTest (cognitive 22) app/Controller/User/Api/Order.php:129— Order.callbackTest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 1, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Bill.create (cognitive 22) app/Model/Bill.php:58— Bill.create has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Message.cleanContent (cognitive 22) app/Service/Bind/Message.php:155— Message.cleanContent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Ticket.cleanContent (cognitive 22) app/Service/Bind/Ticket.php:750— Ticket.cleanContent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 2, 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.
CategoryTree.forAdmin (cognitive 22) app/Util/CategoryTree.php:52— CategoryTree.forAdmin has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (7 pts), boolean chains 5, if/else 4 (5 pts), ternaries 3 (5 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.
OrderRefund.run (cognitive 22) app/Util/OrderRefund.php:81— OrderRefund.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (5 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.
initializeTable (cognitive 22) assets/admin/controller/pay/api.js:726— initializeTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, boolean chains 8, other 2, ternaries 2. None of this is in the body itself: all 22 points belong to 24 function items inside it that branch (formatter, formatter, formatter, …). 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.
change (cognitive 22) assets/admin/controller/trade/coupon.js:587— change has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 594, 591). 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.
findPosH::moveOnce (cognitive 22) assets/static/codemirror/lib/codemirror.js:8719— findPosH::moveOnce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (8 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
armAutofill (cognitive 22) assets/user/controller/auth/login.js:176— armAutofill has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs 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.
index.confirmFileDelete (cognitive 21) assets/admin/controller/file/index.js:108— index.confirmFileDelete has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 16, if/else 5. Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 114, 148, 152). 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.
coupon.$(".btn-app-export").off().on() (cognitive 21) assets/admin/controller/trade/coupon.js:677— coupon.$(".btn-app-export").off().on() has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), error handling 1, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
order.mobileDeliverySubmit.<returned closure> (cognitive 21) assets/admin/controller/trade/order.js:260— order.mobileDeliverySubmit.<returned closure> has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 4. Of this number, 11 points are the body's own statements and 10 belong to 4 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.
shell.handleClick (cognitive 21) assets/admin/js/mobile/shell.js:229— shell.handleClick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 6 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.
workflows.discoverActions (cognitive 21) assets/admin/js/mobile/workflows.js:973— workflows.discoverActions has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 9, error handling 1. None of this is in the body itself: all 21 points belong to 6 function literals inside it that branch (lines 985, 1003, 975, …). 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.
Commodity.data (cognitive 21) app/Controller/Admin/Api/Commodity.php:297— Commodity.data has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 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.
Config.emailFailureMessage (cognitive 21) REDACTED:1348— Config.emailFailureMessage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (7 pts), if/else 3 (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.
Order.data (cognitive 21) app/Controller/Admin/Api/Order.php:320— Order.data has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 3 (8 pts), boolean chains 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.
Pay.paymentDeleteImpact (cognitive 21) app/Controller/Admin/Api/Pay.php:307— Pay.paymentDeleteImpact has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), loops 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PriceTemplate.computePrice (cognitive 21) app/Controller/Admin/Api/PriceTemplate.php:328— PriceTemplate.computePrice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 8, boolean chains 2, loops 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.
Config.index (cognitive 21) app/Controller/Admin/Config.php:32— Config.index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 4 (6 pts), 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.
Plugin.wikiRes (cognitive 21) app/Controller/Admin/Plugin.php:189— Plugin.wikiRes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, 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.
Authentication.password (cognitive 21) app/Controller/User/Api/Authentication.php:582— Authentication.password has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (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.
Purge.collect (cognitive 21) app/Util/CardFile/Purge.php:188— Purge.collect has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 6, boolean chains 5, ternaries 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.
CommodityLang.widget (cognitive 21) app/Util/CommodityLang.php:48— CommodityLang.widget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginPacker.pack (cognitive 21) app/Util/PluginPacker.php:209— PluginPacker.pack has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, 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.
UploadPurge.inspectUploadPath (cognitive 21) app/Util/UploadPurge.php:30— UploadPurge.inspectUploadPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2, ternaries 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.
ViewSafe.walk (cognitive 21) app/Util/ViewSafe.php:32— ViewSafe.walk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (6 pts), boolean chains 4, 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.
Di.inject (cognitive 21) kernel/Container/Di.php:128— Di.inject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (21 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Plugin.runHookState (cognitive 21) kernel/Util/Plugin.php:96— Plugin.runHookState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (8 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.
Tokens.split (cognitive 21) kernel/Waf/Css/Tokens.php:16— Tokens.split has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, ternaries 2 (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.
acgSecretPopup (cognitive 21) assets/static/acg.js:1073— acgSecretPopup has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 5, if/else 5 (nesting depth added 2). Of this number, 15 points are the body's own statements and 6 belong to 8 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.
sanitizeInlineHtml (cognitive 21) assets/common/js/component.js:106— sanitizeInlineHtml has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, other 3, ternaries 3, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 132, normalizeLink, normalizeColor, …). 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.
addChangeToHistory (cognitive 21) assets/static/codemirror/lib/codemirror.js:4896— addChangeToHistory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.showTestResult (cognitive 20) assets/admin/controller/pay/api.js:320— api.showTestResult has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, ternaries 7, error handling 1 (2 pts), if/else 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
menu.KTScrolltop (cognitive 20) REDACTED:3097— menu.KTScrolltop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (_getOption, _scroll, _construct). 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.
overlay.closeTransientInput (cognitive 20) REDACTED:419— overlay.closeTransientInput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 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, 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.
editorv2.register.destroy (cognitive 20) assets/common/js/editor/markdown/editorv2.js:980— editorv2.register.destroy has cognitive complexity 20 (threshold 15). Drivers by points: error handling 6 (9 pts), if/else 8, boolean chains 3 (nesting depth added 3). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemirror.makeChangeSingleDocInEditor (cognitive 20) assets/static/codemirror/lib/codemirror.js:5469— codemirror.makeChangeSingleDocInEditor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3 (nesting depth added 5). Of this number, 16 points are the body's own statements and 4 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.
javascript.CodeMirror.defineMode("javascript").parseJS (cognitive 20) assets/static/codemirror/mode/javascript/javascript.js:244— javascript.CodeMirror.defineMode("javascript").parseJS has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 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.
Commodity.reorder (cognitive 20) app/Controller/Admin/Api/Commodity.php:726— Commodity.reorder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 8 (10 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.
User.changeAccountBalance (cognitive 20) app/Controller/Admin/Api/User.php:290— User.changeAccountBalance has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Currency.assertConvertNoOverflow (cognitive 20) app/Service/Bind/Currency.php:309— Currency.assertConvertNoOverflow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Purge.forCards (cognitive 20) app/Util/CardFile/Purge.php:38— Purge.forCards has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 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. This shape REPEATS in the file: one other method here (Purge.forOrders) 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.
Purge.forOrders (cognitive 20) app/Util/CardFile/Purge.php:82— Purge.forOrders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 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. This shape REPEATS in the file: one other method here (Purge.forCards) 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.
UploadGuard.sanitizeImage (cognitive 20) app/Util/UploadGuard.php:97— UploadGuard.sanitizeImage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Waf.wafPost (cognitive 20) app/Util/Waf.php:19— Waf.wafPost has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (6 pts), loops 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
hideDropdowns (cognitive 20) REDACTED:2361— hideDropdowns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 4, loops 1 (2 pts) (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.
initTheme (cognitive 20) assets/user/js/glass.js:503— initTheme has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 5). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (apply, resolve, mode, …). 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.
modal (cognitive 20) assets/admin/controller/shared/priceTemplate.js:45— modal has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5, other 3, ternaries 2, error handling 1. None of this is in the body itself: all 20 points belong to 9 function items inside it that branch (a function literal at line 116, complete::(anonymous)::change, a function literal at line 127, …). 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.
(anonymous).attach.treeHtml (cognitive 20) assets/admin/controller/trade/category-tree.js:389— (anonymous).attach.treeHtml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 3 (6 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
keepPageFieldVisible (cognitive 20) assets/admin/js/mobile/viewport.js:137— keepPageFieldVisible has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 5 (6 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 145). 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.
normalizeSelection (cognitive 20) assets/static/codemirror/lib/codemirror.js:4646— normalizeSelection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 2 (5 pts), boolean chains 2, 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.
find (cognitive 20) assets/static/codemirror/lib/codemirror.js:5905— find has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), boolean chains 2, 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.
configureMouse (cognitive 20) assets/static/codemirror/lib/codemirror.js:7392— configureMouse has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 4, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
register.destroy (cognitive 20) assets/common/js/editor/markdown/editorv2.js:980— register.destroy has cognitive complexity 20 (threshold 15). Drivers by points: error handling 6 (9 pts), if/else 8, boolean chains 3 (nesting depth added 3). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous).objprop (cognitive 20) assets/static/codemirror/mode/javascript/javascript.js:522— (anonymous).objprop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
store.fitImportPopupHeight (cognitive 19) assets/admin/controller/shared/store.js:62— store.fitImportPopupHeight 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.
store.importTaskLogText (cognitive 19) assets/admin/controller/shared/store.js:822— store.importTaskLogText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 3 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 824). 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.
commodity.confirmCommodityDelete (cognitive 19) assets/admin/controller/trade/commodity.js:112— commodity.confirmCommodityDelete has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, if/else 5. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 117, 158, 159). 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.
coupon.confirmCouponDelete (cognitive 19) assets/admin/controller/trade/coupon.js:107— coupon.confirmCouponDelete has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 5, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 113, 140, 126, …). 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.
fallback.renderLedgerCard (cognitive 19) assets/admin/js/mobile/fallback.js:728— fallback.renderLedgerCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. 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.
overlay.api.closeAll (cognitive 19) REDACTED:1372— overlay.api.closeAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (nesting depth added 5). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1404, 1384, 1395). 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.
Form.validator (cognitive 19) REDACTED:253— Form.validator has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2 (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.
editorv2.register.alignLine (cognitive 19) assets/common/js/editor/markdown/editorv2.js:714— editorv2.register.alignLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (9 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.
codemirror.getBidiPartAt (cognitive 19) assets/static/codemirror/lib/codemirror.js:329— codemirror.getBidiPartAt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemirror.mergeOldSpans (cognitive 19) assets/static/codemirror/lib/codemirror.js:5016— codemirror.mergeOldSpans has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (8 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.
codemirror.TextareaInput.init (cognitive 19) assets/static/codemirror/lib/codemirror.js:9353— codemirror.TextareaInput.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 7 function items inside it that branch (prepareCopyCut, a function literal at line 9399, a function literal at line 9365, …). 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.
foldcode.doFold (cognitive 19) assets/static/codemirror/addon/fold/foldcode.js:14— foldcode.doFold has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
card.uploadCard (cognitive 19) assets/user/controller/business/card.js:17— card.uploadCard has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 7 (9 pts) (nesting depth added 9). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 42, 77, 115, …). 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.
RechargeOrder.verifyExportToken (cognitive 19) app/Controller/Admin/Api/RechargeOrder.php:255— RechargeOrder.verifyExportToken has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5, error handling 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.
Store.assertRemoteAssetDestination (cognitive 19) app/Controller/Admin/Api/Store.php:661— Store.assertRemoteAssetDestination has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commodity.item (cognitive 19) app/Controller/Shared/Commodity.php:178— Commodity.item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (4 pts), loops 1 (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.
Mcp.pluginConfigSet (cognitive 19) app/Service/Bind/Mcp.php:606— Mcp.pluginConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 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.
Ticket.normalizeTicket (cognitive 19) app/Service/Bind/Ticket.php:265— Ticket.normalizeTicket has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 3, if/else 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.
Client.normalizeTrustedProxyConfig (cognitive 19) app/Util/Client.php:185— Client.normalizeTrustedProxyConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Helper.isInstall (cognitive 19) app/Util/Helper.php:61— Helper.isInstall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 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.
LinkDomainGuard.allowList (cognitive 19) app/Util/LinkDomainGuard.php:88— LinkDomainGuard.allowList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lang.importPackFile (cognitive 19) kernel/Util/Lang.php:813— Lang.importPackFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (3 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.
KTUtil.getResponsiveValue (cognitive 19) REDACTED:1324— KTUtil.getResponsiveValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (4 pts), loops 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.
redactDebugValue::clone (cognitive 19) assets/common/js/util.js:158— redactDebugValue::clone has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 8, error handling 1, 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.
renderConfigForm (cognitive 19) assets/admin/controller/pay/plugin.js:236— renderConfigForm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, error handling 1 (2 pts), other 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (renderComplete, renderComplete::pin, a function literal at line 278, …). 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.
(anonymous).confirmDelete (cognitive 19) assets/admin/controller/trade/category-actions.js:21— (anonymous).confirmDelete has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, ternaries 5, if/else 4, other 3. Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 9 function items inside it that branch (done, a function literal at line 63, a function literal at line 23, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous).attach.bindHost (cognitive 19) assets/admin/controller/trade/category-tree.js:1108— (anonymous).attach.bindHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 9 function literals inside it that branch (lines 1110, 1125, 1146, …). 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.
(anonymous) (cognitive 19) assets/admin/controller/trade/coupon.js:677— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), error handling 1, other 1, 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.
(anonymous).attach.groupBlocks (cognitive 19) assets/admin/controller/trade/drag-sort.js:207— (anonymous).attach.groupBlocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, loops 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 241, isDescendantOf, a function literal at line 224, …). 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.
onKeyDown (cognitive 19) assets/static/codemirror/lib/codemirror.js:7242— onKeyDown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (5 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.
D2 · Cognitive Complexity· save (cognitive 19) · ×1
save (cognitive 19) REDACTED:303— save has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 4, if/else 3. Of this number, 13 points are the body's own statements and 6 belong to 4 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.
register.alignLine (cognitive 19) assets/common/js/editor/markdown/editorv2.js:714— register.alignLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (9 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.
(anonymous).parseJS (cognitive 19) assets/static/codemirror/mode/javascript/javascript.js:244— (anonymous).parseJS has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Install.html.renderDb (cognitive 18) app/View/Install.html:1070— Install.html.renderDb has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). None of this is in the body itself: all 18 points belong to 4 function literals inside it that branch (lines 1132, 1101, 1104, …). 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.
fallback.relativeTimeTimestamp (cognitive 18) assets/admin/js/mobile/fallback.js:122— fallback.relativeTimeTimestamp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 4). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflows.visible (cognitive 18) assets/admin/js/mobile/workflows.js:106— workflows.visible has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, 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.
workflows.releasePageHistoryGuard (cognitive 18) assets/admin/js/mobile/workflows.js:381— workflows.releasePageHistoryGuard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflows.addControl (cognitive 18) assets/admin/js/mobile/workflows.js:947— workflows.addControl has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 5, if/else 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.
codemirror.prepareSelection (cognitive 18) assets/static/codemirror/lib/codemirror.js:3148— codemirror.prepareSelection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
codemirror.makeChange (cognitive 18) assets/static/codemirror/lib/codemirror.js:5301— codemirror.makeChange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 1 (3 pts), 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.
foldgutter.updateFoldInfo (cognitive 18) REDACTED:73— foldgutter.updateFoldInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 80). 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.
javascript.CodeMirror.defineMode("javascript").objprop (cognitive 18) assets/static/codemirror/mode/javascript/javascript.js:522— javascript.CodeMirror.defineMode("javascript").objprop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (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.
jquery.pjax.pjax (cognitive 18) assets/static/jquery.pjax.js:166— jquery.pjax.pjax has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7 (nesting depth added 1). Of this number, 17 points are the body's own statements and 1 belongs to 6 function items 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.
coupon.createCoupon (cognitive 18) assets/user/controller/business/coupon.js:45— coupon.createCoupon has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 6 (8 pts) (nesting depth added 9). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 79, 67, 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.
Card.data (cognitive 18) app/Controller/Admin/Api/Card.php:239— Card.data has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4 (6 pts), loops 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.
Order.verifyOrderExportToken (cognitive 18) app/Controller/Admin/Api/Order.php:278— Order.verifyOrderExportToken has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 5, error handling 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.
Install.importLanguagePacks (cognitive 18) app/Controller/Install.php:532— Install.importLanguagePacks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 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.
Commodity.getItems (cognitive 18) app/Controller/Shared/Commodity.php:46— Commodity.getItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 1 (4 pts), boolean chains 3, 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.
Ticket.applyFilters (cognitive 18) app/Service/Bind/Ticket.php:141— Ticket.applyFilters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Lang.collect (cognitive 18) kernel/Util/Lang.php:562— Lang.collect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, 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.
Gradient.shape (cognitive 18) kernel/Waf/Css/Gradient.php:100— Gradient.shape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderDelta (cognitive 18) assets/admin/controller/dashboard/index.js:141— renderDelta has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 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.
(anonymous).parseResponse (cognitive 18) assets/admin/controller/trade/card-file-upload.js:214— (anonymous).parseResponse has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 1 (3 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.
change (cognitive 18) assets/admin/controller/trade/card.js:494— change has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 10). 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 501, 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.
(anonymous) (cognitive 18) assets/admin/controller/trade/commodity.js:1382— (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 2, other 1. Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function items inside it that branch (submitBatchSettings, a function literal at line 1411, a function literal at line 1393, …). 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.
(anonymous).attach (cognitive 18) assets/admin/controller/trade/drag-sort.js:148— (anonymous).attach has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 3. Of this number, 9 points are the body's own statements and 9 belong to 7 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.
copyConfiguredField (cognitive 18) assets/admin/js/mobile/fallback.js:1020— copyConfiguredField has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 6, error handling 2 (3 pts), ternaries 2 (nesting depth added 1). Of this number, 11 points are the body's own statements and 7 belong to 3 function items 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.
updateTreeCollapsePresentation (cognitive 18) assets/admin/js/mobile/fallback.js:2716— updateTreeCollapsePresentation has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 5, if/else 5 (nesting depth added 2). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2718). 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.
#mobileDisplayValue (cognitive 18) REDACTED:726— #mobileDisplayValue has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 2 (3 pts), error handling 1 (2 pts), other 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.
viewCuttingPoint (cognitive 18) assets/static/codemirror/lib/codemirror.js:3087— viewCuttingPoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update (cognitive 18) assets/static/codemirror/lib/codemirror.js:3646— update has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 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.
updateDisplayIfNeeded (cognitive 18) assets/static/codemirror/lib/codemirror.js:4104— updateDisplayIfNeeded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 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.
fromTextArea (cognitive 18) assets/static/codemirror/lib/codemirror.js:9699— fromTextArea has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 4 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous).top (cognitive 18) assets/static/codemirror/mode/css/css.js:160— (anonymous).top has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, 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.
lang.langCard (cognitive 17) assets/admin/controller/config/lang.js:21— lang.langCard has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
wiki.mobile.destroy (cognitive 17) assets/admin/controller/config/wiki.mobile.js:311— wiki.mobile.destroy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5 (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.
fallback.cardSearchText (cognitive 17) assets/admin/js/mobile/fallback.js:1940— fallback.cardSearchText has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 7, if/else 2 (nesting depth added 4). Of this number, 14 points are the body's own statements and 3 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.
codemirror.lineIsHidden (cognitive 17) assets/static/codemirror/lib/codemirror.js:1602— codemirror.lineIsHidden has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (2 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.
codemirror.postUpdateDisplay (cognitive 17) assets/static/codemirror/lib/codemirror.js:4176— codemirror.postUpdateDisplay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 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.
codemirror.rebaseHistArray (cognitive 17) assets/static/codemirror/lib/codemirror.js:5554— codemirror.rebaseHistArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemirror.leftButtonStartDrag (cognitive 17) assets/static/codemirror/lib/codemirror.js:7423— codemirror.leftButtonStartDrag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 7425, mouseMove). 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.
codemirror.domToPos (cognitive 17) assets/static/codemirror/lib/codemirror.js:9261— codemirror.domToPos 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.
javascript.CodeMirror.defineMode("javascript").classBody (cognitive 17) assets/static/codemirror/mode/javascript/javascript.js:777— javascript.CodeMirror.defineMode("javascript").classBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, 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.
commodity.safeItem (cognitive 17) assets/user/controller/business/commodity.js:17— commodity.safeItem has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 3, if/else 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.
ticket.create.initRemoteSelect (cognitive 17) assets/user/controller/user/ticket.create.js:40— ticket.create.initRemoteSelect has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 3. Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 60, 72, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Category.verifyCategoryDeleteToken (cognitive 17) app/Controller/Admin/Api/Category.php:289— Category.verifyCategoryDeleteToken has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, error handling 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.
Store.remoteItem (cognitive 17) app/Controller/Admin/Api/Store.php:743— Store.remoteItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
User.del (cognitive 17) app/Controller/Admin/Api/User.php:376— User.del has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Plugin.wiki (cognitive 17) app/Controller/Admin/Plugin.php:86— Plugin.wiki has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3, 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.
Commodity.draftCard (cognitive 17) app/Controller/Shared/Commodity.php:425— Commodity.draftCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManageSSO.login (cognitive 17) app/Service/Bind/ManageSSO.php:41— ManageSSO.login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Message.validateImage (cognitive 17) app/Service/Bind/Message.php:1025— Message.validateImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 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.
Recharge.trade (cognitive 17) app/Service/Bind/Recharge.php:40— Recharge.trade has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, match/switch 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.
Shared.factoryQuote (cognitive 17) app/Service/Bind/Shared.php:905— Shared.factoryQuote has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 2 (3 pts), 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.
Ticket.validateImage (cognitive 17) app/Service/Bind/Ticket.php:1345— Ticket.validateImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 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.
FileCache.clearCache (cognitive 17) app/Util/FileCache.php:65— FileCache.clearCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Ini.toArray (cognitive 17) app/Util/Ini.php:59— Ini.toArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
IgnoreStyleTagFilter.cssHasActiveContent (cognitive 17) kernel/Waf/IgnoreStyleTagFilter.php:87— IgnoreStyleTagFilter.cssHasActiveContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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.
(anonymous) (cognitive 17) assets/admin/js/material.js:15— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
KTEventHandler._triggerEvent (cognitive 17) REDACTED:1447— KTEventHandler._triggerEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 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.
D2 · Cognitive Complexity· show (cognitive 17) · ×1
show (cognitive 17) assets/user/js/treasure.js:45— show has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 4, if/else 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 3 belong to 7 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.
controlAvailable (cognitive 17) assets/admin/js/mobile/fallback.js:936— controlAvailable has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 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.
renderTreeToggle (cognitive 17) assets/admin/js/mobile/fallback.js:2744— renderTreeToggle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 2 (nesting depth added 1). 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: 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.
openSheet (cognitive 17) REDACTED:829— openSheet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 2 (nesting depth added 1). Of this number, 15 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
openActions (cognitive 17) REDACTED:901— openActions has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 5, if/else 3. Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 905, 916). 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.
updateViewportVars (cognitive 17) assets/admin/js/mobile/viewport.js:88— updateViewportVars has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 4, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
onKeyPress (cognitive 17) assets/static/codemirror/lib/codemirror.js:7286— onKeyPress has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, 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.
(anonymous).block (cognitive 17) assets/static/codemirror/mode/css/css.js:194— (anonymous).block has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous).classBody (cognitive 17) assets/static/codemirror/mode/javascript/javascript.js:777— (anonymous).classBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, 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.
other.$("#currency-convert-btn").off().on() (cognitive 16) assets/admin/controller/config/other.js:210— other.$("#currency-convert-btn").off().on() has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 1. 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, 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.
plugin.$(".plugin-restart").click() (cognitive 16) assets/admin/controller/config/plugin.js:535— plugin.$(".plugin-restart").click() has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 546, 560, 568, …). 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.
home.requestPurchase (cognitive 16) assets/admin/controller/store/home.js:288— home.requestPurchase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 299, send, a function literal at line 310, …). 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.
fallback.configureShellSearch (cognitive 16) assets/admin/js/mobile/fallback.js:806— fallback.configureShellSearch has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 2. 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, 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.
fallback.openRecordSheet (cognitive 16) assets/admin/js/mobile/fallback.js:1684— fallback.openRecordSheet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, 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.
fallback.rebuild (cognitive 16) assets/admin/js/mobile/fallback.js:3217— fallback.rebuild has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), error handling 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 3220). 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.
overlay.confirmButtonIcon (cognitive 16) REDACTED:74— overlay.confirmButtonIcon has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (16 pts) (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.
overlay.finalize (cognitive 16) REDACTED:360— overlay.finalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 2 function items 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.
overlay.setupSheetDrag::pointerEnd (cognitive 16) REDACTED:784— overlay.setupSheetDrag::pointerEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 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.
Table.setColumns (cognitive 16) REDACTED:220— Table.setColumns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 223). 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. This shape REPEATS in the file: one other method here (Table.setSearch) 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.
Table.setSearch (cognitive 16) REDACTED:554— Table.setSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 558). 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. This shape REPEATS in the file: one other method here (Table.setColumns) 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.
codemirror.updateDoc (cognitive 16) assets/static/codemirror/lib/codemirror.js:4754— codemirror.updateDoc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1, ternaries 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ticket.create.updateSummary (cognitive 16) assets/user/controller/user/ticket.create.js:96— ticket.create.updateSummary has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 4 (5 pts), if/else 3 (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.
ticket.create.submitTicket (cognitive 16) assets/user/controller/user/ticket.create.js:225— ticket.create.submitTicket has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, boolean chains 6, if/else 2. Of this number, 10 points are the body's own statements and 6 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.
Cash.decide (cognitive 16) app/Controller/Admin/Api/Cash.php:55— Cash.decide has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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.
Config.configHttpUrl (cognitive 16) REDACTED:409— Config.configHttpUrl has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, 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.
File.structuredReferenceImpact (cognitive 16) REDACTED:381— File.structuredReferenceImpact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 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.
Plugin.setConfig (cognitive 16) app/Controller/Admin/Api/Plugin.php:110— Plugin.setConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Authentication.totp (cognitive 16) app/Controller/User/Api/Authentication.php:439— Authentication.totp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (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.
Promote.quote (cognitive 16) app/Controller/User/Api/Promote.php:165— Promote.quote has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Upload.send (cognitive 16) app/Controller/User/Api/Upload.php:41— Upload.send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 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.
Save.setMap (cognitive 16) app/Entity/Query/Save.php:115— Save.setMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Message.recipientScope (cognitive 16) app/Service/Bind/Message.php:583— Message.recipientScope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (5 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.
Pay.redactLogSecrets (cognitive 16) app/Service/Bind/Pay.php:41— Pay.redactLogSecrets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (4 pts), ternaries 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shared.unwrapRemoteItem (cognitive 16) app/Service/Bind/Shared.php:290— Shared.unwrapRemoteItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lang.rebuild (cognitive 16) kernel/Util/Lang.php:925— Lang.rebuild has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 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.
commoditys (cognitive 16) assets/static/acg.js:614— commoditys has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 3 (nesting depth added 2). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 618, 623). 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.
renderFlow (cognitive 16) assets/admin/controller/dashboard/index.js:470— renderFlow has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 472). 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.
importItemRequest (cognitive 16) assets/admin/controller/shared/store.js:950— importItemRequest has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, other 2, ternaries 2, error handling 1. None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 966, 950, 999). 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.
(anonymous).attach.nodesHtml (cognitive 16) assets/admin/controller/trade/category-tree.js:363— (anonymous).attach.nodesHtml has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10, boolean chains 6. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 366). 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.
(anonymous).attach.dragPointerMove (cognitive 16) assets/admin/controller/trade/category-tree.js:859— (anonymous).attach.dragPointerMove has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 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.
(anonymous).attach.endDrag (cognitive 16) assets/admin/controller/trade/category-tree.js:985— (anonymous).attach.endDrag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, ternaries 1. Of this number, 12 points are the body's own statements and 4 belong to 6 function items 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.
(anonymous).attach.openActions (cognitive 16) assets/admin/controller/trade/category-tree.js:1158— (anonymous).attach.openActions has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, if/else 3. Of this number, 12 points are the body's own statements and 4 belong to 11 function items 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.
openSkuStock (cognitive 16) assets/admin/controller/trade/commodity.js:1470— openSkuStock has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, if/else 4, other 3, ternaries 3, error handling 1 (2 pts) (nesting depth added 1). None of this is in the body itself: all 16 points belong to 4 function items inside it that branch (a function literal at line 1480, a function literal at line 1471, (anonymous)::esc, …). 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.
click (cognitive 16) assets/admin/controller/user/recharge.order.js:132— click has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3. Of this number, 9 points are the body's own statements and 7 belong to 4 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.
alignReferenceCards (cognitive 16) assets/admin/js/mobile/fallback.js:52— alignReferenceCards has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). 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 62, 60, 78, …). 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.
compactCardDefinitions (cognitive 16) assets/admin/js/mobile/fallback.js:330— compactCardDefinitions has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 1. Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (add, addMetrics, a function literal at line 348, …). 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.
cardSubtitle (cognitive 16) assets/admin/js/mobile/fallback.js:598— cardSubtitle has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 606, 607). 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.
applyRecipePresentation (cognitive 16) assets/admin/js/mobile/fallback.js:1316— applyRecipePresentation has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1326). 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.
setupSheetDrag::pointerDown (cognitive 16) REDACTED:745— setupSheetDrag::pointerDown has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 1, 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.
presentPopup::success (cognitive 16) REDACTED:1194— presentPopup::success has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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.
addAttribute (cognitive 16) REDACTED:603— addAttribute has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4, ternaries 3 (4 pts) (nesting depth added 1). 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, 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.
D2 · Cognitive Complexity· set (cognitive 16) · ×1
set (cognitive 16) assets/common/js/component/search.js:459— set has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 4 (5 pts), boolean chains 3, other 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.
transposeChars (cognitive 16) assets/static/codemirror/lib/codemirror.js:7085— transposeChars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 7085). 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.
openMessage (cognitive 16) assets/user/controller/user/message.js:370— openMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (nesting depth added 1). 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 items inside it that branch (done, error, done::onClose, …). 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.
D4 · Code Duplication· Near-duplicate member family (5 members, 28 shared lines) · ×1
Near-duplicate member family (5 members, 28 shared lines) app/Util/Schema.php:64— app/Util/Schema.php:64-108 | app/Util/Schema.php:131-173 | app/Util/Schema.php:182-218 | app/Util/Schema.php:289-331 | app/Util/Schema.php:340-382 — These 5 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Near-duplicate member pair (64 shared lines) app/Controller/Admin/Api/Card.php:335— app/Controller/Admin/Api/Card.php:335-447 | app/Controller/User/Api/Card.php:77-185 — These two members are variants of one another: 64 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 (33 shared lines) app/Controller/Admin/Api/Order.php:626— app/Controller/Admin/Api/Order.php:626-676 | app/Controller/Admin/Api/RechargeOrder.php:478-525 — These two members are variants of one another: 33 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) app/Controller/Admin/Api/BusinessLevel.php:161— app/Controller/Admin/Api/BusinessLevel.php:161-190 | app/Controller/Admin/Api/Card.php:41-66 | app/Controller/Admin/Api/Category.php:45-71 | app/Controller/Admin/Api/Commodity.php:53-78 | app/Controller/Admin/Api/Commodity.php:143-279 | app/Controller/Admin/Api/CommodityGroup.php:42-69 | app/Controller/Admin/Api/CommodityGroup.php:79-103 | app/Controller/Admin/Api/Coupon.php:36-62 | app/Controller/Admin/Api/Manage.php:37-66 — 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 (122 corresponding lines) · ×1
Edited copy of a member (122 corresponding lines) app/Controller/Admin/Api/Coupon.php:256— app/Controller/Admin/Api/Coupon.php:256-388 | app/Controller/User/Api/Coupon.php:64-185 — These two members are one piece of code written twice and then edited apart: 122 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) app/Controller/Admin/Api/BusinessLevel.php:43— app/Controller/Admin/Api/BusinessLevel.php:43-151 | app/Controller/Admin/Api/Group.php:36-122 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) app/Service/Bind/Order.php:1448— app/Service/Bind/Order.php:1448-1507 | app/Service/Bind/Recharge.php:160-226 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) app/Controller/Admin/Api/Order.php:74— app/Controller/Admin/Api/Order.php:74-172 | app/Controller/Admin/Api/RechargeOrder.php:66-145 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) app/Controller/User/Api/Master.php:72— app/Controller/User/Api/Master.php:72-117 | app/Controller/User/Api/Master.php:215-271 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) app/Controller/Admin/Api/Category.php:291— app/Controller/Admin/Api/Category.php:291-334 | app/Controller/Admin/Api/Order.php:280-314 | app/Controller/Admin/Api/RechargeOrder.php:257-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 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 (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) app/Service/ManageSessionManager.php:77— app/Service/ManageSessionManager.php:77-121 | app/Service/UserSessionManager.php:77-126 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) app/Controller/Admin/Api/Upload.php:45— app/Controller/Admin/Api/Upload.php:45-85 | app/Controller/User/Api/Upload.php:43-97 — 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 (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) app/Util/CallbackIpWhitelist.php:246— app/Util/CallbackIpWhitelist.php:246-283 | app/Util/Client.php:420-449 — 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 (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) app/Controller/Admin/Api/Order.php:531— app/Controller/Admin/Api/Order.php:531-615 | app/Controller/Admin/Api/RechargeOrder.php:305-353 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) app/Service/Bind/Message.php:1136— app/Service/Bind/Message.php:1136-1162 | app/Service/Bind/Ticket.php:1449-1479 — 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 (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) REDACTED:436— REDACTED:436-465 | REDACTED:521-549 — 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 (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) app/Controller/Admin/Api/Store.php:607— app/Controller/Admin/Api/Store.php:607-624 | app/Service/Bind/Message.php:111-130 | app/Service/Bind/Ticket.php:729-747 — 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 (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) app/Controller/Admin/Api/Manage.php:484— app/Controller/Admin/Api/Manage.php:484-497 | app/Controller/User/Api/Security.php:664-680 — 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 (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) app/Service/Bind/Ticket.php:447— app/Service/Bind/Ticket.php:447-465 | app/Service/Bind/Ticket.php:470-488 — 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 copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) app/Controller/User/Api/Authentication.php:206— app/Controller/User/Api/Authentication.php:206-221 | app/Controller/User/Api/Authentication.php:231-243 | app/Controller/User/Api/Authentication.php:272-288 | app/Controller/User/Api/Authentication.php:298-310 — 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, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) kernel/Waf/Css/Gradient.php:23— kernel/Waf/Css/Gradient.php:23-42 | kernel/Waf/Css/GridTracks.php:16-34 | kernel/Waf/Css/Shadow.php:20-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) app/Service/Bind/Ticket.php:525— app/Service/Bind/Ticket.php:525-535 | app/Service/Bind/Ticket.php:540-550 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) REDACTED:495— REDACTED:495-506 | app/Service/Bind/Message.php:138-147 | app/Service/Bind/Ticket.php:1283-1294 — 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 copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) app/Service/ManageWebauthnService.php:36— app/Service/ManageWebauthnService.php:36-65 | app/Service/ManageWebauthnService.php:163-179 | app/Service/UserWebauthnService.php:55-91 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 9+ corresponding lines) · ×1
Edited copies of one member (6 members, 9+ corresponding lines) app/Controller/Admin/Api/Bill.php:31— app/Controller/Admin/Api/Bill.php:31-42 | app/Controller/Admin/Api/Cash.php:36-48 | app/Controller/Admin/Api/Coupon.php:233-246 | app/Controller/User/Api/Card.php:36-50 | app/Controller/User/Api/Cash.php:149-157 | app/Controller/User/Api/Coupon.php:37-54 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) app/Controller/Admin/Api/Message.php:62— app/Controller/Admin/Api/Message.php:62-69 | app/Controller/Admin/Api/Ticket.php:34-38 | app/Controller/User/Api/Ticket.php:36-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) app/Controller/Admin/Api/Category.php:269— app/Controller/Admin/Api/Category.php:269-285 | app/Controller/Admin/Api/Order.php:257-274 — 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 (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) app/Controller/Admin/Api/Ticket.php:27— app/Controller/Admin/Api/Ticket.php:27-29 | app/Controller/User/Api/Ticket.php:29-31 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) app/Controller/User/Api/Card.php:60— app/Controller/User/Api/Card.php:60-67 | app/Controller/Admin/Api/Card.php:298-305 — 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, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) app/Controller/Base/API/Manage.php:19— app/Controller/Base/API/Manage.php:19-22 | app/Controller/Base/API/Shared.php:24-27 | app/Controller/Base/API/User.php:26-29 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (59 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:65— app/Controller/Admin/Api/BusinessLevel.php:65-123 | app/Controller/Admin/Api/Group.php:58-116 — before extracting anything, compare `app/Controller/Admin/Api/BusinessLevel.php` and `app/Controller/Admin/Api/Group.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 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 `app/Controller/Admin/Api/BusinessLevel.php:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–33 lines × 2) app/Controller/Admin/Api/Order.php:98— app/Controller/Admin/Api/Order.php:98-130 | app/Controller/Admin/Api/RechargeOrder.php:86-107 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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 `app/Controller/Admin/Api/Order.php:98` 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 (26–27 lines × 2) app/Controller/Admin/Api/Card.php:419— app/Controller/Admin/Api/Card.php:419-445 | app/Controller/User/Api/Card.php:159-184 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Card.php:419` 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 (27 lines × 2) app/Controller/Admin/Api/Order.php:146— app/Controller/Admin/Api/Order.php:146-172 | app/Controller/Admin/Api/RechargeOrder.php:119-145 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 148 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 `app/Controller/Admin/Api/Order.php:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 6) app/Controller/Admin/Api/BusinessLevel.php:161— app/Controller/Admin/Api/BusinessLevel.php:161-183 | app/Controller/Admin/Api/Card.php:41-62 | app/Controller/Admin/Api/Category.php:45-67 | app/Controller/Admin/Api/Commodity.php:53-74 | app/Controller/Admin/Api/Coupon.php:36-58 | app/Controller/Admin/Api/Manage.php:37-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/Controller/Admin/Api/BusinessLevel.php:185` calls `JSONException` and `app/Controller/Admin/Api/Category.php:68` 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 (23 lines × 2) app/Controller/User/Api/Order.php:88— app/Controller/User/Api/Order.php:88-110 | app/Controller/User/Api/RechargeNotification.php:38-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/User/Api/Order.php:88` 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–22 lines × 2) app/Service/Bind/Order.php:1035— app/Service/Bind/Order.php:1035-1053 | app/Service/Bind/Recharge.php:115-136 — 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 `app/Service/Bind/Order.php:1035` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) app/Controller/Base/View/Manage.php:24— app/Controller/Base/View/Manage.php:24-44 | app/Controller/Base/View/ManagePlugin.php:22-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18–20 lines × 3) app/Controller/Admin/Api/Category.php:296— app/Controller/Admin/Api/Category.php:296-313 | app/Controller/Admin/Api/Order.php:285-303 | app/Controller/Admin/Api/RechargeOrder.php:262-281 — 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 `app/Controller/Admin/Api/Order.php:285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19 lines × 2) app/Util/Date.php:109— app/Util/Date.php:109-127 | kernel/Util/Date.php:124-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–18 lines × 3) app/Controller/User/Api/Order.php:83— app/Controller/User/Api/Order.php:83-100 | app/Controller/User/Api/Order.php:148-165 | app/Controller/User/Api/RechargeNotification.php:34-50 — 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 `app/Controller/User/Api/Order.php:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/Controller/User/Api/Order.php:166` calls `patch` and `app/Controller/User/Api/Order.php:101` 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–18 lines × 2) app/Controller/Shared/Commodity.php:459— app/Controller/Shared/Commodity.php:459-475 | app/Controller/User/Api/Index.php:350-367 — 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 `app/Controller/Shared/Commodity.php: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.
Duplicated block (18 lines × 2) app/Service/ManageSessionManager.php:49— app/Service/ManageSessionManager.php:49-66 | app/Service/UserSessionManager.php:52-69 — before extracting anything, compare `app/Service/ManageSessionManager.php` and `app/Service/UserSessionManager.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 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 (16–18 lines × 2) app/Util/CallbackIpWhitelist.php:246— app/Util/CallbackIpWhitelist.php:246-263 | app/Util/Client.php:420-435 — 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 (17 lines × 5) app/Util/Schema.php:66— app/Util/Schema.php:66-82 | app/Util/Schema.php:133-149 | app/Util/Schema.php:184-200 | app/Util/Schema.php:291-307 | app/Util/Schema.php:342-358 — 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 `app/Util/Schema.php:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) app/Controller/Admin/Api/User.php:183— app/Controller/Admin/Api/User.php:183-199 | app/Controller/User/Api/Business.php:43-58 — 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 (17 lines × 2) app/Service/Bind/ManageSSO.php:98— app/Service/Bind/ManageSSO.php:98-114 | app/Service/Bind/ManageSSO.php:151-167 — both copies are in the same file, so extract the 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 `app/Service/Bind/ManageSSO.php:98` 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 × 3) app/Controller/Admin/Api/Category.php:270— app/Controller/Admin/Api/Category.php:270-284 | app/Controller/Admin/Api/Order.php:257-273 | app/Controller/Admin/Api/RechargeOrder.php:233-250 — 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 (13–15 lines × 2) app/Controller/Admin/Api/Log.php:26— app/Controller/Admin/Api/Log.php:26-38 | app/Controller/Admin/Api/User.php:567-581 — 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 (15 lines × 2) app/Service/Bind/Email.php:419— app/Service/Bind/Email.php:419-433 | app/Service/Bind/Sms.php:158-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 `app/Service/Bind/Email.php:419` 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–15 lines × 2) app/Util/CallbackIpWhitelist.php:269— app/Util/CallbackIpWhitelist.php:269-283 | app/Util/Client.php:436-449 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) app/Util/CallbackIpWhitelist.php:183— app/Util/CallbackIpWhitelist.php:183-195 | app/Util/Client.php:327-340 — 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 `app/Util/CallbackIpWhitelist.php:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 2) REDACTED:55— REDACTED:55-65 | app/Controller/Admin/Api/Manage.php:75-87 — 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–12 lines × 3) app/Controller/Admin/Api/Bill.php:33— app/Controller/Admin/Api/Bill.php:33-42 | app/Controller/Admin/Api/Cash.php:38-48 | app/Controller/Admin/Api/Coupon.php:235-246 — 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 (10–11 lines × 7) app/Controller/Admin/Api/BusinessLevel.php:164— app/Controller/Admin/Api/BusinessLevel.php:164-174 | app/Controller/Admin/Api/Card.php:44-54 | app/Controller/Admin/Api/Category.php:48-58 | app/Controller/Admin/Api/Commodity.php:56-66 | app/Controller/Admin/Api/Commodity.php:216-225 | app/Controller/Admin/Api/Coupon.php:39-49 | app/Controller/Admin/Api/Manage.php:40-50 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/BusinessLevel.php:164` 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 × 5) app/Util/Schema.php:98— app/Util/Schema.php:98-108 | app/Util/Schema.php:163-173 | app/Util/Schema.php:208-218 | app/Util/Schema.php:321-331 | app/Util/Schema.php:372-382 — 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 `app/Util/Schema.php:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) app/Service/Bind/Pay.php:234— app/Service/Bind/Pay.php:234-244 | app/Util/Theme.php:74-83 — 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 `app/Service/Bind/Pay.php:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 5) app/Controller/Admin/Api/BusinessLevel.php:82— app/Controller/Admin/Api/BusinessLevel.php:82-92 | app/Controller/Admin/Api/BusinessLevel.php:108-118 | app/Controller/Admin/Api/BusinessLevel.php:120-129 | app/Controller/Admin/Api/Group.php:75-85 | app/Controller/Admin/Api/Group.php:101-111 — before extracting anything, compare `app/Controller/Admin/Api/BusinessLevel.php` and `app/Controller/Admin/Api/Group.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 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 `app/Controller/Admin/Api/BusinessLevel.php: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 (5–10 lines × 3) app/Service/Bind/App.php:186— app/Service/Bind/App.php:186-195 | app/Service/Bind/App.php:256-265 | app/Service/Bind/App.php:461-465 — 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 `app/Service/Bind/App.php:186` 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 × 8) app/Controller/Admin/Api/BusinessLevel.php:168— app/Controller/Admin/Api/BusinessLevel.php:168-176 | app/Controller/Admin/Api/Card.php:48-56 | app/Controller/Admin/Api/Category.php:52-60 | app/Controller/Admin/Api/Commodity.php:60-68 | app/Controller/Admin/Api/CommodityGroup.php:49-57 | app/Controller/Admin/Api/CommodityGroup.php:83-91 | app/Controller/Admin/Api/Coupon.php:43-51 | app/Controller/Admin/Api/Manage.php:44-52 — there are 8 copies across 7 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 `app/Controller/Admin/Api/BusinessLevel.php:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) app/Controller/Admin/Api/Store.php:614— app/Controller/Admin/Api/Store.php:614-622 | app/Service/Bind/Message.php:120-128 | app/Service/Bind/Ticket.php:737-745 — 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 `app/Controller/Admin/Api/Store.php:614` 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 (7–9 lines × 2) REDACTED:903— REDACTED:903-911 | REDACTED:977-983 — both copies are in the same file, so extract the 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 (4–9 lines × 3) REDACTED:495— REDACTED:495-503 | app/Service/Bind/Message.php:144-147 | app/Service/Bind/Ticket.php:1283-1291 — 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 `REDACTED:495` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:504` calls `html_entity_decode`, `trim` and `app/Service/Bind/Message.php:147` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) app/Service/Bind/Message.php:95— app/Service/Bind/Message.php:95-102 | app/Service/Bind/Message.php:222-229 | app/Service/Bind/Message.php:275-282 | app/Service/Bind/Ticket.php:854-861 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 4) app/Controller/User/Api/Authentication.php:206— app/Controller/User/Api/Authentication.php:206-212 | app/Controller/User/Api/Authentication.php:231-237 | app/Controller/User/Api/Authentication.php:272-278 | app/Controller/User/Api/Authentication.php:298-304 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 2) app/Controller/Admin/Api/Cash.php:57— app/Controller/Admin/Api/Cash.php:57-62 | app/Controller/Admin/Api/User.php:292-298 — 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–6 lines × 4) app/Controller/User/Api/Security.php:445— app/Controller/User/Api/Security.php:445-449 | app/Controller/User/Api/Security.php:481-486 | app/Controller/User/Api/Security.php:513-518 | app/Controller/User/Api/Security.php:564-569 — 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 `app/Controller/User/Api/Security.php:445` 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 (6 lines × 3) app/Service/Bind/Email.php:377— app/Service/Bind/Email.php:377-382 | app/Service/Bind/Email.php:414-419 | app/Service/Bind/Email.php:438-443 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) app/Controller/Admin/Api/Category.php:259— app/Controller/Admin/Api/Category.php:259-263 | app/Controller/Admin/Api/Order.php:247-251 | app/Controller/Admin/Api/RechargeOrder.php:223-227 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `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.
Low cohesion: Format (LCOM4 21) assets/common/js/format.js:1— Format's methods fall into 21 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 21 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.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 10 sibling directories (55 clone groups) assets/admin/controller/config/plugin.js:296— 55 duplicated blocks under assets/admin/controller/ have copies in at least two of the sibling directories auth, config, dashboard, file, manage, pay (+4 more sibling(s) not listed) — 45 of them are reported below, and 10 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 55 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 55 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 55 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (52 clone groups) assets/common/js/component/authtree.js:9— 52 duplicated blocks under assets/ have copies in at least two of the sibling directories admin, common, static, user — 40 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 52 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 6 sibling directories (6 clone groups) assets/user/controller/dashboard/index.js:3— 6 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, business, dashboard, index, security, user under assets/user/controller/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Wholesale file copy (432 identical lines × 2 files) assets/common/js/component/authtree.js:9— assets/common/js/component/authtree.js:9 · assets/static/modules/authtree.js:9 — these 2 files are line-for-line copies of one another — 432 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (249 matched lines × 2 locations) · ×1
Duplicated block with local edits (249 matched lines × 2 locations) assets/admin/controller/trade/card.js:141— assets/admin/controller/trade/card.js:141 · assets/user/controller/business/card.js:43 — the two spans are one implementation copied and then locally edited — 1578 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 (99 matched lines × 2 locations) · ×1
Duplicated block with local edits (99 matched lines × 2 locations) assets/admin/controller/config/mail.js:50— assets/admin/controller/config/mail.js:50 · assets/admin/controller/config/sms.js:73 — the two spans are one implementation copied and then locally edited — 668 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 (89 matched lines × 2 locations) · ×1
Duplicated block with local edits (89 matched lines × 2 locations) assets/admin/js/material.js:129— assets/admin/js/material.js:129 · assets/user/js/glass.js:392 — the two spans are one implementation copied and then locally edited — 761 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 (86 matched lines × 2 locations) · ×1
Duplicated block with local edits (86 matched lines × 2 locations) assets/user/controller/dashboard/index.js:3— assets/user/controller/dashboard/index.js:3 · assets/user/controller/user/purchase.record.js:5 — the two spans are one implementation copied and then locally edited — 899 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 (79 lines × 2 locations) assets/admin/controller/config/plugin.js:296— assets/admin/controller/config/plugin.js:296 · assets/admin/controller/pay/plugin.js:419 — 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 (65 lines × 2 locations) assets/admin/controller/trade/order.js:790— assets/admin/controller/trade/order.js:790 · assets/admin/controller/user/recharge.order.js:276 — 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 (60 lines × 2 locations) assets/admin/controller/trade/commodity.js:272— assets/admin/controller/trade/commodity.js:272 · assets/user/controller/business/commodity.js:86 — 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 (58 lines × 2 locations) assets/admin/controller/trade/commodity.js:830— assets/admin/controller/trade/commodity.js:830 · assets/user/controller/business/commodity.js:366 — 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.
R10 · Code Duplication· Duplicated block with local edits (53 matched lines × 2 locations) · ×1
Duplicated block with local edits (53 matched lines × 2 locations) assets/user/controller/index/item.js:223— assets/user/controller/index/item.js:223 · assets/user/controller/user/recharge.js:26 — the two spans are one implementation copied and then locally edited — 592 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 (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) assets/static/acg.js:1075— assets/static/acg.js:1075 · assets/user/js/treasure.js:11 — the two spans are one implementation copied and then locally edited — 495 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 (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) assets/static/acg.js:11— assets/static/acg.js:11 · assets/user/controller/index/item.js:218 — the two spans are one implementation copied and then locally edited — 532 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 (49 lines × 2 locations) assets/user/controller/business/business.js:180— assets/user/controller/business/business.js:180 · assets/user/controller/business/business.js:323 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (45 lines × 2 locations) assets/admin/controller/trade/coupon.js:334— assets/admin/controller/trade/coupon.js:334 · assets/user/controller/business/coupon.js:96 — 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 (38 lines × 2 locations) assets/admin/controller/trade/card.js:201— assets/admin/controller/trade/card.js:201 · assets/admin/controller/trade/commodity.js:890 — 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 (35 lines × 2 locations) assets/admin/controller/store/developer.js:640— assets/admin/controller/store/developer.js:640 · assets/admin/controller/store/home.js:1313 — 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 (34 lines × 2 locations) assets/user/controller/business/card.js:305— assets/user/controller/business/card.js:305 · assets/user/controller/business/coupon.js:276 — the 2 copies are spread across 2 files, and the CITED SPAN is a DECLARATION HEADER — the name, parameter list with its constraints and defaults, and base-type clause of a declaration — rather than statements inside a body. A header cannot be lifted into a helper: there is no expression position for a call to stand in, and the copies are frequently required to match, because one declaration passes its parameters straight through to the other. So the move is not extraction. Give the repeated pieces names — factor a long constraint or base-type expression into one named type both declarations refer to — and where the headers must stay identical, derive one from the other (a shared base declaration, or a single alias that spells the parameter set once) so that changing it once changes both. Where the language offers neither, treat the two as a pair that must be edited together: they drift apart the first time only one of them is changed, which is why this is reported.
Duplicated block (33 lines × 2 locations) assets/admin/controller/trade/coupon.js:451— assets/admin/controller/trade/coupon.js:451 · assets/admin/controller/user/recharge.order.js:86 — 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 (32 lines × 3 locations) REDACTED:309— REDACTED:309 · REDACTED:447 · REDACTED:1724 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (31 matched lines × 2 locations) · ×1
Duplicated block with local edits (31 matched lines × 2 locations) assets/admin/controller/user/cash.js:5— assets/admin/controller/user/cash.js:5 · assets/admin/controller/user/index.js:7 — 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.
Duplicated block (30 lines × 2 locations) assets/admin/js/mobile/recipes.js:1640— assets/admin/js/mobile/recipes.js:1640 · assets/admin/js/mobile/recipes.js:1760 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (27 lines × 2 locations) assets/admin/controller/config/google2fa.js:128— assets/admin/controller/config/google2fa.js:128 · assets/admin/controller/config/google2fa.js:180 — 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 (26 lines × 3 locations) assets/admin/controller/trade/card.js:356— assets/admin/controller/trade/card.js:356 · assets/admin/controller/trade/coupon.js:458 · assets/admin/controller/user/recharge.order.js:94 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 2 locations) assets/admin/controller/config/plugin.js:439— assets/admin/controller/config/plugin.js:439 · assets/admin/controller/pay/plugin.js:567 — 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.
Complex function _docMouseMove (cyclomatic 132, cognitive 229) REDACTED:2968— _docMouseMove has cyclomatic complexity 132 and cognitive complexity 229; 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 inlineNormal (cyclomatic 121, cognitive 180) REDACTED:414— inlineNormal has cyclomatic complexity 121 and cognitive complexity 180; 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 116, cognitive 135) assets/static/modules/hex.js:351— (anonymous) has cyclomatic complexity 116 and cognitive complexity 135; 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 78, cognitive 74) assets/admin/js/mobile/fallback.js:2883— (anonymous) has cyclomatic complexity 78 and cognitive complexity 74; 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 68, cognitive 198) assets/static/acg.js:658— (anonymous) has cyclomatic complexity 68 and cognitive complexity 198; 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 63, cognitive 113) assets/static/codemirror/lib/codemirror.js:393— (anonymous) has cyclomatic complexity 63 and cognitive complexity 113; 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 blockNormal (cyclomatic 62, cognitive 66) REDACTED:153— blockNormal has cyclomatic complexity 62 and cognitive complexity 66; 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 moveNode (cyclomatic 57, cognitive 75) REDACTED:3551— moveNode has cyclomatic complexity 57 and cognitive complexity 75; 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 insertLineContent (cyclomatic 56, cognitive 147) assets/static/codemirror/lib/codemirror.js:1921— insertLineContent has cyclomatic complexity 56 and cognitive complexity 147; 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 upload (cyclomatic 49, cognitive 75) assets/admin/controller/trade/card-file-upload.js:603— upload has cyclomatic complexity 49 and cognitive complexity 75; 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 49, cognitive 50) assets/admin/js/mobile/fallback.js:2784— render has cyclomatic complexity 49 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 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 popup (cyclomatic 44, cognitive 47) assets/common/js/component.js:339— popup has cyclomatic complexity 44 and cognitive complexity 47; 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 tokenBase (cyclomatic 43, cognitive 57) assets/static/codemirror/mode/javascript/javascript.js:66— tokenBase has cyclomatic complexity 43 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 (anonymous) (cyclomatic 41, cognitive 40) assets/static/codemirror/lib/codemirror.js:14— (anonymous) has cyclomatic complexity 41 and cognitive complexity 40; 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 statement (cyclomatic 40, cognitive 46) assets/static/codemirror/mode/javascript/javascript.js:368— statement has cyclomatic complexity 40 and cognitive complexity 46; 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 39, cognitive 60) assets/static/codemirror/lib/codemirror.js:3232— (anonymous) has cyclomatic complexity 39 and cognitive complexity 60; 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 39, cognitive 52) assets/static/modules/hex.js:647— (anonymous) has cyclomatic complexity 39 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 indent (cyclomatic 36, cognitive 42) assets/static/codemirror/mode/javascript/javascript.js:895— indent has cyclomatic complexity 36 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderRelated (cyclomatic 36, cognitive 33) assets/user/controller/user/ticket.detail.js:179— renderRelated has cyclomatic complexity 36 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function done (cyclomatic 36, cognitive 28) assets/admin/controller/pay/api.js:105— done has cyclomatic complexity 36 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 measureCharInner (cyclomatic 35, cognitive 49) assets/static/codemirror/lib/codemirror.js:2489— measureCharInner has cyclomatic complexity 35 and cognitive complexity 49; 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 renderTreeContext (cyclomatic 35, cognitive 46) assets/admin/js/mobile/fallback.js:2628— renderTreeContext has cyclomatic complexity 35 and cognitive complexity 46; 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 markText (cyclomatic 34, cognitive 38) assets/static/codemirror/lib/codemirror.js:5968— markText has cyclomatic complexity 34 and cognitive complexity 38; 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 getType (cyclomatic 33, cognitive 59) REDACTED:324— getType has cyclomatic complexity 33 and cognitive complexity 59; 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 success (cyclomatic 33, cognitive 30) assets/user/js/glass.js:243— success has cyclomatic complexity 33 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 stretchSpansOverChange (cyclomatic 32, cognitive 64) assets/static/codemirror/lib/codemirror.js:1372— stretchSpansOverChange has cyclomatic complexity 32 and cognitive complexity 64; 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 buildToken (cyclomatic 32, cognitive 57) assets/static/codemirror/lib/codemirror.js:1801— buildToken has cyclomatic complexity 32 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 pollContent (cyclomatic 32, cognitive 33) assets/static/codemirror/lib/codemirror.js:9058— pollContent has cyclomatic complexity 32 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderToolbar (cyclomatic 32, cognitive 31) assets/admin/js/mobile/fallback.js:2193— renderToolbar has cyclomatic complexity 32 and cognitive complexity 31; 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 submit (cyclomatic 32, cognitive 27) assets/admin/controller/trade/order.js:785— submit has cyclomatic complexity 32 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 (anonymous) (cyclomatic 32, cognitive 13) REDACTED:28— (anonymous) has cyclomatic complexity 32 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function skipAtomicInner (cyclomatic 31, cognitive 105) assets/static/codemirror/lib/codemirror.js:5202— skipAtomicInner has cyclomatic complexity 31 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 presentPopup (cyclomatic 31, cognitive 30) REDACTED:1130— presentPopup 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 submit (cyclomatic 31, cognitive 27) assets/admin/controller/user/recharge.order.js:271— submit 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 tokenBaseInner (cyclomatic 30, cognitive 43) REDACTED:101— tokenBaseInner has cyclomatic complexity 30 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 clear (cyclomatic 30, cognitive 39) assets/static/codemirror/lib/codemirror.js:5858— clear has cyclomatic complexity 30 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 onKey (cyclomatic 30, cognitive 30) assets/admin/controller/trade/category-tree.js:1041— onKey has cyclomatic complexity 30 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.
Complex function makeChkFlag (cyclomatic 29, cognitive 54) REDACTED:2278— makeChkFlag has cyclomatic complexity 29 and cognitive complexity 54; 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· assets/static/codemirror/lib/codemirror.js · ×1
assets/static/codemirror/lib/codemirror.js: 8882 lines of code assets/static/codemirror/lib/codemirror.js:1— assets/static/codemirror/lib/codemirror.js has 8882 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: 3978 lines of code REDACTED:1— REDACTED has 3978 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· assets/admin/js/mobile/fallback.js · ×1
assets/admin/js/mobile/fallback.js: 3083 lines of code assets/admin/js/mobile/fallback.js:1— assets/admin/js/mobile/fallback.js has 3083 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: 2923 lines of code REDACTED:1— REDACTED has 2923 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: 1951 lines of code REDACTED:1— REDACTED has 1951 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· assets/admin/js/mobile/recipes.js · ×1
assets/admin/js/mobile/recipes.js: 1936 lines of code assets/admin/js/mobile/recipes.js:1— assets/admin/js/mobile/recipes.js has 1936 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· assets/admin/controller/shared/store.js · ×1
assets/admin/controller/shared/store.js: 1876 lines of code assets/admin/controller/shared/store.js:1— assets/admin/controller/shared/store.js has 1876 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: 1852 lines of code REDACTED:1— REDACTED has 1852 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· assets/admin/controller/store/home.js · ×1
assets/admin/controller/store/home.js: 1588 lines of code assets/admin/controller/store/home.js:1— assets/admin/controller/store/home.js has 1588 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· assets/admin/controller/trade/commodity.js · ×1
assets/admin/controller/trade/commodity.js: 1488 lines of code assets/admin/controller/trade/commodity.js:1— assets/admin/controller/trade/commodity.js has 1488 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: 1376 lines of code REDACTED:1— REDACTED has 1376 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· assets/admin/js/mobile/workflows.js · ×1
assets/admin/js/mobile/workflows.js: 1319 lines of code assets/admin/js/mobile/workflows.js:1— assets/admin/js/mobile/workflows.js has 1319 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· assets/admin/controller/trade/category-tree.js · ×1
assets/admin/controller/trade/category-tree.js: 1286 lines of code assets/admin/controller/trade/category-tree.js:1— assets/admin/controller/trade/category-tree.js has 1286 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· assets/admin/controller/trade/card-file-upload.js · ×1
assets/admin/controller/trade/card-file-upload.js: 1209 lines of code assets/admin/controller/trade/card-file-upload.js:1— assets/admin/controller/trade/card-file-upload.js has 1209 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· assets/static/modules/hex.js · ×1
assets/static/modules/hex.js: 1204 lines of code assets/static/modules/hex.js:1— assets/static/modules/hex.js has 1204 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
assets/common/js/util.js: 1166 lines of code assets/common/js/util.js:1— assets/common/js/util.js has 1166 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
assets/static/acg.js: 1130 lines of code assets/static/acg.js:1— assets/static/acg.js has 1130 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· assets/admin/controller/trade/drag-sort.js · ×1
assets/admin/controller/trade/drag-sort.js: 1105 lines of code assets/admin/controller/trade/drag-sort.js:1— assets/admin/controller/trade/drag-sort.js has 1105 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· assets/common/js/editor/markdown/editorv2.js · ×1
assets/common/js/editor/markdown/editorv2.js: 1022 lines of code assets/common/js/editor/markdown/editorv2.js:1— assets/common/js/editor/markdown/editorv2.js has 1022 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· assets/static/codemirror/mode/javascript/javascript.js · ×1
assets/static/codemirror/mode/javascript/javascript.js: 914 lines of code assets/static/codemirror/mode/javascript/javascript.js:1— assets/static/codemirror/mode/javascript/javascript.js has 914 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· assets/admin/controller/store/developer.js · ×1
assets/admin/controller/store/developer.js: 899 lines of code assets/admin/controller/store/developer.js:1— assets/admin/controller/store/developer.js has 899 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· assets/admin/controller/user/ticket.js · ×1
assets/admin/controller/user/ticket.js: 872 lines of code assets/admin/controller/user/ticket.js:1— assets/admin/controller/user/ticket.js has 872 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· assets/admin/controller/trade/order.js · ×1
assets/admin/controller/trade/order.js: 856 lines of code assets/admin/controller/trade/order.js:1— assets/admin/controller/trade/order.js has 856 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· assets/admin/controller/pay/api.js · ×1
assets/admin/controller/pay/api.js: 851 lines of code assets/admin/controller/pay/api.js:1— assets/admin/controller/pay/api.js has 851 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· assets/admin/controller/dashboard/index.js · ×1
assets/admin/controller/dashboard/index.js: 832 lines of code assets/admin/controller/dashboard/index.js:1— assets/admin/controller/dashboard/index.js 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· assets/static/codemirror/mode/css/css.js · ×1
assets/static/codemirror/mode/css/css.js: 808 lines of code assets/static/codemirror/mode/css/css.js:1— assets/static/codemirror/mode/css/css.js has 808 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· assets/common/js/component.js · ×1
assets/common/js/component.js: 793 lines of code assets/common/js/component.js:1— assets/common/js/component.js has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· assets/admin/controller/user/index.js · ×1
assets/admin/controller/user/index.js: 771 lines of code assets/admin/controller/user/index.js:1— assets/admin/controller/user/index.js has 771 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· assets/common/js/component/authtree.js · ×1
assets/common/js/component/authtree.js: 764 lines of code assets/common/js/component/authtree.js:1— assets/common/js/component/authtree.js has 764 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· assets/admin/controller/trade/coupon.js · ×1
assets/admin/controller/trade/coupon.js: 725 lines of code assets/admin/controller/trade/coupon.js:1— assets/admin/controller/trade/coupon.js has 725 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· assets/static/modules/authtree.js · ×1
assets/static/modules/authtree.js: 712 lines of code assets/static/modules/authtree.js:1— assets/static/modules/authtree.js has 712 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· assets/admin/controller/config/plugin.js · ×1
assets/admin/controller/config/plugin.js: 705 lines of code assets/admin/controller/config/plugin.js:1— assets/admin/controller/config/plugin.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· assets/admin/controller/trade/card.js · ×1
assets/admin/controller/trade/card.js: 703 lines of code assets/admin/controller/trade/card.js:1— assets/admin/controller/trade/card.js has 703 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· assets/user/controller/business/commodity.js · ×1
assets/user/controller/business/commodity.js: 673 lines of code assets/user/controller/business/commodity.js:1— assets/user/controller/business/commodity.js has 673 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: 671 lines of code REDACTED:1— REDACTED has 671 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· assets/admin/controller/user/message.js · ×1
assets/admin/controller/user/message.js: 610 lines of code assets/admin/controller/user/message.js:1— assets/admin/controller/user/message.js has 610 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· assets/admin/controller/pay/plugin.js · ×1
assets/admin/controller/pay/plugin.js: 586 lines of code assets/admin/controller/pay/plugin.js:1— assets/admin/controller/pay/plugin.js has 586 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· assets/admin/controller/config/index.js · ×1
assets/admin/controller/config/index.js: 540 lines of code assets/admin/controller/config/index.js:1— assets/admin/controller/config/index.js has 540 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· assets/common/js/component/search.js · ×1
assets/common/js/component/search.js: 518 lines of code assets/common/js/component/search.js:1— assets/common/js/component/search.js has 518 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
assets/user/js/glass.js: 515 lines of code assets/user/js/glass.js:1— assets/user/js/glass.js has 515 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 131 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
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: postOrderExportRequest assets/admin/controller/trade/order.js:694— `postOrderExportRequest` 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 })`.
X24 · Document value interpolated into markup unescaped· Document value reaches a markup attribute unescaped · ×1
Document value reaches a markup attribute unescaped assets/common/js/format.js:269— `state.element.getAttribute('data-icon')` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `src` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `state.element.getAttribute('data-icon')` at this site, or validate it against the shape the position accepts before interpolating it.
Duplicated predicate assets/admin/controller/trade/order.js:301— `!(result.isConfirmed === true || result.value === true) || !controllerActive || requesting` appears character-identically in 2 files — assets/admin/controller/trade/order.js, assets/admin/controller/user/index.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/index.js:173— `!Array.isArray(submit) || submit.length === 0` appears character-identically in 2 files — assets/admin/controller/config/index.js, assets/admin/controller/pay/plugin.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/trade/order.js:817— `!Number.isInteger(count) || count < 1 || !previewToken.includes('.')` appears character-identically in 2 files — assets/admin/controller/trade/order.js, assets/admin/controller/user/recharge.order.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/trade/card.js:658— `!Number.isInteger(exportNum) || exportNum < 0 || exportNum > 5000` appears character-identically in 2 files — assets/admin/controller/trade/card.js, assets/admin/controller/trade/order.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/trade/order.js:708— `!contentType.includes('text/csv') && !contentType.includes('application/octet-stream')` appears character-identically in 2 files — assets/admin/controller/trade/order.js, assets/admin/controller/user/recharge.order.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/trade/card.js:140— `!controllerActive || _.isDestroyed || revision !== skuRevision` appears character-identically in 2 files — assets/admin/controller/trade/card.js, assets/admin/controller/trade/commodity.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/plugin.js:325— `!controllerActive || _LogPid !== logPid || !$logText` appears character-identically in 2 files — assets/admin/controller/config/plugin.js, assets/admin/controller/pay/plugin.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/shared/priceTemplate.js:117— `!controllerActive || form.isDestroyed || revision !== groupRevision` appears character-identically in 2 files — assets/admin/controller/shared/priceTemplate.js, assets/admin/controller/trade/commodity.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/user/controller/dashboard/index.js:22— `!delivery || delivery.textOf(secret).trim() !== ''` appears character-identically in 2 files — assets/user/controller/dashboard/index.js, assets/user/controller/user/purchase.record.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/user/ticket.js:908— `!event.shiftKey && document.activeElement === last` appears character-identically in 2 files — assets/admin/controller/user/ticket.js, assets/common/js/component.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/common/js/util.js:831— `!ipod && !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/i)` appears character-identically in 2 files — assets/common/js/util.js, assets/static/pay.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/js/material.js:148— `!label || !label.textContent.replace(/\s+/g, '')` appears character-identically in 2 files — assets/admin/js/material.js, assets/user/js/glass.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/dashboard/index.js:12— `!request || typeof request.always !== 'function'` appears character-identically in 2 files — assets/admin/controller/dashboard/index.js, assets/admin/controller/shared/store.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/plugin.js:39— `['http:', 'https:'].includes(url.protocol) && !url.username && !url.password` appears character-identically in 6 files — assets/admin/controller/config/plugin.js, assets/admin/controller/manage/manage.js, assets/admin/controller/shared/store.js, assets/admin/controller/store/developer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:572— `answer.isConfirmed === true || answer.value === true` appears character-identically in 2 files — REDACTED, assets/admin/js/mobile/workflows.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/wiki.mobile.js:213— `api.navigation && typeof api.navigation.openAll === 'function'` appears character-identically in 2 files — assets/admin/controller/config/wiki.mobile.js, assets/admin/js/mobile/shell.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/trade/card.js:99— `controllerActive && error?.name !== 'AbortError'` appears character-identically in 2 files — assets/admin/controller/trade/card.js, assets/admin/controller/user/recharge.order.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/shared/store.js:673— `document.scrollingElement || document.documentElement` appears character-identically in 2 files — assets/admin/controller/shared/store.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/wiki.mobile.js:243— `event.key !== 'Enter' && event.key !== ' '` appears character-identically in 3 files — assets/admin/controller/config/wiki.mobile.js, assets/admin/controller/user/ticket.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/user/ticket.js:905— `event.shiftKey && document.activeElement === first` appears character-identically in 2 files — assets/admin/controller/user/ticket.js, assets/common/js/component.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/wiki.mobile.js:166— `event.target.closest && event.target.closest('a[href]')` appears character-identically in 2 files — assets/admin/controller/config/wiki.mobile.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/common/js/component.js:223— `event.type === 'keydown' && !['Enter', ' '].includes(event.key)` appears character-identically in 2 files — assets/common/js/component.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/controller/config/index.js:28— `form && window.AdminMobile?.pageWorkflows?.getRevision` appears character-identically in 5 files — assets/admin/controller/config/index.js, assets/admin/controller/config/mail.js, assets/admin/controller/config/other.js, assets/admin/controller/config/sms.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/user/controller/dashboard/index.js:24— `hasText || delivery.files(secret).length > 1` appears character-identically in 2 files — assets/user/controller/dashboard/index.js, assets/user/controller/user/purchase.record.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate assets/admin/js/mobile/navigation.js:90— `inlineStyle && (inlineStyle.display === 'none' || inlineStyle.visibility === 'hidden')` appears character-identically in 2 files — assets/admin/js/mobile/navigation.js, assets/admin/js/mobile/workflows.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default in catch REDACTED:556— `storedJsonConfig` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Controller/Admin/Api/PriceTemplate.php:304— `pricedCategoryCount` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Service/Bind/Email.php:259— `emailConfig` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Service/UserSessionManager.php:192— `revokeAll` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/CardFile/Link.php:117— `lookup` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/CardFile/Purge.php:71— `forCards` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/CardFile/Purge.php:114— `forOrders` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/CardFile/Purge.php:148— `staged` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/Client.php:135— `resolveClientMode` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/Csp.php:132— `secret` swallows every exception into `return 'acg'` — 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/Csp.php:465— `allowList` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/IpWhitelist.php:280— `recentDenied` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/LangRecycle.php:109— `release` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/RichHtml.php:37— `sanitize` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/SharedPayload.php:242— `config` 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 docblock, and the row stops firing.
Silent fallback default in catch app/Util/Sku.php:67— `configArray` 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 docblock, and the row stops firing.
Silent fallback default in catch kernel/Util/Lang.php:898— `forgetExtension` 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 docblock, and the row stops firing.
Silent fallback default in catch kernel/Util/Lang.php:1095— `version` 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 docblock, and the row stops firing.
Silent fallback default in catch kernel/Util/Lang.php:1134— `loadDict` 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 docblock, and the row stops firing.
Silent fallback default in catch assets/admin/controller/dashboard/index.js:90— `safeHttpUrl` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch assets/admin/controller/file/index.js:70— `safePublicUrl` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch assets/admin/controller/manage/manage.js:13— `safeImageUrl` swallows every exception into `return '/favicon.ico'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch assets/admin/controller/pay/api.js:26— `normalizeHttpUrl` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch assets/admin/controller/pay/plugin.js:11— `safeImageUrl` swallows every exception into `return '/favicon.ico'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch assets/admin/controller/trade/coupon.js:26— `safeImageUrl` 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.
Hand-rolled JSON/XML parsing via regex assets/static/jquery.pjax.js:672— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/static/jquery.pjax.js:673— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/static/layui/lay/modules/mobile.js:2— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/common/js/_.js:2— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/common/js/_.js:13— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/common/js/editor/editor.js:16— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/common/js/editor/markdown/_editorv2.js:1— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex assets/common/js/editor/markdown/editorv2.js:678— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Fat interface: App (27 methods) app/Service/App.php:12— `App` declares 27 methods: `getVersions`, `update`, `upload`, `ad`, `install`, `captcha`, `register`, `login`, `plugins`, `authors`, `purchase`, `levels`, `bindLevel`, `installPlugin`, `updatePlugin`, `uninstallPlugin`, `purchaseRecords`, `unbind`, `rebindPlan`, `developerPlugins`, `developerCreatePlugin`, `developerCreateKit`, `developerDeletePlugin`, `developerUpdatePlugin`, `developerPluginPriceSet`, `service`, `editPassword`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Shared (21 methods) app/Service/Shared.php:11— `Shared` declares 21 methods: `connect`, `items`, `item`, `inventoryState`, `inventory`, `trade`, `retrieve`, `draftCard`, `getDraft`, `getItemStock`, `getValuation`, `AdjustmentPrice`, `AdjustmentTemplate`, `usesFactoryBase`, `factoryQuote`, `priceSkipped`, `AdjustmentAmount`, `AdjustmentExtra`, `syncRemoteItem`, `remoteCost`, `remoteLeaveMessage`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Ticket (17 methods) app/Service/Ticket.php:10— `Ticket` declares 17 methods: `ready`, `userData`, `adminData`, `userDetail`, `adminDetail`, `userMessages`, `adminMessages`, `commodityOptions`, `orderOptions`, `create`, `userReply`, `adminReply`, `close`, `delete`, `userBadge`, `adminBadge`, `upload`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Request (18 methods) kernel/Context/Interface/Request.php:8— `Request` declares 18 methods: `method`, `all`, `post`, `unsafePost`, `xml`, `get`, `unsafeGet`, `header`, `cookie`, `json`, `unsafeJson`, `file`, `uri`, `uriSuffix`, `setProperty`, `url`, `domain`, `raw`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
redundant comment REDACTED:1810— 16 comments in this file only repeat the code they sit on (lines 1810, 1815, 1824, 1838, 1849, 1881, 1897, 1921, 1944, 1964, 2024, 2130, 2159, 2331, 2583, 2592), for example "Get link element". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment REDACTED:3567— "parentTId of root node is null" repeats the code it sits on: 4 of its 5 words (parent, id, node, null) are already in `node.parentTId = null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment assets/static/codemirror/lib/codemirror.js:1324— "Add a span to a line." repeats the code it sits on: 3 of its 3 words (add, span, line) are already in `function addMarkedSpan(line, span, op)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
No ADRs found composer.json:3— 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 `composer.json` makes this repository a deployable product (line 3).
D21 · Naming Consistency· `parseURL` spells `URL` where 28 names in the project spell it `Url` · ×1
`parseURL` spells `URL` where 28 names in the project spell it `Url` assets/static/jquery.pjax.js:588— 28 of 29 names in project repository spell the token `Url` (28 of 29; unit: names in project repository containing `Url`). Peers: plugin.normalizeHttpUrl (assets/admin/controller/config/plugin.js:33); index.safeHttpUrl (assets/admin/controller/dashboard/index.js:84); index.channelName(iconUrl) (assets/admin/controller/dashboard/index.js:531); index.safePublicUrl (assets/admin/controller/file/index.js:63); index.safeDownloadUrl (assets/admin/controller/file/index.js:75). Rename to `parseUrl`. [rule N6]
D21 · Naming Consistency· `parseHTML` spells `HTML` where 77 names in the project spell it `Html` · ×1
`parseHTML` spells `HTML` where 77 names in the project spell it `Html` assets/static/jquery.pjax.js:646— 77 of 78 names in project repository spell the token `Html` (77 of 78; unit: names in project repository containing `Html`). Peers: index.escapeHtml (assets/admin/controller/config/index.js:12); lang.escapeHtml (assets/admin/controller/config/lang.js:17); other.escapeHtml (assets/admin/controller/config/other.js:3); plugin.escapeHtml (assets/admin/controller/config/plugin.js:27); plugin.sanitizePluginDisplayHtml (assets/admin/controller/config/plugin.js:44). Rename to `parseHtml`. [rule N6]
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation· No architecture diagram/doc · ×1
No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
No SAST — No static application security testing detected. For this repository's stack, add phpstan or psalm (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 changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
No security response headers detected docker/nginx.conf:61— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
S1 · Web-Security Posture· Information-disclosure response header set · ×1
Information-disclosure response header set assets/common/js/editor/editor.js:16— `sourceMap` is set explicitly here. The OWASP Secure Headers Project lists it among the response headers to REMOVE: it names the server, framework or tooling behind the application, which is exactly what an attacker looks up known exploits for. (No deduction on this card.)
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 3/4 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· PHP static analysis does not check null everywhere · ×1
PHP static analysis does not check null everywhere — This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
Outdated: ezyang/htmlpurifier — `ezyang/htmlpurifier` is locked at v4.18.0 but v4.19.1 is the current stable release on Packagist, and it already satisfies the `^4.18` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update ezyang/htmlpurifier` and commit the updated REDACTED.
doc comments repeat the names assets/common/js/component.js:311— 0 of 39 documented parameters and 0 of 37 summaries in `.` only repeat the member or parameter name (e.g. "" for `url`). 23 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 34 file(s) — `app/Controller/Admin/Api/Plugin.php`, `app/Service/App.php`, `app/Service/Bind/Query.php`, `app/Service/Cash.php`, `app/Service/Currency.php`, … (+29 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1eb20-362b-7b63-acdd-f3b13e7b0e2c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 120 · Warnings: 1559 · Recommendations: 114 · Info: 2 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 20:08 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.