Public report of lizhipay/acg-faka, published 4 October 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 report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.1). Watchdog 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, 4 October 2026, 12:53 UTC · Survey ID cd_cbdb4dfb3a644df79fe955ab1c823d29

Lizhipay/acg-Faka

Measured 4 October 2026, 12:43 UTC

34% Weak
CriticalWeakAdequateStrongExemplary

Large · 124,661 LoC · 1 projects · rebuild ~0.7 person-years · weakest lens: Readiness (24%)

Findings by grade

112 critical 1367 serious 86 minor 16 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
4 October 2026, 12:43 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

69/73dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
1543findings with an exact file:lineof 1565 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
73/130dimensions across the health lenses124661 LoC · 1 projects — wide & deep
Chapters

Executive summary

This system is a large, high-value asset currently operating with significant operational fragility. With an overall health score of 34%, the organization holds a substantial investment—representing roughly 0.7 person-years of effort and €110,000 in rebuild cost—yet it lacks the foundational safeguards required for reliable, secure delivery. The primary risk is not that the code is broken, but that it is unsafe to change at scale without introducing defects or security regressions.

The most critical vulnerability lies in operational readiness. Despite strong architectural design, the system lacks the testing, observability, and disaster recovery procedures necessary for production stability. This gap exposes the business to prolonged outages and data loss, as current backups are not part of a verified recovery strategy. For a system of this size, the cost of an unplanned outage or a failed deployment far exceeds the investment needed to establish basic operational guardrails.

A secondary, compounding risk is the hidden velocity tax imposed by code quality. While the architecture is sound, the underlying code complexity and duplication create a drag on every change, estimated to increase development time by 7–15% in weaker areas. This inefficiency compounds as the team grows, turning routine updates into expensive, slow processes that delay feature delivery and inflate long-term maintenance costs.

However, the system is not beyond repair. The architecture is robust, and performance is excellent, providing a solid foundation for improvement. The most immediate and high-leverage action is to integrate static analysis into the continuous integration pipeline. This single step can prevent security regressions and enforce code standards automatically, paying for itself within months by reducing the annual drag on engineering capacity. Focusing here first stabilizes the delivery pipeline, allowing the team to address deeper operational gaps with greater confidence and speed.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 24% · 46% weightCode Health 32% · 25% weightAccessibility 37% · 14% weightMaturity 47% · 8% weightSecurity 72% · 4% weightArchitecture 82% · 2% weightPerformance 100% · 1% weight

Raise Readiness 24 → 70 (the Healthy floor) ⇒ headline 34 → ~42.

Code composition — where the lines go
Tests 100%
New since the last scan (100+)

455 finding(s) are new versus the previous scan (2026-09-19) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · tree.select.layui.define() (cyclomatic 1045) REDACTED
  • D1 · hex.layui.define() (cyclomatic 268) assets/static/modules/hex.js
  • D1 · authtree.layui.define() (cyclomatic 133) assets/common/js/component/authtree.js
  • D1 · python.CodeMirror.defineMode("python") (cyclomatic 127) assets/static/codemirror/mode/python/python.js
  • D1 · authtree.layui.define() (cyclomatic 124) assets/static/modules/authtree.js
  • D1 · css.CodeMirror.defineMode("css") (cyclomatic 114) assets/static/codemirror/mode/css/css.js
  • D1 · _ThemeSetting (cyclomatic 76) assets/admin/controller/config/index.js
  • D1 · register (cyclomatic 74) assets/common/js/editor/markdown/editorv2.js
  • D1 · (anonymous) (cyclomatic 73) assets/static/codemirror/lib/codemirror.js
  • D1 · done (cyclomatic 67) assets/admin/controller/store/home.js
  • D1 · CommodityGroupModal (cyclomatic 60) assets/admin/controller/user/group.js
  • D1 · presentPopup (cyclomatic 57) assets/admin/js/mobile/overlay.js
  • D1 · createCoupon (cyclomatic 50) assets/admin/controller/trade/coupon.js
  • D1 · _Auth (cyclomatic 47) assets/admin/controller/store/home.js
  • D1 · click (cyclomatic 45) assets/admin/controller/shared/store.js
  • D1 · Util.redactDebugValue (cyclomatic 44) assets/common/js/util.js
  • D1 · (anonymous).attach.openMenu (cyclomatic 44) assets/admin/controller/trade/category-tree.js
  • D1 · javascript.CodeMirror.defineMode("javascript").tokenBase (cyclomatic 43) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous).tokenBase (cyclomatic 43) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · modal (cyclomatic 42) assets/admin/controller/trade/commodity.js
  • D1 · javascript.CodeMirror.defineMode("javascript").statement (cyclomatic 40) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous).statement (cyclomatic 40) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · javascript.CodeMirror.defineMode("javascript").indent (cyclomatic 36) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · confirmPayDelete::done (cyclomatic 36) assets/admin/controller/pay/api.js
  • D1 · (anonymous).indent (cyclomatic 36) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · refreshMessageCenter::success (cyclomatic 33) assets/user/js/glass.js
  • D1 · order.$(".btn-app-export").off().on() (cyclomatic 32) assets/admin/controller/trade/order.js
  • D1 · (anonymous)::submit (cyclomatic 32) assets/admin/controller/trade/order.js
  • D1 · recharge.order.$(".btn-app-export").off().on() (cyclomatic 31) assets/admin/controller/user/recharge.order.js
  • D1 · Component.previewMessage (cyclomatic 31) assets/common/js/component.js
  • D1 · (anonymous)::submit (cyclomatic 31) assets/admin/controller/user/recharge.order.js
  • D1 · mobileAccountSubmit (cyclomatic 31) assets/admin/controller/user/index.js
  • D1 · click (cyclomatic 31) assets/admin/controller/user/cash.js
  • D1 · (anonymous).attach.onKey (cyclomatic 31) assets/admin/controller/trade/category-tree.js
  • D1 · (anonymous)::tokenBaseInner (cyclomatic 30) assets/static/codemirror/mode/python/python.js
  • D1 · mobileDeliverySubmit (cyclomatic 29) assets/admin/controller/trade/order.js
  • D1 · done (cyclomatic 29) assets/admin/controller/store/developer.js
  • D1 · applyModal (cyclomatic 29) assets/admin/controller/shared/priceTemplate.js
  • D1 · xml.CodeMirror.defineMode("xml").indent (cyclomatic 28) assets/static/codemirror/mode/xml/xml.js
  • D1 · (anonymous).indent (cyclomatic 28) assets/static/codemirror/mode/xml/xml.js
  • D1 · css.CodeMirror.defineMode("css").tokenBase (cyclomatic 27) assets/static/codemirror/mode/css/css.js
  • D1 · runImportTask (cyclomatic 27) assets/admin/controller/shared/store.js
  • D1 · click (cyclomatic 27) assets/admin/controller/shared/store.js
  • D1 · (anonymous).tokenBase (cyclomatic 27) assets/static/codemirror/mode/css/css.js
  • D1 · card.$(".btn-app-export").off().on() (cyclomatic 26) assets/admin/controller/trade/card.js
  • D1 · (anonymous)::tokenLexer (cyclomatic 26) assets/static/codemirror/mode/python/python.js
  • D1 · passkey.add (cyclomatic 25) assets/user/controller/security/passkey.js
  • D1 · (anonymous).attach (cyclomatic 25) assets/admin/controller/trade/category-tree.js
  • D1 · (anonymous)::submit (cyclomatic 25) assets/admin/controller/trade/card.js
  • D1 · _Save (cyclomatic 25) assets/admin/controller/config/index.js
  • D1 · Install.html.renderDbResult (cyclomatic 24) app/View/Install.html
  • D1 · comment-fold.CodeMirror.registerGlobalHelper("fold","comment") (cyclomatic 24) assets/static/codemirror/addon/fold/comment-fold.js
  • D1 · (anonymous) (cyclomatic 24) assets/static/codemirror/addon/fold/comment-fold.js
  • D1 · brace-fold.CodeMirror.registerHelper("fold","brace") (cyclomatic 23) assets/static/codemirror/addon/fold/brace-fold.js
  • D1 · javascript.CodeMirror.defineMode("javascript").findFatArrow (cyclomatic 23) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · armAutofill (cyclomatic 23) assets/user/controller/auth/login.js
  • D1 · (anonymous) (cyclomatic 23) assets/admin/controller/trade/coupon.js
  • D1 · modal (cyclomatic 23) assets/admin/controller/shared/priceTemplate.js
  • D1 · (anonymous).findFatArrow (cyclomatic 23) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous) (cyclomatic 23) assets/static/codemirror/addon/fold/brace-fold.js
  • D1 · Install.html.renderDb (cyclomatic 22) app/View/Install.html
  • D1 · coupon.$(".btn-app-export").off().on() (cyclomatic 22) assets/admin/controller/trade/coupon.js
  • D1 · Util.post (cyclomatic 22) assets/common/js/util.js
  • D1 · javascript.CodeMirror.defineMode("javascript").expressionInner (cyclomatic 22) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · normalizeImportRequest (cyclomatic 22) assets/admin/controller/shared/store.js
  • D1 · configureShell (cyclomatic 22) assets/admin/controller/config/wiki.mobile.js
  • D1 · (anonymous).expressionInner (cyclomatic 22) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · javascript.CodeMirror.defineMode("javascript").classBody (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · KTUtil.slide (cyclomatic 21) assets/admin/js/menu.js
  • D1 · (anonymous).maybeoperatorNoComma (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous).classBody (cyclomatic 21) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous).atBlock (cyclomatic 21) assets/static/codemirror/mode/css/css.js
  • D1 · Panel.save (cyclomatic 20) REDACTED
  • D1 · (anonymous).attach (cyclomatic 20) assets/admin/controller/trade/drag-sort.js
  • D1 · (anonymous).attach.openActions (cyclomatic 20) assets/admin/controller/trade/category-tree.js
  • D1 · (anonymous).confirmDelete (cyclomatic 20) assets/admin/controller/trade/category-actions.js
  • D1 · normalizeRemoteProductGroups (cyclomatic 20) assets/admin/controller/shared/store.js
  • D1 · click (cyclomatic 20) assets/admin/controller/pay/plugin.js
  • D1 · modal (cyclomatic 20) assets/admin/controller/pay/api.js
  • D1 · sanitizePluginDisplayHtml (cyclomatic 20) assets/admin/controller/config/plugin.js
  • D1 · click (cyclomatic 20) assets/admin/controller/config/plugin.js
  • D1 · other.$("#currency-convert-btn").off().on() (cyclomatic 19) assets/admin/controller/config/other.js
  • D1 · javascript.CodeMirror.defineMode("javascript").objprop (cyclomatic 19) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · Panel.render (cyclomatic 19) REDACTED
  • D1 · alignReferenceCards (cyclomatic 19) assets/admin/js/mobile/fallback.js
  • D1 · requestAudienceCount (cyclomatic 19) assets/admin/controller/user/message.js
  • D1 · (anonymous).attach.onMobilePointerDown (cyclomatic 19) assets/admin/controller/trade/drag-sort.js
  • D1 · normalizeImportTask (cyclomatic 19) assets/admin/controller/shared/store.js
  • D1 · (anonymous) (cyclomatic 19) assets/admin/controller/config/other.js
  • D1 · (anonymous).objprop (cyclomatic 19) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · (anonymous).top (cyclomatic 19) assets/static/codemirror/mode/css/css.js
  • D1 · editorv2.register.destroy (cyclomatic 18) assets/common/js/editor/markdown/editorv2.js
  • D1 · javascript.CodeMirror.defineMode("javascript").typeexpr (cyclomatic 18) assets/static/codemirror/mode/javascript/javascript.js
  • D1 · CategoryTree.forAdmin (cyclomatic 18) app/Util/CategoryTree.php
  • D1 · setupSheetDrag::pointerDown (cyclomatic 18) assets/admin/js/mobile/overlay.js
  • D1 · renderToolbar::(anonymous)::syncSourceState (cyclomatic 18) assets/admin/js/mobile/fallback.js
  • D1 · click (cyclomatic 18) assets/admin/controller/user/recharge.order.js
  • D1 · (anonymous).attach.nodesHtml (cyclomatic 18) assets/admin/controller/trade/category-tree.js
  • D1 · (anonymous).typeexpr (cyclomatic 18) assets/static/codemirror/mode/javascript/javascript.js

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €35,000–€180,000
Cost to rebuild€35,000–€180,000 (0.4–1.1 person-years (588–1,866 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 34% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.7 person-years of build effort (about ~€110,000 to rebuild). Its weakest lens is Readiness at 24% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
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.
+9.1 pts · Medium effort · Security & performance tooling
2
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
+9.1 pts · Medium effort · DR & Backup
3
Add tests that import the unreached modules (directly or through their public entry).
+9.1 pts · Medium effort · Test Coverage

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~0.7 person-years to rebuild), and its weakest lens is Readiness at 24%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~0.7 person-years rebuild (124,661 LoC) · weakest lens: Readiness 24%
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 85–510.3 engineer-days every year, paid as drag on the ~516,151 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 7–15% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 127,270 line(s) changed over a 90-day window ⇒ ~516,151/year · D1/D2/D4/D6 code quality: averaging 5.4/10 ⇒ a 7–15% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: 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. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ 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.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.4/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 7–15% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 5.4/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

86 modules, 44 dependencies. Every dependency points down the layering — no cycles.

Showing the 40 most-connected modules; 46 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 (global)2 App.Consts3 App.Entity4 App.Entity.Query5 App.View.User.Theme.Cartoon6 Kernel.Annotation7 Kernel.Cache8 Kernel.Component9 Kernel.Consts10 Kernel.Container11 Kernel.Context.Interface12 Kernel.Database13 Kernel.Exception14 Kernel.File15 Kernel.Plugin16 Kernel.Plugin.Entity17 Kernel.Waf.Css18 app.View19 assets.common.js.util.dict20 App.Interceptor21 App.Model22 App.Pay23 Kernel.Context.Abstract24 Kernel.Util25 Kernel.Waf26 assets.admin.js.dict27 assets.user.js.dict28 App.Controller.Base29 App.Service30 Kernel.Context31 App.Controller.Base.API32 App.Controller.Base.View33 App.Service.Bind34 App.Util35 App.Controller36 App.Controller.Admin37 App.Controller.Admin.Api38 App.Controller.Shared39 App.Controller.User40 App.Controller.User.Api
1 (global)
2 App.Consts
3 App.Entity
4 App.Entity.Query
5 App.View.User.Theme.Cartoon
6 Kernel.Annotation
7 Kernel.Cache
8 Kernel.Component
9 Kernel.Consts
10 Kernel.Container
11 Kernel.Context.Interface
12 Kernel.Database
13 Kernel.Exception
14 Kernel.File
15 Kernel.Plugin
16 Kernel.Plugin.Entity
17 Kernel.Waf.Css
18 app.View
19 assets.common.js.util.dict
20 App.Interceptor92
21 App.Model1
22 App.Pay1
23 Kernel.Context.Abstract1
24 Kernel.Util1
25 Kernel.Waf1
26 assets.admin.js.dict1
27 assets.user.js.dict1
28 App.Controller.Base15
29 App.Service327
30 Kernel.Context1
31 App.Controller.Base.API213
32 App.Controller.Base.View4
33 App.Service.Bind32632
34 App.Util1711
35 App.Controller11
36 App.Controller.Admin1219
37 App.Controller.Admin.Api1363628
38 App.Controller.Shared1143
39 App.Controller.User118
40 App.Controller.User.Api762924
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
(global)App.ConstsApp.EntityApp.Entity.Query…ew.User.Theme.CartoonKernel.AnnotationKernel.CacheKernel.ComponentKernel.ConstsKernel.Container…nel.Context.InterfaceKernel.DatabaseKernel.ExceptionKernel.FileKernel.PluginKernel.Plugin.EntityKernel.Waf.Cssapp.View…s.common.js.util.dictApp.InterceptorApp.ModelApp.Pay…rnel.Context.AbstractKernel.UtilKernel.Wafassets.admin.js.dictassets.user.js.dictApp.Controller.BaseApp.ServiceKernel.Context…p.Controller.Base.API….Controller.Base.ViewApp.Service.BindApp.UtilApp.ControllerApp.Controller.Admin….Controller.Admin.ApiApp.Controller.SharedApp.Controller.User…p.Controller.User.Api(global)1App.Consts2App.Entity3App.Entity.Query4…ew.User.Theme.Cartoon5Kernel.Annotation6Kernel.Cache7Kernel.Component8Kernel.Consts9Kernel.Container10…nel.Context.Interface11Kernel.Database12Kernel.Exception13Kernel.File14Kernel.Plugin15Kernel.Plugin.Entity16Kernel.Waf.Css17app.View18…s.common.js.util.dict19App.Interceptor20App.Model21App.Pay22…rnel.Context.Abstract23Kernel.Util24Kernel.Waf25assets.admin.js.dict26assets.user.js.dict27App.Controller.Base28App.Service29Kernel.Context30…p.Controller.Base.API31….Controller.Base.View32App.Service.Bind33App.Util34App.Controller35App.Controller.Admin36….Controller.Admin.Api37App.Controller.Shared38App.Controller.User39…p.Controller.User.Api40921111111153271213432632171111121913636281143118762924+46 more modules (most-connected shown)

At a glance — Code Health · 32% · Weak · gated by D1, D2, R1, R2, R3 ·

At a glance — Architecture · 82% · Adequate · gated by D26 ·

At a glance — Maturity · 47% · Weak · gated by M2 ·

At a glance — Readiness · 24% · Critical · gated by R4, P3, P5, P7 ·

At a glance — Security · 72% · Adequate · gated by D29, D36 ·

At a glance — Accessibility · 37% · Weak · gated by AC4 ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2021 — Injection36High / Critical
A06:2021 — Vulnerable & Outdated Components5High / Critical
A05:2021 — Security Misconfiguration5High / Critical
A02:2021 — Cryptographic Failures3High / Critical

Roadmap

First, integrate automated security scanning into the CI pipeline to block regressions and codify disaster recovery procedures with clear documentation. Second, establish explicit timeouts and retry logic for all outbound HTTP calls to prevent indefinite hangs, and expand test coverage to include currently unreachable production modules. Finally, maintain a changelog to ensure release hygiene and traceability.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
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.+9.1 ptsMediumSecurity & performance tooling
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.+9.1 ptsMediumDR & Backup
Add tests that import the unreached modules (directly or through their public entry).+9.1 ptsMediumTest Coverage
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.+8.9 ptsMediumOutbound HTTP resilience
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+8.3 ptsMediumRelease Hygiene
Resolve the 1 Banned license finding(s) in License Compliance.+4.1 ptsLowLicense Compliance
Add OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) so requests are traceable across the system, not just health-probable.+5.9 ptsMediumObservability
Add an approval/environment gate (required reviewers / protection rules) before production promotion.+5.9 ptsMediumDeployment & Rollback

File quality

Per-file score 0–10 — a quality signature. Of 183 files carrying findings, judged against the Production bar: 1% slop · 80% mixed · 19% near-clean.

FileScoreBandWorst signal
REDACTED2.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED6.3MixedIaC & Container Security: Medium IaC: REDACTED
assets/admin/js/mobile/fallback.js7.0MixedCyclomatic Complexity: fallback.render (cyclomatic 177)
assets/static/codemirror/lib/codemirror.js7.0MixedCyclomatic Complexity: codemirror.addEditorMethods (cyclomatic 139)
app/Service/Bind/Order.php7.0MixedCyclomatic Complexity: Order.trade (cyclomatic 125)
assets/static/codemirror/mode/css/css.js7.0MixedCyclomatic Complexity: css.CodeMirror.defineMode("css") (cyclomatic 114)
assets/admin/js/menu.js7.0MixedCyclomatic Complexity: KTMenu (cyclomatic 109)
assets/common/js/component.js7.0MixedCyclomatic Complexity: popup (cyclomatic 99)
assets/common/js/editor/markdown/editorv2.js7.0MixedCyclomatic Complexity: register (cyclomatic 74)

How the grades work

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 — 112

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 — 1367

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 — 86

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 16

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

Watchdog 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. 69 of 73 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 73 dimensions across the health lenses
D1D2D3D4D6D12D13D14D15D17D19D20D21D26D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX3AX4GD1IC1M1M2M3M4P1P2P3P4P5P6P7PF3R1R10R2R3R4R7R9S1X1X12X13X14X15X16X18X19X2X21X22X23X24X25X28X29X3X30

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
  1. 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, 1543 of 1565 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a106f1-0d72-79ae-93f3-89784b573ba4.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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 — Watchdog 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. To have real coverage read, produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog 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 (4 contributor(s) across 333 commit(s) sampled, automation and bot accounts excluded). One of them holds 98% of the history; the other 3 hold 0.7% 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.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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`, … (+25 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 — Watchdog measured this, but not all of it. What it 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. 116 further occurrence(s) are not listed individually; the score already reflects all 156.
  • AX1 Captive dependencies — not measured this run — Watchdog 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, 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.
  • AX6 Interface segregation — not measured this run — Watchdog 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • M3 Folder & project structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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.
  • P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 — Watchdog 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 — Watchdog measured this, but not all of it. What it 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. 263 further occurrence(s) are not listed individually; the score already reflects all 303.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog 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 TypeScript source only, and no C# was loaded and no TypeScript was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog 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 Java, Rust, Erlang and F# source only, and no C# was loaded, no Java, Rust, Erlang or F# was found, and this repository's JavaScript, PHP is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 48 further occurrence(s) are not listed individually; the score already reflects all 88.
  • X4 Structured logging — not measured this run — Watchdog 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 source only, and no C# was loaded, and this repository's JavaScript/TypeScript makes no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, and TypeScript source and its tsconfig files only, and no C# was loaded, no TypeScript was found, and this repository's PHP is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a 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.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • 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.

The LLM boundary

LLM-set scores this run (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

558 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was tree.select.layui.define() at 1045. A further 10 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. 3 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), 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.

(anonymous)::(anonymous)::onMousedownNode::_docMouseMove (cyclomatic 132) · ×20REDACTED:2968
(anonymous) (cyclomatic 23) · ×2assets/admin/controller/trade/coupon.js:677
Card.save (cyclomatic 20) · ×2app/Controller/Admin/Api/Card.php:334
click (cyclomatic 20) · ×2assets/admin/controller/pay/plugin.js:425
tree.select.layui.define() (cyclomatic 1045)REDACTED:1

+ 359 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 31 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 31 together lifts Cyclomatic Complexity from 2.0 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

671 method(s) exceeded the cognitive complexity threshold of 15; the worst was tree.select.layui.define() at 1209.

(anonymous)::(anonymous)::onMousedownNode::_docMouseMove (cognitive 229) · ×29REDACTED:2968
addEditorMethods::getHelpers (cognitive 17) · ×4assets/static/codemirror/lib/codemirror.js:8388
(anonymous) (cognitive 16) · ×4assets/common/js/csp-bind.js:169
click (cognitive 17) · ×2assets/admin/controller/pay/plugin.js:425
setupSheetDrag::pointerDown (cognitive 16) · ×2assets/admin/js/mobile/overlay.js:745

+ 456 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 46 bodies over 60 down to 60 or less in Cognitive Complexity — start with tree.select.layui.define() (cognitive 1209), commodity (cognitive 303), 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 46 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.5 / 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.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Prevented

102 god class(es) detected.

FileTooLong: lib/codemirror.js · ×35assets/static/codemirror/lib/codemirror.js
FunctionTooLong: tree.select.layui.define() · ×30REDACTED:1
MethodTooLong: Order.trade · ×15app/Service/Bind/Order.php:555
ClassTooLong: Form · ×13REDACTED:1
TooManyMethods: Form · ×9REDACTED:1

What to do

  1. Resolve the 35 FileTooLong finding(s) in God Classes — start with index.js (2), codemirror.js, REDACTED. — One of this dimension's main actionable groups (35 warning-level).
  2. Resolve the 30 FunctionTooLong finding(s) in God Classes — start with commodity.js (4), menu.js (3), codemirror.js (3). — One of this dimension's main actionable groups (30 warning-level).
  3. Resolve the 15 MethodTooLong finding(s) in God Classes — start with Commodity.php (3), Order.php, component.js. — One of this dimension's main actionable groups (15 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.5 / 10Stronggated by 149 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

138 duplicated block group(s) detected. A further 11 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .js (59% 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.

Duplicated block (6 lines × 2) · ×13app/Controller/Admin/Api/Card.php:339
Duplicated block (10 lines × 2) · ×9app/Controller/Admin/Api/BusinessLevel.php:118
Duplicated block (12 lines × 2) · ×8app/Controller/Admin/Api/Coupon.php:158
Duplicated block (8 lines × 2) · ×8app/Controller/Admin/Api/Coupon.php:274
Duplicated block (7 lines × 2) · ×8app/Controller/Admin/Api/Card.php:170

+ 63 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 13 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with Card.php (2), Order.php (2), ManageSessionManager.php (2). — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 9 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with BusinessLevel.php (2), Authentication.php (2), Message.php (2). — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 8 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with Order.php (2), ManageSessionManager.php (2), Coupon.php. — One of this dimension's main actionable groups (8 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)8.0 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 6 classes have LCOM4 above 3.

Low cohesion: Format (LCOM4 21)assets/common/js/format.js:1

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with format.js. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D12 · Dependency Hygiene9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

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.

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

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

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots9.0 / 10Stronggated by 67 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: REDACTED (3×1045=3135); app/Service/Bind/Order.php (16×125=2000); app/Controller/User/Api/Commodity.php (12×73=876)

Hotspot: REDACTED · ×67REDACTED:1

What to do

  1. Resolve the 67 Hotspot finding(s) in Churn × Complexity Hotspots — start with Order.php (3), index.js (3), Commodity.php (2). — One of this dimension's main actionable groups (67 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 50380 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

The repository's root README is a well-structured marketing document with an overview (the project name and its purpose), legal disclaimer, advertising, quick-start walkthroughs for demo sites, feature list, and installation instructions. The docker/README.md is a focused deployment guide that documents the docker/ directory rather than the main repo, showing install steps, secrets-init password generation, compose-based standalone MySQL/Redis, and security notes (container port 80 not 8080, data-volume persistence). Both are strong but the root README's scope is limited to marketing while the docker README is a deployment doc; no architecture or contribution docs exist.

What to do

  1. Improve Documentation Quality — currently 8.0/10. — The repository's root README is a well-structured marketing document with an overview (the project name and its purpose), legal disclaimer, advertising, quick-start walkthroughs for demo sites, feature list, and installation instructions. The docker/README.md is a focused deployment guide that documents the docker/ directory rather than the main repo, showing install steps, secrets-init password generation, compose-based standalone MySQL/Redis, and security notes (container port 80 not 8080, data-volume persistence). Both are strong but the root README's scope is limited to marketing while the docker README is a deployment doc; no architecture or contribution docs exist.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — 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.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Composer) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. 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.

D29 · Static Analysis (SAST)1.1 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 1.1 / 10 · rule-coverage 100% · ceiling Documented

36 finding(s): 0 critical, 14 high, 22 medium, 0 low. 8 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 67 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), … (+62 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

+ 6 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. 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).
  3. No action in Static Analysis (SAST) — all 8 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 (8 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities8.3 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Documented

5 finding(s): 0 critical, 2 high, 2 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. 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).
  2. 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).
  3. 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.

D31 · IaC & Container Security9.3 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

5 finding(s): 0 critical, 1 high, 4 medium, 0 low.

REDACTED
REDACTED

What to do

  1. 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).
  2. 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.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 274 of the 463 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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. Scored 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. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives4.4 / 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. (×14) — 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.
AC2 · Forms & labels4.4 / 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.
AC3 · Page structure5.2 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • The 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.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

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:50, 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:67, 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
  • 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:1416, assets/admin/controller/store/developer.js:654, assets/admin/controller/store/developer.js:663, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.7 / 10Strong✓ Tool-verified

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.
AC6 · Visual & motion safety6.1 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.jie-row li span` sets color: #fff on background-color: #dadada — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from). — assets/user/css/_user.css:1
  • `.jie-row li span` sets color: #fff on background-color: #DADADA — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×3) — assets/user/css/global.css:1309, assets/user/css/global_1.css:1308, assets/user/css/global_2.css:1320
  • `.auth-skin-universal .auth-status > .layui-form-checkbox > span` sets color: #FFFFFF on background-color: #ffaaaa !important — 1.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/static/modules/src/style/authtree/css/auth-skin-universal.css:43
  • `.layui-form-checked[lay-skin=primary] i` sets color: #fff on background-color: #ffccdf — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/static/layui/css/layui.css:2462
  • `.anticipation thead th button` sets color: #a3a0a0 on background-color: white — 2.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/static/css/i.css:1411
  • `.page-item.active .page-link` sets color: #FFFFFF on background-color: #f7bcda — 1.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/static/bootstrap-table/css/bootstrap-table.css:343
  • `.layui-form-checkbox>div` sets color: #fff on background-color: #d2d2d2 — 1.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from). (×2) — assets/common/js/layui/css/layui.css:1, assets/common/css/_.css:1
  • `.layui-layer-title` sets color: #999 on background-color: #f6f7f9 — 2.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/common/js/layer/theme/default/layer.css:358
  • `section.cover .cover-main > p:last-child a:last-child` sets color: #fff on background-color: #42b983 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/common/js/docsify/themes/vue.css:575
  • `section.cover .cover-main>p:last-child a:last-child` sets color: #fff on background-color: #42b983 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from). — assets/common/js/docsify/lib/themes/vue.css:1
  • `.auth-skin-universal .layui-form-checked[lay-skin=primary] i` sets color: #fff on background-color: #ffccdf — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/common/css/auth-skin-universal.css:165
  • `.update-badge` sets color: #ffffff on background-color: #50CD89 — 2.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/common/css/component.css:2930

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 114 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
AX10 · Code composition8.2 / 10Strong✓ Tool-verified

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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

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.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

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.

M1 · Documentation (README)6.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy5.0 / 10Adequate◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README claims a '云更新' feature but the evidence shows no cloud-upgrade or versioning component — searched for: `cloud update`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, REDACTED); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
  • README claims an '应用商店' with plugins and templates but there is no app-store directory in the evidence — searched for: `app store`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, REDACTED); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.

What to do

  • Reconcile the README with reality: README claims a '云更新' feature but the evidence shows no cloud-upgrade or versioning component; README claims an '应用商店' with plugins and templates but there is no app-store directory in the evidence.
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.
P2 · Observability8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

What to do

  • Add OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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 4981 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.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

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.
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.

What to do

  • Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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. 2 of the 2 files that make outbound calls are unbounded; the first 2 are listed. — 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.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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 the language 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.

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 · 130 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 (+124 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.
R10 · Code Duplication8.0 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.

  • 56 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) — 43 of them are reported below, and 13 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 56 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 56 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 56 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
  • 51 duplicated blocks under assets/ have copies in at least two of the sibling directories admin, common, static, user — 39 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 51 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 51 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 51 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
  • 5 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, business, dashboard, security, user under assets/user/controller/. That concentration is one structural fact, not 5 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 5 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:1
  • 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:132 · assets/user/controller/business/card.js:43 — the two spans are one implementation copied and then locally edited — 1595 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:132
  • 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/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:525 · 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:525
  • assets/user/controller/dashboard/index.js:1 · assets/user/controller/user/purchase.record.js:1 — these 2 files are line-for-line copies of one another — 62 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/user/controller/dashboard/index.js:1
  • assets/admin/controller/trade/commodity.js:233 · 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:233
  • assets/admin/controller/trade/commodity.js:775 · 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:775
  • assets/admin/controller/trade/commodity.js:294 · 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:294
  • assets/admin/controller/trade/commodity.js:375 · 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:375
  • assets/user/controller/business/business.js:153 · assets/user/controller/business/business.js:279 — 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:153
  • 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/admin/controller/trade/card.js:192 · assets/admin/controller/trade/commodity.js:835 · assets/user/controller/business/card.js:103 · assets/user/controller/business/commodity.js:426 — the 4 copies are spread across 4 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:192
  • assets/static/acg.js:915 · assets/user/js/treasure.js:11 — the two spans are one implementation copied and then locally edited — 317 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:915
  • assets/admin/controller/store/home.js:1030 · assets/admin/controller/store/home.js:1323 — 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:1030
  • assets/static/acg.js:214 · 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:214
  • assets/admin/controller/store/developer.js:640 · assets/admin/controller/store/home.js:1117 — 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/admin/controller/trade/card.js:329 · assets/admin/controller/trade/coupon.js:451 — 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:329
  • 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
  • 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:1614 · assets/admin/js/mobile/recipes.js:1728 — 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:1614
  • 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:43 · 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:43
  • 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:104 · 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:104
  • 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/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
  • assets/admin/controller/user/ticket.js:117 · assets/user/controller/user/ticket.detail.js:56 — 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/user/ticket.js:117
  • assets/admin/js/menu.js:2671 · assets/admin/js/menu.js:3513 — 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/menu.js:2671
  • REDACTED:1022 · assets/static/modules/hex.js:603 — 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. — REDACTED:1022
  • assets/common/js/component/search.js:28 · assets/common/js/component/search.js:60 — the two spans are one implementation copied and then locally edited — 100 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — assets/common/js/component/search.js:28

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.
R2 · Cyclomatic Complexity3.0 / 10Weak✓ Tool-verified

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. — assets/static/codemirror/mode/markdown/markdown.js: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 69 and cognitive complexity 204; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:505
  • (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. — assets/static/codemirror/mode/markdown/markdown.js: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
  • 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
  • createForm has cyclomatic complexity 40 and cognitive complexity 8; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:1899
  • (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

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
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.

  • 43 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: assets/static/codemirror/lib/codemirror.js (8882), REDACTED (3978), assets/admin/js/mobile/fallback.js (3083), assets/admin/js/menu.js (2923), REDACTED (1951), assets/admin/js/mobile/recipes.js (1906) (+37 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
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 130 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).
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.

R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

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.

S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

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. Deterministic.

  • No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — 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

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.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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.

X2 · Cancellation propagation8.5 / 10Strong✓ Tool-verified

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) 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:429

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped8.0 / 10Strong✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `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

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.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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.

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.

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.

X3 · Exception handling4.0 / 10Weak✓ Tool-verified

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. (×18) — app/Controller/Install.php:286, app/Controller/Install.php:315, app/Controller/Install.php:320, …
  • `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. (×18) — app/Controller/Admin/Api/PriceTemplate.php:273, app/Controller/Admin/Api/PriceTemplate.php:337, REDACTED:555, …
  • `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — app/Controller/Admin/Api/Coupon.php:375, app/Controller/User/Api/Coupon.php:173
  • `catch (\Error | \Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — app/Controller/Shared/Commodity.php:211, app/Controller/Shared/Commodity.php:360

What to do

  • Swallowed exception (empty catch)
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.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health32%Weak — gated by D1, D2, R1, R2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture82%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity47%Weak — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness24%Critical — gated by R4, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security72%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility37%Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100%ExemplaryStrongest area.
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 — 25 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 — 36 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 51 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AX1 Captive dependencies — not 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
  • 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
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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 18 — an image could not be pulled) — secrets-init Pulling mysql Pulling redis Pulling app Pulling mysql Error Get "https://registry-1.docker.io/v2/": Forbidden app Warning context canceled secrets-init Error context canceled redis Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: mysql Pulling app Pulling redis Pulling redis Error Get "https://registry-1.docker.io/v2/": Forbidden mysql Error Get "https://registry-1.docker.io/v2/": Forbidden app Warning context canceled WARNING: Some service image(s) must be built from source by running: docker compose build app Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~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. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.html,.js), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 30 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.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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.
  • D5 Coupling — Not applicable — this Composer build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is 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 its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (34 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); its 34 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 — no coverage report found on disk — produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • 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 applicable: TypeScript/JavaScript and PHP runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • 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).
  • X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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.
  • 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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — 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
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 112 finding(s)
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×25
  • Clickable element isn't keyboard-operable app/View/Admin/Config/Setting.html:50 — 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:67 — 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:1416 — 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:1026 — 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:1028 — 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:1034 — 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:1040 — 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:1113 — 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:1115 — 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:1131 — 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:1140 — 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:1158 — 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:1160 — 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:1333 — 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.
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 · ×14
  • <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:852 — 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:853 — 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:854 — 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:855 — 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:939 — 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:940 — 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:941 — 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:942 — 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.
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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · Malformed <html lang> value "#{lang_code()}" · ×6
  • 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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.
AC3 · Page structure · Viewport restricts zoom · ×2
  • 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.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×1
  • <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.
D14 · License Compliance · Banned license · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
Serious — 1367 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×67
  • Hotspot: REDACTED REDACTED:1 — REDACTED changed 3 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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:555 — app/Service/Bind/Order.php changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in Order.trade at line 555. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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:382 — app/Controller/Admin/Api/Commodity.php changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in Commodity.save at line 382. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/common/js/component.js assets/common/js/component.js:339 — assets/common/js/component.js changed 5 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/admin/controller/config/index.js assets/admin/controller/config/index.js:144 — assets/admin/controller/config/index.js changed 6 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: app/Controller/Admin/Api/Store.php app/Controller/Admin/Api/Store.php:1081 — app/Controller/Admin/Api/Store.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Store.addItem at line 1081. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: REDACTED REDACTED:1338 — REDACTED changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Config.emailFailureMessage at line 1338. 1 of those changes was a fix/bug commit, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: REDACTED REDACTED:1382 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in Table.#getPreprocessColumn at line 1382. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/Controller/Admin/Api/Pay.php app/Controller/Admin/Api/Pay.php:139 — app/Controller/Admin/Api/Pay.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in Pay.paymentSaveMap at line 139. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/Manage.php app/Controller/Admin/Api/Manage.php:120 — app/Controller/Admin/Api/Manage.php changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in Manage.save at line 120. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07:00' --full-history --no-merges -- app/Controller/Admin/Api/Manage.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/commodity.js assets/admin/controller/trade/commodity.js:123 — assets/admin/controller/trade/commodity.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in commodity.modal at line 123. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: app/Controller/User/Api/Index.php app/Controller/User/Api/Index.php:67 — app/Controller/User/Api/Index.php changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Index.commodity at line 67. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/admin/controller/trade/coupon.js assets/admin/controller/trade/coupon.js:204 — assets/admin/controller/trade/coupon.js changed 6 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/common/js/editor/markdown/editorv2.js assets/common/js/editor/markdown/editorv2.js:57 — assets/common/js/editor/markdown/editorv2.js changed 4 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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:349 — assets/admin/controller/shared/store.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in store.mountRemoteProductPicker at line 349. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/Authentication.php app/Controller/User/Api/Authentication.php:45 — app/Controller/User/Api/Authentication.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Authentication.register at line 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/admin/controller/trade/order.js assets/admin/controller/trade/order.js:478 — assets/admin/controller/trade/order.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in order.$(".btn-app-export").off().on() at line 478. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/Controller/Admin/Api/User.php app/Controller/Admin/Api/User.php:84 — app/Controller/Admin/Api/User.php changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in User.save at line 84. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: assets/admin/controller/pay/api.js assets/admin/controller/pay/api.js:99 — assets/admin/controller/pay/api.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in api.confirmPayDelete at line 99. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07:00' --full-history --no-merges -- assets/admin/controller/pay/api.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/user/index.js assets/admin/controller/user/index.js:44 — assets/admin/controller/user/index.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in index.mobileAccountSubmit at line 44. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07:00' --full-history --no-merges -- assets/admin/controller/user/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/store/home.js assets/admin/controller/store/home.js:809 — assets/admin/controller/store/home.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in home._Bill at line 809. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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: REDACTED REDACTED:3 — REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Form.constructor at line 3. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/Shared.php app/Service/Bind/Shared.php:852 — app/Service/Bind/Shared.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Shared.syncRemoteItem at line 852. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07: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/user/group.js assets/admin/controller/user/group.js:181 — assets/admin/controller/user/group.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in group.CommodityGroupModal at line 181. 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-07-05..2026-10-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-05 12:25:56 -07:00' --until='2026-10-03 12:25:56 -07:00' --full-history --no-merges -- assets/admin/controller/user/group.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.
  • + 42 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×35
  • 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: js/menu.js assets/admin/js/menu.js — 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 — 1531 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 31 over it, 1.02× 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 — 1494 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 994 over it, 2.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: 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: mobile/overlay.js assets/admin/js/mobile/overlay.js — 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: store/home.js assets/admin/controller/store/home.js — FileTooLong — 1105 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 605 over it, 2.21× 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 — 1018 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 518 over it, 2.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: 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 — 925 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Config (32-1378). The bar is 500 significant lines; this is 425 over it, 1.85× 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: Bind/Order.php app/Service/Bind/Order.php — FileTooLong — 896 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Order (41-1474). The bar is 500 significant lines; this is 396 over it, 1.79× 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: Api/Store.php app/Controller/Admin/Api/Store.php — FileTooLong — 895 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Store (28-1425). The bar is 500 significant lines; this is 395 over it, 1.79× 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: static/acg.js assets/static/acg.js — FileTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: acg (14-906). The bar is 500 significant lines; this is 246 over it, 1.49× 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: 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: js/util.js assets/common/js/util.js — FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: util (1-1138). The bar is 500 significant lines; this is 235 over it, 1.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: 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.
  • + 10 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×30
  • 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: 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: commodity.modal assets/admin/controller/trade/commodity.js:123 — FunctionTooLong — modal runs 439 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 339 over it, 4.39× 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 assets/admin/js/menu.js: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:349 — 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: home._Auth assets/admin/controller/store/home.js:498 — FunctionTooLong — _Auth runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× 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 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× 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 assets/admin/js/menu.js: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: menu.KTScroll assets/admin/js/menu.js: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: home._Bill assets/admin/controller/store/home.js:809 — FunctionTooLong — _Bill 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/admin/controller/trade/card.js:101 — FunctionTooLong — uploadCard runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: commodity.uploadCard assets/admin/controller/trade/commodity.js:745 — FunctionTooLong — uploadCard runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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.
  • + 5 more in this group — see findings.md.
D2 · Cognitive Complexity · (anonymous) · ×29
  • (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) assets/static/codemirror/mode/python/python.js: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) assets/static/codemirror/mode/python/python.js: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/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)::submit (cognitive 27) assets/admin/controller/trade/order.js:520 — (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)::(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:636 — (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) assets/static/codemirror/mode/python/python.js: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) assets/static/codemirror/mode/python/python.js: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.
  • + 4 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×22
  • Swallowed exception (caught, then discarded) app/Controller/Admin/Api/PriceTemplate.php:273 — `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) app/Controller/Admin/Api/PriceTemplate.php:337 — `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) app/Controller/Admin/Api/Coupon.php:375 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:555 — `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) app/Controller/Shared/Commodity.php:211 — `catch (\Error | \Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/Controller/Shared/Commodity.php:360 — `catch (\Error | \Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/Controller/User/Api/Promote.php:120 — `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) app/Controller/User/Api/Promote.php:147 — `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) app/Controller/User/Api/Coupon.php:173 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/Model/PriceTemplate.php:86 — `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) app/Model/PriceTemplate.php:159 — `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) app/Model/Config.php:327 — `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) app/Service/UserSessionManager.php:97 — `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) app/Service/UserSessionManager.php:192 — `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) app/Service/ManageSessionManager.php:97 — `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) app/Service/Bind/Ticket.php:51 — `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) app/Service/Bind/Shared.php:706 — `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) app/Service/Bind/Shared.php:841 — `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) app/Service/Bind/Query.php:65 — `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) app/Service/Bind/Message.php:44 — `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) app/Service/Bind/Message.php:74 — `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) app/Service/Bind/Message.php:347 — `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.
D1 · Cyclomatic Complexity · (anonymous) · ×20
  • (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:520 — (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) assets/static/codemirror/mode/python/python.js: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) assets/static/codemirror/mode/python/python.js: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:636 — (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.
X3 · Exception handling · Swallowed exception (empty catch) · ×18
  • Swallowed exception (empty catch) app/Controller/Install.php:286 — 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) app/Controller/Install.php:315 — 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) app/Controller/Install.php:320 — 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) app/Controller/Admin/Api/Order.php:420 — 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) app/Controller/Admin/Api/Dashboard.php:296 — 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) app/Controller/Admin/Api/Dashboard.php:306 — 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) app/Controller/Admin/Api/Dashboard.php:310 — 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) app/Controller/Admin/Api/Authentication.php:81 — 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) app/Controller/Admin/Api/Authentication.php:214 — 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) app/Controller/User/Api/CommodityOrder.php:235 — 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) app/Controller/User/Api/Card.php:339 — 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) app/Controller/User/Api/Card.php:347 — 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) app/Controller/User/Api/Authentication.php:522 — 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) app/Model/UserLog.php:79 — 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) app/Service/Bind/Ticket.php:608 — 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) app/Service/Bind/Ticket.php:1035 — 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) app/Service/Bind/Order.php:994 — 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) app/Service/Bind/Order.php:1137 — 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.
D3 · God Classes · MethodTooLong · ×15
  • MethodTooLong: Order.trade app/Service/Bind/Order.php:555 — MethodTooLong — trade runs 283 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 183 over it, 2.83× 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:1081 — MethodTooLong — addItem runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× 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: Commodity.save app/Controller/Admin/Api/Commodity.php:382 — 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: 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: Index.commodity app/Controller/User/Api/Index.php:67 — MethodTooLong — commodity runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 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: User.save app/Controller/Admin/Api/User.php:84 — MethodTooLong — save 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:140 — 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.
D3 · God Classes · ClassTooLong · ×13
  • 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: Config REDACTED:31 — ClassTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 498 over it, 2.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Store app/Controller/Admin/Api/Store.php:27 — ClassTooLong — 874 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 474 over it, 2.19× 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:41 — ClassTooLong — 859 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 459 over it, 2.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: acg assets/static/acg.js:1 — ClassTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 267 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Commodity app/Controller/Admin/Api/Commodity.php:29 — ClassTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 139 over it, 1.35× 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: Shared app/Service/Bind/Shared.php:20 — ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 101 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Card app/Controller/Admin/Api/Card.php:24 — ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 65 over it, 1.16× 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 — 439 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 39 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: Pay app/Controller/Admin/Api/Pay.php:32 — ClassTooLong — 437 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 37 over it, 1.09× 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) app/Controller/Admin/Api/Card.php:339 — app/Controller/Admin/Api/Card.php:339-344 | app/Controller/User/Api/Card.php:80-85 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 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:339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/Controller/Admin/Api/Order.php:586 — app/Controller/Admin/Api/Order.php:586-591 | 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 14 separate duplicated blocks between them, totalling at least 245 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/Service/Bind/Order.php:251 — app/Service/Bind/Order.php:251-256 | app/Service/Bind/Order.php:389-394 — both copies are in the same file, so extract the 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:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/Service/Bind/Order.php:385` calls `getValuationPrice`, `Decimal` and `app/Service/Bind/Order.php:249` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) 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/Bind/Message.php:41 — app/Service/Bind/Message.php:41-46 | app/Service/Bind/Ticket.php:48-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) 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/User/Api/Card.php:246 — app/Controller/User/Api/Card.php:246-251 | app/Controller/User/Api/Card.php:259-264 — both copies are in the same file, so extract the 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:155 — app/Controller/User/Api/Security.php:155-160 | app/Controller/User/Api/Security.php:179-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) app/Service/Bind/Shared.php:716 — app/Service/Bind/Shared.php:716-721 | app/Service/Bind/Shared.php:734-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×9
  • 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 — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • 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:31 — 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: 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×9
  • Duplicated block (10 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:118 — app/Controller/Admin/Api/BusinessLevel.php:118-127 | app/Controller/Admin/Api/Pay.php:188-197 — 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/BusinessLevel.php:118` 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/Controller/Admin/Api/BusinessLevel.php:233 — app/Controller/Admin/Api/BusinessLevel.php:233-242 | 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 5 separate duplicated blocks between them, totalling at least 98 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:233` 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:375 — app/Controller/Admin/Api/User.php:375-384 | app/Controller/Admin/Api/User.php:501-510 — both copies are in the same file, so extract the 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: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.
  • Duplicated block (10 lines × 2) app/Controller/User/Api/Authentication.php:203 — app/Controller/User/Api/Authentication.php:203-212 | app/Controller/User/Api/Security.php:233-242 — 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/Authentication.php:203` 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/Controller/User/Api/Authentication.php:273 — app/Controller/User/Api/Authentication.php:273-282 | app/Controller/User/Api/Security.php:254-263 — 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/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 (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/Service/Bind/Message.php:1028 — app/Service/Bind/Message.php:1028-1037 | app/Service/Bind/Ticket.php:1348-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/Service/Bind/Message.php:1028` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ 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 (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.
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>.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) app/Controller/Admin/Api/Coupon.php:158 — app/Controller/Admin/Api/Coupon.php:158-169 | app/Controller/Admin/Api/RechargeOrder.php:79-90 — 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/Coupon.php:158` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/Controller/Admin/Api/Order.php:44 — app/Controller/Admin/Api/Order.php:44-55 | 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 14 separate duplicated blocks between them, totalling at least 245 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:44` 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/Admin/Api/Upload.php:45 — app/Controller/Admin/Api/Upload.php:45-56 | app/Controller/User/Api/Upload.php:40-51 — before extracting anything, compare `app/Controller/Admin/Api/Upload.php` and `app/Controller/User/Api/Upload.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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 (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:591 — app/Service/Bind/Order.php:591-602 | app/Service/Bind/Shop.php:149-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • 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/Service/ManageWebauthnService.php:41 — app/Service/ManageWebauthnService.php:41-65 | app/Service/ManageWebauthnService.php:168-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) app/Controller/Admin/Api/Coupon.php:274 — app/Controller/Admin/Api/Coupon.php:274-281 | app/Controller/User/Api/Coupon.php:81-90 — before extracting anything, compare `app/Controller/Admin/Api/Coupon.php` and `app/Controller/User/Api/Coupon.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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/Coupon.php:274` 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/Admin/Api/Manage.php:573 — app/Controller/Admin/Api/Manage.php:573-580 | app/Controller/Admin/Api/Manage.php:599-606 — both copies are in the same file, so extract the 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/Manage.php:573` 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/Admin/Api/Upload.php:145 — app/Controller/Admin/Api/Upload.php:145-152 | app/Controller/User/Api/Upload.php:145-152 — before extracting anything, compare `app/Controller/Admin/Api/Upload.php` and `app/Controller/User/Api/Upload.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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/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:199 — app/Controller/User/Api/Authentication.php:199-206 | app/Controller/User/Api/Authentication.php:224-231 — both copies are in the same file, so extract the 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:199` 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:269 — app/Controller/User/Api/Authentication.php:269-276 | app/Controller/User/Api/Authentication.php:295-302 — both copies are in the same file, so extract the 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:269` 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/Service/Bind/Currency.php:62 — app/Service/Bind/Currency.php:62-69 | app/Service/Bind/Pay.php:641-648 — 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/Currency.php:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×8
  • Duplicated block (7 lines × 2) app/Controller/Admin/Api/Card.php:170 — app/Controller/Admin/Api/Card.php:170-176 | 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:170` 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/Message.php:82 — app/Controller/Admin/Api/Message.php:82-88 | app/Controller/User/Api/Message.php:54-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/Controller/Admin/Api/Order.php:521 — app/Controller/Admin/Api/Order.php:521-527 | app/Controller/Admin/Api/RechargeOrder.php:326-345 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 245 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:521` 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 (7 lines × 2) app/Controller/Admin/Api/Order.php:594 — app/Controller/Admin/Api/Order.php:594-600 | 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 14 separate duplicated blocks between them, totalling at least 245 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/Upload.php:71 — app/Controller/Admin/Api/Upload.php:71-77 | app/Controller/User/Api/Upload.php:74-80 — before extracting anything, compare `app/Controller/Admin/Api/Upload.php` and `app/Controller/User/Api/Upload.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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/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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) app/Controller/Admin/Api/Category.php:472 — app/Controller/Admin/Api/Category.php:472-480 | app/Controller/User/Api/Category.php:76-87 — 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/Coupon.php:425 — app/Controller/Admin/Api/Coupon.php:425-433 | app/Controller/Admin/Api/Coupon.php:444-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/Controller/Admin/Api/Coupon.php:425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/Controller/Admin/Api/Upload.php:101 — app/Controller/Admin/Api/Upload.php:101-109 | app/Controller/User/Api/Upload.php:103-111 — before extracting anything, compare `app/Controller/Admin/Api/Upload.php` and `app/Controller/User/Api/Upload.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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. 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/Controller/Shared/Commodity.php:433 — app/Controller/Shared/Commodity.php:433-441 | app/Controller/User/Api/Index.php:329-337 — 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:433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/Service/Bind/ManageSSO.php:77 — app/Service/Bind/ManageSSO.php:77-85 | app/Service/Bind/ManageSSO.php:138-146 — both copies are in the same file, so extract the 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/Service/Bind/Ticket.php:711 — app/Service/Bind/Ticket.php:711-719 | app/Service/Bind/Ticket.php:820-828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) app/Util/SharedPayload.php:123 — app/Util/SharedPayload.php:123-131 | app/Util/SharedPayload.php:184-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×7
  • Duplicated block (5 lines × 2) app/Controller/Admin/Api/Commodity.php:621 — app/Controller/Admin/Api/Commodity.php:621-625 | app/Controller/Admin/Api/Commodity.php:673-679 — both copies are in the same file, so extract the 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:621` 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:553-557 — 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/Admin/Api/Upload.php:58 — app/Controller/Admin/Api/Upload.php:58-62 | app/Controller/User/Api/Upload.php:53-57 — before extracting anything, compare `app/Controller/Admin/Api/Upload.php` and `app/Controller/User/Api/Upload.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 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 (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:229 — app/Service/Bind/Order.php:229-233 | app/Service/Bind/Order.php:366-370 — both copies are in the same file, so extract the 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:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/Service/Bind/Shared.php:727 — app/Service/Bind/Shared.php:727-731 | app/Service/Bind/Shared.php:744-748 — both copies are in the same file, so extract the 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:727` 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:734` calls `array_key_exists`, `is_array`, `foreach` and `app/Service/Bind/Shared.php:750` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) app/Util/RichHtml.php:138 — app/Util/RichHtml.php:138-142 | kernel/Waf/Firewall.php:117-121 — 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.4 · ×6
  • Low contrast colour pair in CSS (1.4:1) assets/user/css/_user.css:1 — `.jie-row li span` sets color: #fff on background-color: #dadada — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from).
  • Low contrast colour pair in CSS (1.4:1) assets/user/css/global.css:1309 — `.jie-row li span` sets color: #fff on background-color: #DADADA — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (1.4:1) assets/user/css/global_1.css:1308 — `.jie-row li span` sets color: #fff on background-color: #DADADA — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (1.4:1) assets/user/css/global_2.css:1320 — `.jie-row li span` sets color: #fff on background-color: #DADADA — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (1.4:1) assets/static/layui/css/layui.css:2462 — `.layui-form-checked[lay-skin=primary] i` sets color: #fff on background-color: #ffccdf — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (1.4:1) assets/common/css/auth-skin-universal.css:165 — `.auth-skin-universal .layui-form-checked[lay-skin=primary] i` sets color: #fff on background-color: #ffccdf — 1.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) REDACTED:1245 — REDACTED:1245-1257 | REDACTED:1292-1304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) app/Controller/Admin/Api/Order.php:572 — app/Controller/Admin/Api/Order.php:572-584 | 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 14 separate duplicated blocks between them, totalling at least 245 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:572` 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/Bind/Order.php:272 — app/Service/Bind/Order.php:272-284 | app/Service/Bind/Order.php:1365-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) 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.
D2 · Cognitive Complexity · addEditorMethods · ×4
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 16) · ×4
  • (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/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.
  • (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/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.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) app/Controller/Admin/Api/Commodity.php:549 — app/Controller/Admin/Api/Commodity.php:549-564 | app/Controller/User/Api/Commodity.php:280-295 — 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/Commodity.php:549` 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 (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 — before extracting anything, compare `app/Controller/Admin/Api/Coupon.php` and `app/Controller/User/Api/Coupon.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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/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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) app/Controller/Admin/Api/Card.php:511 — app/Controller/Admin/Api/Card.php:511-521 | app/Controller/Admin/Api/Card.php:530-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/Controller/Admin/Api/Card.php:589 — app/Controller/Admin/Api/Card.php:589-599 | app/Controller/User/Api/Card.php:192-202 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 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:94 — app/Controller/User/Api/Master.php:94-104 | app/Controller/User/Api/Master.php:244-254 — both copies are in the same file, so extract the 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/Model/Card.php:46 — app/Model/Card.php:46-56 | app/Model/Ticket.php:77-97 — 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/Model/Card.php:46` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×4
  • Duplicated block (8–9 lines × 2) app/Controller/Admin/Api/Card.php:212 — app/Controller/Admin/Api/Card.php:212-219 | app/Controller/Admin/Api/Order.php:39-47 — 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:582-589 — both copies are in the same file, so extract the 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:203-210 — 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.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×4
  • 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.
  • Duplicated block (25 lines × 2 locations) assets/admin/controller/user/ticket.js:117 — assets/admin/controller/user/ticket.js:117 · assets/user/controller/user/ticket.detail.js:56 — 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 (25 lines × 2 locations) assets/admin/js/menu.js:2671 — assets/admin/js/menu.js:2671 · assets/admin/js/menu.js:3513 — 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 (25 lines × 2 locations) REDACTED:1022 — REDACTED:1022 · assets/static/modules/hex.js:603 — 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/Controller/Admin/Api/Bill.php:31 — app/Controller/Admin/Api/Bill.php:31-42 | app/Controller/Admin/Api/Card.php:239-257 | app/Controller/Admin/Api/Cash.php:36-48 | app/Controller/Admin/Api/Coupon.php:233-246 — 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/Controller/User/Api/Security.php:327 — app/Controller/User/Api/Security.php:327-356 | app/Controller/User/Api/Security.php:366-388 | app/Controller/User/Api/Security.php:398-415 | app/Controller/User/Api/Security.php:449-466 — 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 · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) app/Controller/Admin/Api/Card.php:368 — app/Controller/Admin/Api/Card.php:368-394 | app/Controller/User/Api/Card.php:114-140 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 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/User/Api/Card.php:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) app/Controller/Admin/Api/Order.php:141 — app/Controller/Admin/Api/Order.php:141-167 | 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 14 separate duplicated blocks between them, totalling at least 245 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:141` 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/Service/Bind/Order.php:290 — app/Service/Bind/Order.php:290-316 | app/Service/Bind/Order.php:1385-1411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/Service/Bind/Order.php:287` calls `JSONException` and `app/Service/Bind/Order.php:1382` 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:99 — app/Controller/Admin/Api/BusinessLevel.php:99-122 | app/Controller/Admin/Api/Group.php:93-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 5 separate duplicated blocks between them, totalling at least 98 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:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) app/Controller/Admin/Api/Card.php:343 — app/Controller/Admin/Api/Card.php:343-366 | app/Controller/User/Api/Card.php:88-111 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 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:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (24 lines × 2) app/Controller/Admin/Api/Coupon.php:358 — app/Controller/Admin/Api/Coupon.php:358-381 | app/Controller/User/Api/Coupon.php:156-179 — before extracting anything, compare `app/Controller/Admin/Api/Coupon.php` and `app/Controller/User/Api/Coupon.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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/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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) app/Controller/Admin/Api/Card.php:81 — app/Controller/Admin/Api/Card.php:81-89 | 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 (9–10 lines × 2) app/Controller/User/Api/Master.php:296 — app/Controller/User/Api/Master.php:296-305 | app/Controller/User/Api/Master.php:341-349 — both copies are in the same file, so extract the 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/Master.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.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×3
  • 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:43 — assets/admin/controller/trade/card.js:43 · 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.5 · ×2
  • Low contrast colour pair in CSS (1.5:1) assets/common/js/layui/css/layui.css:1 — `.layui-form-checkbox>div` sets color: #fff on background-color: #d2d2d2 — 1.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from).
  • Low contrast colour pair in CSS (1.5:1) assets/common/css/_.css:1 — `.layui-form-checkbox>div` sets color: #fff on background-color: #d2d2d2 — 1.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from).
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.5 · ×2
  • Low contrast colour pair in CSS (2.5:1) assets/common/js/docsify/themes/vue.css:575 — `section.cover .cover-main > p:last-child a:last-child` sets color: #fff on background-color: #42b983 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (2.5:1) assets/common/js/docsify/lib/themes/vue.css:1 — `section.cover .cover-main>p:last-child a:last-child` sets color: #fff on background-color: #42b983 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. This is a MINIFIED, build-generated sheet — editing the literal here is undone by the next vendor drop or rebuild, so override the rule in your own stylesheet (or fix it upstream / in the source the bundle is built from).
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 23) · ×2
  • (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.
D1 · Cyclomatic Complexity · Card.save (cyclomatic 20) · ×2
  • Card.save (cyclomatic 20) app/Controller/Admin/Api/Card.php:334 — Card.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.
  • Card.save (cyclomatic 20) app/Controller/User/Api/Card.php:75 — Card.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.
D1 · Cyclomatic Complexity · click (cyclomatic 20) · ×2
  • 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.
  • 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.
D2 · Cognitive Complexity · click (cognitive 17) · ×2
  • 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. Most of this is not in the body itself: 0 of the 17 points are its own statements 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 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.
  • 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. Most of this is not in the body itself: 0 of the 17 points are its own statements 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 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.
D2 · Cognitive Complexity · setupSheetDrag · ×2
  • setupSheetDrag::pointerDown (cognitive 16) assets/admin/js/mobile/overlay.js: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.
  • setupSheetDrag::pointerEnd (cognitive 16) assets/admin/js/mobile/overlay.js:784 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:43 — app/Controller/Admin/Api/BusinessLevel.php:43-62 | 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 5 separate duplicated blocks between them, totalling at least 98 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:43` 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.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) app/Controller/Admin/Api/Pay.php:569 — app/Controller/Admin/Api/Pay.php:569-584 | app/Controller/Admin/Api/Plugin.php:81-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16–18 lines × 2) app/Util/CallbackIpWhitelist.php:246 — app/Util/CallbackIpWhitelist.php:246-263 | app/Util/Client.php:389-404 — 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 · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) app/Controller/Admin/Api/Order.php:605 — app/Controller/Admin/Api/Order.php:605-619 | app/Controller/Admin/Api/RechargeOrder.php:511-525 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 245 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:605` 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 (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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • 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/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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) app/Controller/Admin/Api/User.php:41 — app/Controller/Admin/Api/User.php:41-50 | app/Controller/Admin/Api/User.php:90-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×2
  • Duplicated block (8–9 lines × 3) app/Controller/Admin/Api/Card.php:687 — app/Controller/Admin/Api/Card.php:687-694 | app/Controller/Admin/Api/Card.php:738-745 | app/Controller/Admin/Api/Order.php:179-187 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) app/Controller/User/Api/Authentication.php:202 — app/Controller/User/Api/Authentication.php:202-208 | app/Controller/User/Api/Authentication.php:227-233 | app/Controller/User/Api/Security.php:232-238 — 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:272 — app/Controller/User/Api/Authentication.php:272-278 | app/Controller/User/Api/Authentication.php:298-304 | app/Controller/User/Api/Security.php:253-259 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×2
  • 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. 2 of the 2 files that make outbound calls are unbounded; the first 2 are listed.
  • 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.
R10 · Code Duplication · Duplicated block (55 lines × 2 locations) · ×2
  • Duplicated block (55 lines × 2 locations) assets/admin/controller/trade/commodity.js:294 — assets/admin/controller/trade/commodity.js:294 · 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:375 — assets/admin/controller/trade/commodity.js:375 · 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.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×2
  • 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.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×2
  • Duplicated block (36 lines × 2 locations) assets/admin/controller/store/home.js:1030 — assets/admin/controller/store/home.js:1030 · assets/admin/controller/store/home.js:1323 — 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:214 — assets/static/acg.js:214 · 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.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×2
  • Duplicated block (34 lines × 2 locations) assets/admin/controller/trade/card.js:329 — assets/admin/controller/trade/card.js:329 · assets/admin/controller/trade/coupon.js:451 — 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.
R10 · Code Duplication · Duplicated block (28 lines × 2 locations) · ×2
  • Duplicated block (28 lines × 2 locations) assets/admin/controller/trade/order.js:104 — assets/admin/controller/trade/order.js:104 · 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.
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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.8 · ×1
  • Low contrast colour pair in CSS (1.8:1) assets/static/modules/src/style/authtree/css/auth-skin-universal.css:43 — `.auth-skin-universal .auth-status > .layui-form-checkbox > span` sets color: #FFFFFF on background-color: #ffaaaa !important — 1.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.6 · ×1
  • Low contrast colour pair in CSS (2.6:1) assets/static/css/i.css:1411 — `.anticipation thead th button` sets color: #a3a0a0 on background-color: white — 2.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.6 · ×1
  • Low contrast colour pair in CSS (1.6:1) assets/static/bootstrap-table/css/bootstrap-table.css:343 — `.page-item.active .page-link` sets color: #FFFFFF on background-color: #f7bcda — 1.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.7 · ×1
  • Low contrast colour pair in CSS (2.7:1) assets/common/js/layer/theme/default/layer.css:358 — `.layui-layer-title` sets color: #999 on background-color: #f6f7f9 — 2.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.0 · ×1
  • Low contrast colour pair in CSS (2.0:1) assets/common/css/component.css:2930 — `.update-badge` sets color: #ffffff on background-color: #50CD89 — 2.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 114 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · tree.select.layui.define() (cyclomatic 1045) · ×1
  • 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 190 function literals inside it that branch (lines 2921, 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.
D1 · Cyclomatic Complexity · hex.layui.define() (cyclomatic 268) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.render (cyclomatic 177) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.addEditorMethods (cyclomatic 139) · ×1
  • 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.
D1 · Cyclomatic Complexity · authtree.layui.define() (cyclomatic 133) · ×1
  • 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.
D1 · Cyclomatic Complexity · python.CodeMirror.defineMode("python") (cyclomatic 127) · ×1
  • python.CodeMirror.defineMode("python") (cyclomatic 127) assets/static/codemirror/mode/python/python.js:41 — python.CodeMirror.defineMode("python") has cyclomatic complexity 127 (threshold 15). Of this number, 104 points are the body's own statements and 23 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Order.trade (cyclomatic 125) · ×1
  • Order.trade (cyclomatic 125) app/Service/Bind/Order.php:555 — Order.trade has cyclomatic complexity 125 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · authtree.layui.define() (cyclomatic 124) · ×1
  • 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.
D1 · Cyclomatic Complexity · css.CodeMirror.defineMode("css") (cyclomatic 114) · ×1
  • 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.
D1 · Cyclomatic Complexity · KTMenu (cyclomatic 109) · ×1
  • KTMenu (cyclomatic 109) assets/admin/js/menu.js: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.
D1 · Cyclomatic Complexity · commodity (cyclomatic 101) · ×1
  • commodity (cyclomatic 101) assets/static/acg.js:502 — commodity has cyclomatic complexity 101 (threshold 15). Most of this is not in the body itself: 1 of the 101 points is its own statement and the rest belongs to 14 function items inside it that branch (a function literal at line 505, a function literal at line 763, (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.
D1 · Cyclomatic Complexity · popup (cyclomatic 99) · ×1
  • 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.
D1 · Cyclomatic Complexity · _ThemeSetting (cyclomatic 76) · ×1
  • _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.
D1 · Cyclomatic Complexity · register (cyclomatic 74) · ×1
  • 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.
D1 · Cyclomatic Complexity · Commodity.save (cyclomatic 73) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 73) · ×1
  • (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.
D1 · Cyclomatic Complexity · store.mountRemoteProductPicker (cyclomatic 71) · ×1
  • store.mountRemoteProductPicker (cyclomatic 71) assets/admin/controller/shared/store.js:349 — store.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 23 function literals inside it that branch (lines 662, 540, 619, …). 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.
D1 · Cyclomatic Complexity · fallback.renderToolbar (cyclomatic 71) · ×1
  • 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.
D1 · Cyclomatic Complexity · #getPreprocessColumn (cyclomatic 71) · ×1
  • #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.
D1 · Cyclomatic Complexity · done (cyclomatic 67) · ×1
  • done (cyclomatic 67) assets/admin/controller/store/home.js:1070 — 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 51 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.
D1 · Cyclomatic Complexity · Order.valuation (cyclomatic 64) · ×1
  • Order.valuation (cyclomatic 64) app/Service/Bind/Order.php:147 — Order.valuation has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manage.save (cyclomatic 62) · ×1
  • 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.
D1 · Cyclomatic Complexity · Commodity.save (cyclomatic 60) · ×1
  • Commodity.save (cyclomatic 60) app/Controller/Admin/Api/Commodity.php:382 — 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.
D1 · Cyclomatic Complexity · CommodityGroupModal (cyclomatic 60) · ×1
  • 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.
D1 · Cyclomatic Complexity · presentPopup (cyclomatic 57) · ×1
  • presentPopup (cyclomatic 57) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · codemirror.insertLineContent (cyclomatic 56) · ×1
  • 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.
D1 · Cyclomatic Complexity · overlay.setupSheetDrag (cyclomatic 53) · ×1
  • overlay.setupSheetDrag (cyclomatic 53) assets/admin/js/mobile/overlay.js:699 — overlay.setupSheetDrag has cyclomatic complexity 53 (threshold 15). Of this number, 49 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · Pay.paymentSaveMap (cyclomatic 53) · ×1
  • Pay.paymentSaveMap (cyclomatic 53) app/Controller/Admin/Api/Pay.php:139 — Pay.paymentSaveMap 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.
D1 · Cyclomatic Complexity · codemirror.drawSelectionRange (cyclomatic 52) · ×1
  • 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: 14 of the 52 points are its own statements and the rest belongs to one function literal inside it that branches (line 3232). 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.
D1 · Cyclomatic Complexity · createCoupon (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.openFilters (cyclomatic 49) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · BusinessLevel.validatedSaveMap (cyclomatic 49) · ×1
  • BusinessLevel.validatedSaveMap (cyclomatic 49) app/Controller/Admin/Api/BusinessLevel.php:40 — 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.
D1 · Cyclomatic Complexity · Order.getTradeAmount (cyclomatic 49) · ×1
  • Order.getTradeAmount (cyclomatic 49) app/Service/Bind/Order.php:1283 — Order.getTradeAmount 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.
D1 · Cyclomatic Complexity · User.save (cyclomatic 48) · ×1
  • User.save (cyclomatic 48) app/Controller/Admin/Api/User.php:84 — User.save has cyclomatic complexity 48 (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.
D1 · Cyclomatic Complexity · _Auth (cyclomatic 47) · ×1
  • _Auth (cyclomatic 47) assets/admin/controller/store/home.js:498 — _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 676, …). 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.
D1 · Cyclomatic Complexity · menu.KTScroll (cyclomatic 45) · ×1
  • menu.KTScroll (cyclomatic 45) assets/admin/js/menu.js:2782 — menu.KTScroll 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 9 function literals inside it that branch (lines 2896, 2978, 2840, …). 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.
D1 · Cyclomatic Complexity · click (cyclomatic 45) · ×1
  • click (cyclomatic 45) assets/admin/controller/shared/store.js:1437 — 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 1445, a function literal at line 1478, a function literal at line 1507, …). 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.
D1 · Cyclomatic Complexity · api.confirmPayDelete (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · Util.redactDebugValue (cyclomatic 44) · ×1
  • Util.redactDebugValue (cyclomatic 44) assets/common/js/util.js:112 — Util.redactDebugValue has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 2 of the 44 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 158, 123, 210, …). 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.
D1 · Cyclomatic Complexity · codemirror.markText (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · Store.addItem (cyclomatic 44) · ×1
  • Store.addItem (cyclomatic 44) app/Controller/Admin/Api/Store.php:1081 — Store.addItem has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous).attach.openMenu (cyclomatic 44) · ×1
  • (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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").tokenBase (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).tokenBase (cyclomatic 43) · ×1
  • (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.
D1 · Cyclomatic Complexity · Group.validatedSaveMap (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · modal (cyclomatic 42) · ×1
  • modal (cyclomatic 42) assets/admin/controller/trade/commodity.js:123 — 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 523, complete::(anonymous)::change, a function literal at line 131, …). 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.
D1 · Cyclomatic Complexity · codemirror.findPosH (cyclomatic 41) · ×1
  • codemirror.findPosH (cyclomatic 41) assets/static/codemirror/lib/codemirror.js:8708 — codemirror.findPosH has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 41) · ×1
  • (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.
D1 · Cyclomatic Complexity · #createOptions (cyclomatic 41) · ×1
  • #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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").statement (cyclomatic 40) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).statement (cyclomatic 40) · ×1
  • (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.
D1 · Cyclomatic Complexity · workflows.renderPageActions (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · Category.save (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · jquery.pjax.pjax (cyclomatic 38) · ×1
  • jquery.pjax.pjax (cyclomatic 38) assets/static/jquery.pjax.js:166 — jquery.pjax.pjax has cyclomatic complexity 38 (threshold 15). Of this number, 17 points are the body's own statements and 21 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.
D1 · Cyclomatic Complexity · workflows.syncSettingsNavigation (cyclomatic 37) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · codemirror.moveVisually (cyclomatic 37) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").indent (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · ticket.detail.renderRelated (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · glass.refreshMessageCenter (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · confirmPayDelete · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).indent (cyclomatic 36) · ×1
  • (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.
D1 · Cyclomatic Complexity · fallback.renderTreeContext (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.measureCharInner (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · Image.createThumbnail (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.renderSelectionDock (cyclomatic 34) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · overlay.focusInvalid (cyclomatic 34) · ×1
  • overlay.focusInvalid (cyclomatic 34) assets/admin/js/mobile/overlay.js: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 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.
D1 · Cyclomatic Complexity · Form.constructor (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.onScrollWheel (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · CommodityGroup.mobileCommodityTree (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · Coupon.couponExportQuery (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · message.openComposer (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.leftButtonSelect (cyclomatic 33) · ×1
  • codemirror.leftButtonSelect (cyclomatic 33) assets/static/codemirror/lib/codemirror.js:7475 — codemirror.leftButtonSelect has cyclomatic complexity 33 (threshold 15). Of this number, 29 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · Authentication.register (cyclomatic 33) · ×1
  • Authentication.register (cyclomatic 33) app/Controller/User/Api/Authentication.php:45 — Authentication.register 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.
D1 · Cyclomatic Complexity · refreshMessageCenter · ×1
  • 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.
D1 · Cyclomatic Complexity · order.$(".btn-app-export").off().on() (cyclomatic 32) · ×1
  • order.$(".btn-app-export").off().on() (cyclomatic 32) assets/admin/controller/trade/order.js:478 — 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 520, 563). 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.
D1 · Cyclomatic Complexity · Form.getData (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.stretchSpansOverChange (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.buildToken (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.registerEventHandlers (cyclomatic 32) · ×1
  • 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: 7 of the 32 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 8018, 8002, 7965, …). 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.
D1 · Cyclomatic Complexity · codemirror.ContentEditableInput.pollContent (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · Coupon.save (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · Manage.set (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · recharge.order.$(".btn-app-export").off().on() (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · Component.previewMessage (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.skipAtomicInner (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · Message.save (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · mobileAccountSubmit (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · click (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).attach.onKey (cyclomatic 31) · ×1
  • (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.
D1 · Cyclomatic Complexity · fallback.renderReferenceCard (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.TextMarker.clear (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · Order.orderExportQuery (cyclomatic 30) · ×1
  • Order.orderExportQuery (cyclomatic 30) app/Controller/Admin/Api/Order.php:67 — 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.
D1 · Cyclomatic Complexity · Index.commodity (cyclomatic 30) · ×1
  • Index.commodity (cyclomatic 30) app/Controller/User/Api/Index.php:67 — 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.
D1 · Cyclomatic Complexity · PriceTemplate.applyToConfig (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · ready.flushReadyQueue (cyclomatic 29) · ×1
  • 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 literals inside it that branch (lines 139, 95, 86, …). 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.
D1 · Cyclomatic Complexity · Query.get (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · addWidget (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · mobileDeliverySubmit (cyclomatic 29) · ×1
  • mobileDeliverySubmit (cyclomatic 29) assets/admin/controller/trade/order.js:63 — 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 66, a function literal at line 104, (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.
D1 · Cyclomatic Complexity · done (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · applyModal (cyclomatic 29) · ×1
  • applyModal (cyclomatic 29) assets/admin/controller/shared/priceTemplate.js:194 — applyModal 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 7 function items inside it that branch (a function literal at line 240, a function literal at line 260, a function literal at line 312, …). 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.
D1 · Cyclomatic Complexity · workflows.invalidFormField (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.makeChangeFromHistory (cyclomatic 28) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · codemirror.applyTextInput (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.locateNodeInLineView (cyclomatic 28) · ×1
  • codemirror.locateNodeInLineView (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:9280 — codemirror.locateNodeInLineView 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.
D1 · Cyclomatic Complexity · codemirror.TextareaInput.onContextMenu (cyclomatic 28) · ×1
  • codemirror.TextareaInput.onContextMenu (cyclomatic 28) assets/static/codemirror/lib/codemirror.js:9608 — codemirror.TextareaInput.onContextMenu has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · xml.CodeMirror.defineMode("xml").indent (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · Category.save (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).indent (cyclomatic 28) · ×1
  • (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.
D1 · Cyclomatic Complexity · codemirror.updateDisplayIfNeeded (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · css.CodeMirror.defineMode("css").tokenBase (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · runImportTask (cyclomatic 27) · ×1
  • runImportTask (cyclomatic 27) assets/admin/controller/shared/store.js:1030 — 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 1046, 1115, 1127, …). 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.
D1 · Cyclomatic Complexity · click (cyclomatic 27) · ×1
  • click (cyclomatic 27) assets/admin/controller/shared/store.js:1561 — 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 1637, (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.
D1 · Cyclomatic Complexity · (anonymous).tokenBase (cyclomatic 27) · ×1
  • (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.
D1 · Cyclomatic Complexity · index.renderChart (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · card.$(".btn-app-export").off().on() (cyclomatic 26) · ×1
  • card.$(".btn-app-export").off().on() (cyclomatic 26) assets/admin/controller/trade/card.js:591 — 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 636, 663). 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.
D1 · Cyclomatic Complexity · menu.KTDrawer (cyclomatic 26) · ×1
  • menu.KTDrawer (cyclomatic 26) assets/admin/js/menu.js: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 literals inside it that branch (lines 3451, 3322, 3400, …). 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.
D1 · Cyclomatic Complexity · fallback.treeMetadata (cyclomatic 26) · ×1
  • fallback.treeMetadata (cyclomatic 26) assets/admin/js/mobile/fallback.js:2547 — fallback.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 5 function literals inside it that branch (lines 2556, 2587, 2582, …). 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.
D1 · Cyclomatic Complexity · codemirror.ContentEditableInput.showPrimarySelection (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.TextareaInput.poll (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · message.normalizeMessage (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · glass.normalizeMessage (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · RechargeOrder.exportQuery (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · Store.remoteWidget (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · Email.sendRecipients (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · Order.calcAmount (cyclomatic 26) · ×1
  • Order.calcAmount (cyclomatic 26) app/Service/Bind/Order.php:75 — 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.
D1 · Cyclomatic Complexity · set.saveSettings (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · message.validateCompose (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.detailContent (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.regChange (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · passkey.add (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · message.renderCartoonMobile (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · Store.sharedDomain (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · Shared.syncRemoteItem (cyclomatic 25) · ×1
  • Shared.syncRemoteItem (cyclomatic 25) app/Service/Bind/Shared.php:852 — Shared.syncRemoteItem 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.
D1 · Cyclomatic Complexity · (anonymous).attach (cyclomatic 25) · ×1
  • (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.
D1 · Cyclomatic Complexity · _Save (cyclomatic 25) · ×1
  • _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.
D1 · Cyclomatic Complexity · Install.html.renderDbResult (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · store.fitImportPopupHeight (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · home._Bill (cyclomatic 24) · ×1
  • home._Bill (cyclomatic 24) assets/admin/controller/store/home.js:809 — 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 862, 882, 910, …). 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.
D1 · Cyclomatic Complexity · navigation.menuContent (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · Form.destroy (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.onKeyDown (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · comment-fold.CodeMirror.registerGlobalHelper("fold","comment") (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · User.theme (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · Shared.AdjustmentPrice (cyclomatic 24) · ×1
  • Shared.AdjustmentPrice (cyclomatic 24) app/Service/Bind/Shared.php:711 — 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.
D1 · Cyclomatic Complexity · UploadPurge.stageForDeletion (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · #getSelectionRowState (cyclomatic 24) · ×1
  • #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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 24) · ×1
  • (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.
D1 · Cyclomatic Complexity · index.confirmFileDelete (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.renderCardSubtitle (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.cardActionIcon (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · overlay.handleNavigationClick (cyclomatic 23) · ×1
  • overlay.handleNavigationClick (cyclomatic 23) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · codemirror.buildLineContent (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.onDrop (cyclomatic 23) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · codemirror.indentLine (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · brace-fold.CodeMirror.registerHelper("fold","brace") (cyclomatic 23) · ×1
  • 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). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").findFatArrow (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · Store.save (cyclomatic 23) · ×1
  • Store.save (cyclomatic 23) app/Controller/Admin/Api/Store.php:889 — Store.save 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.
D1 · Cyclomatic Complexity · Config.putManyLocked (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · armAutofill (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · modal (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).findFatArrow (cyclomatic 23) · ×1
  • (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.
D1 · Cyclomatic Complexity · Install.html.renderDb (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · index.renderChannels (cyclomatic 22) · ×1
  • 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 literals inside it that branch (lines 573, 618). 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.
D1 · Cyclomatic Complexity · coupon.$(".btn-app-export").off().on() (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.controlAvailable (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.markSemanticPage (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.syncContextNavigation (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.discoverActions (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · Util.post (cyclomatic 22) · ×1
  • Util.post (cyclomatic 22) assets/common/js/util.js:241 — Util.post has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · codemirror.nodeAndOffsetInLineMap (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.defineOptions (cyclomatic 22) · ×1
  • 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: 4 of the 22 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 7774, 7739, 7743, …). 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.
D1 · Cyclomatic Complexity · codemirror.CodeMirror (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").expressionInner (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ticket.detail.sanitizeHtml (cyclomatic 22) · ×1
  • 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 literals inside it that branch (lines 56, 71, 47). 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.
D1 · Cyclomatic Complexity · Category.safeCategoryDeleteImpact (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · Config.emailFailureMessage (cyclomatic 22) · ×1
  • Config.emailFailureMessage (cyclomatic 22) REDACTED:1338 — 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.
D1 · Cyclomatic Complexity · App.updatePlugin (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · Currency.convertAll (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 22) · ×1
  • (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.
D1 · Cyclomatic Complexity · normalizeImportRequest (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · configureShell (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).expressionInner (cyclomatic 22) · ×1
  • (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.
D1 · Cyclomatic Complexity · api.showTestResult (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · store.modal (cyclomatic 21) · ×1
  • store.modal (cyclomatic 21) assets/admin/controller/shared/store.js:1272 — store.modal has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1293, 1287, 1299, …). 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.
D1 · Cyclomatic Complexity · commodity.confirmCommodityDelete (cyclomatic 21) · ×1
  • commodity.confirmCommodityDelete (cyclomatic 21) assets/admin/controller/trade/commodity.js:73 — 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 78, 119, 120). 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.
D1 · Cyclomatic Complexity · menu.KTMenu.initGlobalHandlers (cyclomatic 21) · ×1
  • menu.KTMenu.initGlobalHandlers (cyclomatic 21) assets/admin/js/menu.js: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.
D1 · Cyclomatic Complexity · fallback.renderLedgerCard (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.definitionValue (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.visible (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ready.bind (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.coordsCharInner (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.highlightWorker (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.ContentEditableInput.init (cyclomatic 21) · ×1
  • codemirror.ContentEditableInput.init (cyclomatic 21) assets/static/codemirror/lib/codemirror.js:8808 — codemirror.ContentEditableInput.init has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").classBody (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · User.changeAccountBalance (cyclomatic 21) · ×1
  • User.changeAccountBalance (cyclomatic 21) app/Controller/Admin/Api/User.php:279 — 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.
D1 · Cyclomatic Complexity · Cash.submit (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · Shop.getItem (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · SharedCurrency.config (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · KTUtil.slide (cyclomatic 21) · ×1
  • KTUtil.slide (cyclomatic 21) assets/admin/js/menu.js: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.
D1 · Cyclomatic Complexity · #openColumnDetail (cyclomatic 21) · ×1
  • #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.
D1 · Cyclomatic Complexity · (anonymous).maybeoperatorNoComma (cyclomatic 21) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).classBody (cyclomatic 21) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).atBlock (cyclomatic 21) · ×1
  • (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.
D1 · Cyclomatic Complexity · coupon.confirmCouponDelete (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.relativeTimeTimestamp (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.configureShellSearch (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.cardOfferContent (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · overlay.closeTransientInput (cyclomatic 20) · ×1
  • overlay.closeTransientInput (cyclomatic 20) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · viewport.updateViewportVars (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · viewport.keepPageFieldVisible (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.bidiSimplify (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Panel.save (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Card.edit (cyclomatic 20) · ×1
  • Card.edit (cyclomatic 20) app/Controller/Admin/Api/Card.php:448 — Card.edit 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.
D1 · Cyclomatic Complexity · Commodity.commodityDeleteImpact (cyclomatic 20) · ×1
  • Commodity.commodityDeleteImpact (cyclomatic 20) app/Controller/Admin/Api/Commodity.php:140 — 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.
D1 · Cyclomatic Complexity · Config.consumeTestSendQuota (cyclomatic 20) · ×1
  • Config.consumeTestSendQuota (cyclomatic 20) REDACTED:579 — 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.
D1 · Cyclomatic Complexity · RechargeOrder.verifyExportToken (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Coupon.save (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Index.card (cyclomatic 20) · ×1
  • Index.card (cyclomatic 20) app/Controller/User/Api/Index.php:292 — Index.card 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.
D1 · Cyclomatic Complexity · Order.callbackTest (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Message.cleanContent (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Order.getCost (cyclomatic 20) · ×1
  • Order.getCost (cyclomatic 20) app/Service/Bind/Order.php:329 — Order.getCost 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.
D1 · Cyclomatic Complexity · Query.save (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · redactDebugValue · ×1
  • redactDebugValue::clone (cyclomatic 20) assets/common/js/util.js:158 — 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.
D1 · Cyclomatic Complexity · sanitizeInlineHtml (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).attach (cyclomatic 20) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).attach.openActions (cyclomatic 20) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).confirmDelete (cyclomatic 20) · ×1
  • (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.
D1 · Cyclomatic Complexity · normalizeRemoteProductGroups (cyclomatic 20) · ×1
  • normalizeRemoteProductGroups (cyclomatic 20) assets/admin/controller/shared/store.js:304 — 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 317, 311). 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.
D1 · Cyclomatic Complexity · modal (cyclomatic 20) · ×1
  • modal (cyclomatic 20) assets/admin/controller/pay/api.js:496 — modal has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 8 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.
D1 · Cyclomatic Complexity · sanitizePluginDisplayHtml (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · other.$("#currency-convert-btn").off().on() (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.mount (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.conflictingCollapsedRange (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.calculateScrollPos (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.onMouseDown (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.domTextBetween (cyclomatic 19) · ×1
  • codemirror.domTextBetween (cyclomatic 19) assets/static/codemirror/lib/codemirror.js:9208 — codemirror.domTextBetween 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").objprop (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Panel.render (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · recharge.updateSummary (cyclomatic 19) · ×1
  • recharge.updateSummary (cyclomatic 19) assets/user/controller/user/recharge.js:29 — recharge.updateSummary 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.
D1 · Cyclomatic Complexity · Card.cardExportQuery (cyclomatic 19) · ×1
  • Card.cardExportQuery (cyclomatic 19) app/Controller/Admin/Api/Card.php:145 — 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.
D1 · Cyclomatic Complexity · Order.verifyOrderExportToken (cyclomatic 19) · ×1
  • Order.verifyOrderExportToken (cyclomatic 19) app/Controller/Admin/Api/Order.php:273 — 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.
D1 · Cyclomatic Complexity · Pay.paymentDeleteImpact (cyclomatic 19) · ×1
  • Pay.paymentDeleteImpact (cyclomatic 19) app/Controller/Admin/Api/Pay.php:289 — 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.
D1 · Cyclomatic Complexity · CommodityOrder.data (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Image.downloadRemoteImage (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Message.siteBaseUrl (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Order.orderSuccess (cyclomatic 19) · ×1
  • Order.orderSuccess (cyclomatic 19) app/Service/Bind/Order.php:1070 — Order.orderSuccess 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.
D1 · Cyclomatic Complexity · Ticket.normalizeTicket (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Ticket.cleanContent (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · UploadPurge.inspectUploadPath (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · GridTracks.track (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · sanitizeRichHtml (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · alignReferenceCards (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · requestAudienceCount (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).attach.onMobilePointerDown (cyclomatic 19) · ×1
  • (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.
D1 · Cyclomatic Complexity · normalizeImportTask (cyclomatic 19) · ×1
  • normalizeImportTask (cyclomatic 19) assets/admin/controller/shared/store.js:729 — 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 19) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).objprop (cyclomatic 19) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).top (cyclomatic 19) · ×1
  • (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.
D1 · Cyclomatic Complexity · home.requestPurchase (cyclomatic 18) · ×1
  • 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 literals inside it that branch (lines 299, 289, 310, …). 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.
D1 · Cyclomatic Complexity · ticket.sanitizeRichHtml (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.cardSubtitle (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.updateTreeCollapsePresentation (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · overlay.setupDirtyTracking (cyclomatic 18) · ×1
  • overlay.setupDirtyTracking (cyclomatic 18) assets/admin/js/mobile/overlay.js: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 literals inside it that branch (lines 514, 541, 519, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · overlay.openActions (cyclomatic 18) · ×1
  • overlay.openActions (cyclomatic 18) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · Form.disposeControl (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · editorv2.register.destroy (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.removeReadOnlyRanges (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.endOperation_finish (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.onKeyPress (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.TextareaInput.init (cyclomatic 18) · ×1
  • 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: 7 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 9365, 9399, 9370, …). 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.
D1 · Cyclomatic Complexity · javascript.CodeMirror.defineMode("javascript").typeexpr (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ticket.create.updateSummary (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ticket.create.submitTicket (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Category.verifyCategoryDeleteToken (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Config.security (cyclomatic 18) · ×1
  • Config.security (cyclomatic 18) REDACTED:714 — 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.
D1 · Cyclomatic Complexity · PriceTemplate.computePrice (cyclomatic 18) · ×1
  • PriceTemplate.computePrice (cyclomatic 18) app/Controller/Admin/Api/PriceTemplate.php:297 — 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.
D1 · Cyclomatic Complexity · Pay.savePluginConfig (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Shop.substationPriceIncrease (cyclomatic 18) · ×1
  • Shop.substationPriceIncrease (cyclomatic 18) app/Service/Bind/Shop.php:374 — 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.
D1 · Cyclomatic Complexity · CategoryTree.forAdmin (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · PluginPacker.pack (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Waf.wafPost (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · KTScroll · ×1
  • KTScroll::_getAutoHeight (cyclomatic 18) assets/admin/js/menu.js:2896 — 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.
D1 · Cyclomatic Complexity · #mobileDisplayValue (cyclomatic 18) · ×1
  • #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.
D1 · Cyclomatic Complexity · setupSheetDrag · ×1
  • setupSheetDrag::pointerDown (cyclomatic 18) assets/admin/js/mobile/overlay.js:745 — 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.
D1 · Cyclomatic Complexity · renderToolbar · ×1
  • 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.
D1 · Cyclomatic Complexity · click (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).attach.nodesHtml (cyclomatic 18) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).typeexpr (cyclomatic 18) · ×1
  • (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.
D1 · Cyclomatic Complexity · register.destroy (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · google2fa.$("#g2fa-bind-btn").off().on() (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · wiki.mobile.destroy (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · store.importTaskLogText (cyclomatic 17) · ×1
  • store.importTaskLogText (cyclomatic 17) assets/admin/controller/shared/store.js:821 — 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 823). 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.
D1 · Cyclomatic Complexity · ticket.pollMessages (cyclomatic 17) · ×1
  • 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 literals inside it that branch (lines 525, 510). 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.
D1 · Cyclomatic Complexity · ticket.sendReply (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.compactCardDefinitions (cyclomatic 17) · ×1
  • 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 literal inside it that branches (line 335). 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.
D1 · Cyclomatic Complexity · fallback.renderTreeToggle (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.rebuild (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · overlay.api.closeAll (cyclomatic 17) · ×1
  • overlay.api.closeAll (cyclomatic 17) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · recipes.rechargeOrderSubtitleField (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Search.#setField (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · editorv2.register.sizeImages.text (cyclomatic 17) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · Util.fundVerify (cyclomatic 17) · ×1
  • Util.fundVerify (cyclomatic 17) assets/common/js/util.js:312 — Util.fundVerify has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 371, 389, 416, …). 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.
D1 · Cyclomatic Complexity · css.CodeMirror.defineMode("css").indent (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ticket.create.initRemoteSelect (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · glass.initMessageCenter (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · glass.initTheme (cyclomatic 17) · ×1
  • glass.initTheme (cyclomatic 17) assets/user/js/glass.js:503 — glass.initTheme 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.
D1 · Cyclomatic Complexity · Category.status (cyclomatic 17) · ×1
  • Category.status (cyclomatic 17) app/Controller/Admin/Api/Category.php:706 — 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.
D1 · Cyclomatic Complexity · Config.configHttpUrl (cyclomatic 17) · ×1
  • Config.configHttpUrl (cyclomatic 17) REDACTED:408 — 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.
D1 · Cyclomatic Complexity · Master.setCommodity (cyclomatic 17) · ×1
  • Master.setCommodity (cyclomatic 17) app/Controller/User/Api/Master.php:196 — 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.
D1 · Cyclomatic Complexity · Currency.convertCommodityConfigs (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Recharge.trade (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Shop.getCategory (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Ticket.applyFilters (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Ticket.delete (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Csp.deriveSource (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Lang.collect (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Lang.transObjectList (cyclomatic 17) · ×1
  • Lang.transObjectList (cyclomatic 17) kernel/Util/Lang.php:1051 — 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.
D1 · Cyclomatic Complexity · Shadow.layer (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · openSheet (cyclomatic 17) · ×1
  • openSheet (cyclomatic 17) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · copyConfiguredField (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous).attach.groupBlocks (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · confirmCommodityDelete · ×1
  • confirmCommodityDelete::done (cyclomatic 17) assets/admin/controller/trade/commodity.js:78 — 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.
D1 · Cyclomatic Complexity · (anonymous).attach.treeHtml (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).attach.endDrag (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).attach.bindHost (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · importItemRequest (cyclomatic 17) · ×1
  • importItemRequest (cyclomatic 17) assets/admin/controller/shared/store.js:949 — 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 965, 949, 998). 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.
D1 · Cyclomatic Complexity · renderConfigForm (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).indent (cyclomatic 17) · ×1
  • (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.
D1 · Cyclomatic Complexity · register.sizeImages (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Install.html.testDb (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.sanitizeTree (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · fallback.inlineInputEditor (cyclomatic 16) · ×1
  • 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 literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: 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.
D1 · Cyclomatic Complexity · navigation.handleClick (cyclomatic 16) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · overlay.finalize (cyclomatic 16) · ×1
  • overlay.finalize (cyclomatic 16) assets/admin/js/mobile/overlay.js: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 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.
D1 · Cyclomatic Complexity · overlay.firstInvalidField (cyclomatic 16) · ×1
  • overlay.firstInvalidField (cyclomatic 16) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · overlay.handleKey (cyclomatic 16) · ×1
  • overlay.handleKey (cyclomatic 16) assets/admin/js/mobile/overlay.js: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.
D1 · Cyclomatic Complexity · workflows.cloneLabel (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflows.addPageFormGuard (cyclomatic 16) · ×1
  • 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 literals inside it that branch (lines 507, 530, 516, …). 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.
D1 · Cyclomatic Complexity · codemirror.updateLineGutter (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.patchDisplay (cyclomatic 16) · ×1
  • codemirror.patchDisplay (cyclomatic 16) assets/static/codemirror/lib/codemirror.js:4225 — codemirror.patchDisplay 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.
D1 · Cyclomatic Complexity · codemirror.addChangeToHistory (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · codemirror.makeChangeSingleDocInEditor (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · foldcode.doFold (cyclomatic 16) · ×1
  • foldcode.doFold (cyclomatic 16) assets/static/codemirror/addon/fold/foldcode.js:14 — foldcode.doFold 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.
D1 · Cyclomatic Complexity · foldgutter.updateFoldInfo (cyclomatic 16) · ×1
  • foldgutter.updateFoldInfo (cyclomatic 16) assets/static/codemirror/addon/fold/foldgutter.js: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.
D1 · Cyclomatic Complexity · xml.CodeMirror.defineMode("xml").inText (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · App.plugins (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Commodity.reorder (cyclomatic 16) · ×1
  • Commodity.reorder (cyclomatic 16) app/Controller/Admin/Api/Commodity.php:701 — 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.
D1 · Cyclomatic Complexity · Plugin.wikiRes (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Authentication.password (cyclomatic 16) · ×1
  • Authentication.password (cyclomatic 16) app/Controller/User/Api/Authentication.php:536 — 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.
D1 · Cyclomatic Complexity · Currency.convertIniMoney (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Message.sendEmailBatch (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Ticket.visibleCommodityQuery (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Helper.isInstall (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Plugin.hook (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · registerUserPicker (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 16) · ×1
  • (anonymous) (cyclomatic 16) assets/admin/controller/trade/commodity.js:1331 — (anonymous) 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 8 function items inside it that branch (a function literal at line 1359, submitMobileBatchSettings, a function literal at line 1343, …). 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.
D1 · Cyclomatic Complexity · (anonymous).openEditor (cyclomatic 16) · ×1
  • (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.
D1 · Cyclomatic Complexity · (anonymous).inText (cyclomatic 16) · ×1
  • (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.
D2 · Cognitive Complexity · tree.select.layui.define() (cognitive 1209) · ×1
  • 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 190 function literals inside it that branch (lines 2921, 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.
D2 · Cognitive Complexity · commodity (cognitive 303) · ×1
  • commodity (cognitive 303) assets/static/acg.js:502 — commodity has cognitive complexity 303 (threshold 15). Drivers by points: if/else 75 (197 pts), loops 10 (54 pts), ternaries 6 (34 pts), boolean chains 18 (nesting depth added 194). Most of this is not in the body itself: 0 of the 303 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 505, a function literal at line 763, (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.
D2 · Cognitive Complexity · hex.layui.define() (cognitive 235) · ×1
  • 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.
D2 · Cognitive Complexity · Order.trade (cognitive 194) · ×1
  • Order.trade (cognitive 194) app/Service/Bind/Order.php:555 — Order.trade has cognitive complexity 194 (threshold 15). Drivers by points: if/else 88 (141 pts), boolean chains 33, ternaries 7 (12 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 63). To reduce it, split the body into named stages: move each independent 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 · render (cognitive 177) · ×1
  • 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.
D2 · Cognitive Complexity · python.CodeMirror.defineMode("python") (cognitive 168) · ×1
  • python.CodeMirror.defineMode("python") (cognitive 168) assets/static/codemirror/mode/python/python.js:41 — python.CodeMirror.defineMode("python") has cognitive complexity 168 (threshold 15). Drivers by points: if/else 82 (119 pts), boolean chains 31, ternaries 6 (10 pts), loops 8 (nesting depth added 41). Of this number, 143 points are the body's own statements and 25 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · insertLineContent (cognitive 147) · ×1
  • 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.
D2 · Cognitive Complexity · KTMenu (cognitive 142) · ×1
  • KTMenu (cognitive 142) assets/admin/js/menu.js: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.
D2 · Cognitive Complexity · popup (cognitive 132) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 124) · ×1
  • (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). Most of this is not in the body itself: 0 of the 124 points are its own statements 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.
D2 · Cognitive Complexity · #getPreprocessColumn (cognitive 121) · ×1
  • #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.
D2 · Cognitive Complexity · Order.valuation (cognitive 119) · ×1
  • Order.valuation (cognitive 119) app/Service/Bind/Order.php:147 — Order.valuation has cognitive complexity 119 (threshold 15). Drivers by points: if/else 37 (75 pts), boolean chains 19, loops 5 (14 pts), ternaries 5 (11 pts) (nesting depth added 53). 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 · authtree.layui.define() (cognitive 113) · ×1
  • 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). Most of this is not in the body itself: 0 of the 113 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · skipAtomicInner (cognitive 105) · ×1
  • 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.
D2 · Cognitive Complexity · authtree.layui.define() (cognitive 104) · ×1
  • 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). Most of this is not in the body itself: 0 of the 104 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · CommodityGroupModal (cognitive 103) · ×1
  • 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). Most of this is not in the body itself: 0 of the 103 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · register (cognitive 88) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.save (cognitive 85) · ×1
  • 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.
D2 · Cognitive Complexity · drawSelectionRange (cognitive 81) · ×1
  • 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.
D2 · Cognitive Complexity · _ThemeSetting (cognitive 80) · ×1
  • _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.
D2 · Cognitive Complexity · Commodity.save (cognitive 78) · ×1
  • Commodity.save (cognitive 78) app/Controller/Admin/Api/Commodity.php:382 — 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.
D2 · Cognitive Complexity · mountRemoteProductPicker (cognitive 78) · ×1
  • mountRemoteProductPicker (cognitive 78) assets/admin/controller/shared/store.js:349 — 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.
D2 · Cognitive Complexity · menu.KTScroll (cognitive 77) · ×1
  • menu.KTScroll (cognitive 77) assets/admin/js/menu.js:2782 — menu.KTScroll has cognitive complexity 77 (threshold 15). Drivers by points: if/else 37 (62 pts), boolean chains 9, loops 2 (6 pts) (nesting depth added 29). Most of this is not in the body itself: 1 of the 77 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 2896, 2978, 2840, …). 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.
D2 · Cognitive Complexity · Order.getTradeAmount (cognitive 77) · ×1
  • Order.getTradeAmount (cognitive 77) app/Service/Bind/Order.php:1283 — Order.getTradeAmount has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (53 pts), boolean chains 17, loops 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · coupon.createCoupon (cognitive 71) · ×1
  • 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.
D2 · Cognitive Complexity · Email.sendRecipients (cognitive 70) · ×1
  • 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.
D2 · Cognitive Complexity · Pay.paymentSaveMap (cognitive 69) · ×1
  • Pay.paymentSaveMap (cognitive 69) app/Controller/Admin/Api/Pay.php:139 — Pay.paymentSaveMap has cognitive complexity 69 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 18, loops 3 (4 pts), ternaries 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.
D2 · Cognitive Complexity · codemirror.findPosH (cognitive 68) · ×1
  • codemirror.findPosH (cognitive 68) assets/static/codemirror/lib/codemirror.js:8708 — codemirror.findPosH has cognitive complexity 68 (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.
D2 · Cognitive Complexity · done (cognitive 68) · ×1
  • done (cognitive 68) assets/admin/controller/store/home.js:1070 — 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 51 function items inside it that branch (a function literal at line 1203, 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.
D2 · Cognitive Complexity · Manage.save (cognitive 67) · ×1
  • 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.
D2 · Cognitive Complexity · BusinessLevel.validatedSaveMap (cognitive 64) · ×1
  • BusinessLevel.validatedSaveMap (cognitive 64) app/Controller/Admin/Api/BusinessLevel.php:40 — 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.
D2 · Cognitive Complexity · Store.addItem (cognitive 64) · ×1
  • Store.addItem (cognitive 64) app/Controller/Admin/Api/Store.php:1081 — Store.addItem has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (35 pts), ternaries 7 (13 pts), boolean chains 10, error handling 1 (2 pts), loops 2, match/switch 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.
D2 · Cognitive Complexity · stretchSpansOverChange (cognitive 64) · ×1
  • 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.
D2 · Cognitive Complexity · #createOptions (cognitive 64) · ×1
  • #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.
D2 · Cognitive Complexity · renderToolbar (cognitive 62) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").tokenBase (cognitive 57) · ×1
  • 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.
D2 · Cognitive Complexity · Category.save (cognitive 57) · ×1
  • 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.
D2 · Cognitive Complexity · User.save (cognitive 57) · ×1
  • User.save (cognitive 57) app/Controller/Admin/Api/User.php:84 — User.save has cognitive complexity 57 (threshold 15). Drivers by points: if/else 28 (37 pts), boolean chains 17, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildToken (cognitive 57) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).tokenBase (cognitive 57) · ×1
  • (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.
D2 · Cognitive Complexity · codemirror.leftButtonSelect (cognitive 56) · ×1
  • 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, 47 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · Index.commodity (cognitive 56) · ×1
  • Index.commodity (cognitive 56) app/Controller/User/Api/Index.php:67 — 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.
D2 · Cognitive Complexity · Config.putManyLocked (cognitive 54) · ×1
  • 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.
D2 · Cognitive Complexity · Group.validatedSaveMap (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · PriceTemplate.applyToConfig (cognitive 51) · ×1
  • 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.
D2 · Cognitive Complexity · openFilters (cognitive 51) · ×1
  • 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.
D2 · Cognitive Complexity · Coupon.couponExportQuery (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · overlay.setupSheetDrag (cognitive 49) · ×1
  • overlay.setupSheetDrag (cognitive 49) assets/admin/js/mobile/overlay.js:699 — overlay.setupSheetDrag has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 19, ternaries 4, error handling 2 (nesting depth added 1). Of this number, 45 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · Query.get (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · measureCharInner (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).attach.openMenu (cognitive 48) · ×1
  • (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.
D2 · Cognitive Complexity · codemirror.markText (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · Shared.AdjustmentPrice (cognitive 47) · ×1
  • Shared.AdjustmentPrice (cognitive 47) app/Service/Bind/Shared.php:711 — 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.
D2 · Cognitive Complexity · moveVisually (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · CommodityGroup.mobileCommodityTree (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · Currency.convertCommodityConfigs (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · renderTreeContext (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · _Auth (cognitive 46) · ×1
  • _Auth (cognitive 46) assets/admin/controller/store/home.js:498 — _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 683, 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.
D2 · Cognitive Complexity · (anonymous).statement (cognitive 46) · ×1
  • (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.
D2 · Cognitive Complexity · Util.redactDebugValue (cognitive 45) · ×1
  • Util.redactDebugValue (cognitive 45) assets/common/js/util.js:112 — Util.redactDebugValue has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 16, ternaries 6 (9 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 158, 123, 210, …). 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").statement (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.onScrollWheel (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · modal (cognitive 44) · ×1
  • modal (cognitive 44) assets/admin/controller/trade/commodity.js:123 — 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 523, 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.
D2 · Cognitive Complexity · codemirror.locateNodeInLineView (cognitive 43) · ×1
  • codemirror.locateNodeInLineView (cognitive 43) assets/static/codemirror/lib/codemirror.js:9280 — codemirror.locateNodeInLineView has cognitive complexity 43 (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.
D2 · Cognitive Complexity · click (cognitive 43) · ×1
  • click (cognitive 43) assets/admin/controller/shared/store.js:1437 — 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 1445, a function literal at line 1478, a function literal at line 1507, …). 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.
D2 · Cognitive Complexity · brace-fold.CodeMirror.registerHelper("fold","brace") (cognitive 42) · ×1
  • 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). To reduce it, split the body into named stages: move each independent 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 · runImportTask (cognitive 42) · ×1
  • runImportTask (cognitive 42) assets/admin/controller/shared/store.js:1030 — 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 1046, 1115, 1127, …). 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.
D2 · Cognitive Complexity · (anonymous).indent (cognitive 42) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous) (cognitive 42) · ×1
  • (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.
D2 · Cognitive Complexity · Order.orderExportQuery (cognitive 41) · ×1
  • Order.orderExportQuery (cognitive 41) app/Controller/Admin/Api/Order.php:67 — 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.
D2 · Cognitive Complexity · Store.remoteWidget (cognitive 41) · ×1
  • 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.
D2 · Cognitive Complexity · KTScroll · ×1
  • KTScroll::_getAutoHeight (cognitive 41) assets/admin/js/menu.js:2896 — 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.
D2 · Cognitive Complexity · api.confirmPayDelete (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · xml.CodeMirror.defineMode("xml").indent (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.commodityDeleteImpact (cognitive 40) · ×1
  • Commodity.commodityDeleteImpact (cognitive 40) app/Controller/Admin/Api/Commodity.php:140 — 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 40) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).indent (cognitive 40) · ×1
  • (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.
D2 · Cognitive Complexity · workflows.renderPageActions (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").findFatArrow (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · Order.calcAmount (cognitive 39) · ×1
  • Order.calcAmount (cognitive 39) app/Service/Bind/Order.php:75 — 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.
D2 · Cognitive Complexity · clear (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).findFatArrow (cognitive 39) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous) (cognitive 39) · ×1
  • (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.
D2 · Cognitive Complexity · comment-fold.CodeMirror.registerGlobalHelper("fold","comment") (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · User.theme (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · nodeAndOffsetInLineMap (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · invalidFormField (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.renderReferenceCard (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · Coupon.save (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · Category.save (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · Plugin.hook (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · applyTextInput (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · openComposer (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · _Bill (cognitive 37) · ×1
  • _Bill (cognitive 37) assets/admin/controller/store/home.js:809 — _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 862, 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.
D2 · Cognitive Complexity · Card.save (cognitive 36) · ×1
  • Card.save (cognitive 36) app/Controller/Admin/Api/Card.php:334 — Card.save has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Authentication.register (cognitive 36) · ×1
  • Authentication.register (cognitive 36) app/Controller/User/Api/Authentication.php:45 — Authentication.register has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (25 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.
D2 · Cognitive Complexity · Index.card (cognitive 36) · ×1
  • Index.card (cognitive 36) app/Controller/User/Api/Index.php:292 — Index.card has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4 (9 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · Shop.substationPriceIncrease (cognitive 36) · ×1
  • Shop.substationPriceIncrease (cognitive 36) app/Service/Bind/Shop.php:374 — Shop.substationPriceIncrease has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 10 (15 pts), ternaries 1 (nesting depth added 19). 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.
D2 · Cognitive Complexity · registerEventHandlers (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · Category.safeCategoryDeleteImpact (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · RechargeOrder.exportQuery (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · Message.save (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · initMessageCenter (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · makeChangeFromHistory (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · onDrop (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.regChange (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.indentLine (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.addEditorMethods (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · css.CodeMirror.defineMode("css") (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · glass.refreshMessageCenter (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · Card.save (cognitive 34) · ×1
  • Card.save (cognitive 34) app/Controller/User/Api/Card.php:75 — Card.save has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 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.
D2 · Cognitive Complexity · App.update (cognitive 34) · ×1
  • App.update (cognitive 34) app/Service/Bind/App.php:363 — 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.
D2 · Cognitive Complexity · Currency.convertIniMoney (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · Image.createThumbnail (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · Shop.getCategory (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · buildLineContent (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · coordsCharInner (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · endOfLine (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · syncSettingsNavigation (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · menu.KTDrawer (cognitive 33) · ×1
  • menu.KTDrawer (cognitive 33) assets/admin/js/menu.js: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 literals inside it that branch (lines 3451, 3400, 3322, …). 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.
D2 · Cognitive Complexity · Manage.set (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · Order.getCost (cognitive 33) · ×1
  • Order.getCost (cognitive 33) app/Service/Bind/Order.php:329 — Order.getCost has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedCurrency.config (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · flushReadyQueue (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · renderRelated (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · pollContent (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · renderSelectionDock (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).inText (cognitive 33) · ×1
  • (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.
D2 · Cognitive Complexity · menu.KTMenu.initGlobalHandlers (cognitive 32) · ×1
  • menu.KTMenu.initGlobalHandlers (cognitive 32) assets/admin/js/menu.js: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). Most of this is not in the body itself: 0 of the 32 points are its own statements 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.
D2 · Cognitive Complexity · overlay.focusInvalid (cognitive 32) · ×1
  • overlay.focusInvalid (cognitive 32) assets/admin/js/mobile/overlay.js: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 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.
D2 · Cognitive Complexity · Form.getData (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · css.CodeMirror.defineMode("css").tokenBase (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · Order.orderSuccess (cognitive 32) · ×1
  • Order.orderSuccess (cognitive 32) app/Service/Bind/Order.php:1070 — Order.orderSuccess has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").indent (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · Email.sendCaptcha (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · onContextMenu (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · #setField (cognitive 31) · ×1
  • #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.
D2 · Cognitive Complexity · (anonymous).attach.onKey (cognitive 31) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).tokenBase (cognitive 31) · ×1
  • (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.
D2 · Cognitive Complexity · Install.html.renderDbResult (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · order.$(".btn-app-export").off().on() (cognitive 30) · ×1
  • order.$(".btn-app-export").off().on() (cognitive 30) assets/admin/controller/trade/order.js:478 — 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). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 520, 563). 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.
D2 · Cognitive Complexity · codemirror.updateHeightsInViewport (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.domTextBetween (cognitive 30) · ×1
  • codemirror.domTextBetween (cognitive 30) assets/static/codemirror/lib/codemirror.js:9208 — codemirror.domTextBetween has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · xml.CodeMirror.defineMode("xml").inText (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Plugin.getPlugins (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Query.save (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Shop.getItem (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · UploadPurge.stageForDeletion (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · refreshMessageCenter · ×1
  • 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.
D2 · Cognitive Complexity · previewMessage (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · presentPopup (cognitive 30) · ×1
  • presentPopup (cognitive 30) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · overlay.firstInvalidField (cognitive 29) · ×1
  • overlay.firstInvalidField (cognitive 29) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · passkey.add (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · App.plugins (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · Category.status (cognitive 29) · ×1
  • Category.status (cognitive 29) app/Controller/Admin/Api/Category.php:706 — 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.
D2 · Cognitive Complexity · Pay.getPluginInfo (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · post (cognitive 29) · ×1
  • post (cognitive 29) assets/common/js/util.js:241 — post has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 8 (10 pts), boolean chains 3, error handling 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · conflictingCollapsedRange (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · #getSelectionRowState (cognitive 29) · ×1
  • #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.
D2 · Cognitive Complexity · addWidget (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · click (cognitive 29) · ×1
  • click (cognitive 29) assets/admin/controller/shared/store.js:1561 — 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 1637, (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.
D2 · Cognitive Complexity · configureShell (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · priceTemplate.applyModal (cognitive 28) · ×1
  • priceTemplate.applyModal (cognitive 28) assets/admin/controller/shared/priceTemplate.js:194 — priceTemplate.applyModal has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 11, if/else 5 (nesting depth added 1). Most of this is not in the body itself: 0 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 240, 260, 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.
D2 · Cognitive Complexity · recharge.order.$(".btn-app-export").off().on() (cognitive 28) · ×1
  • 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). Most of this is not in the body itself: 0 of the 28 points are its own statements 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.
D2 · Cognitive Complexity · workflows.markSemanticPage (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · App.getUpdates (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · Message.sendEmailBatch (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · Shared.syncRemoteItem (cognitive 28) · ×1
  • Shared.syncRemoteItem (cognitive 28) app/Service/Bind/Shared.php:852 — Shared.syncRemoteItem has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 5 (7 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · Lang.scanExtensionPacks (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 28) · ×1
  • (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.
D2 · Cognitive Complexity · syncContextNavigation (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · done (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · confirmPayDelete · ×1
  • 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.
D2 · Cognitive Complexity · card.$(".btn-app-export").off().on() (cognitive 27) · ×1
  • card.$(".btn-app-export").off().on() (cognitive 27) assets/admin/controller/trade/card.js:591 — 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). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 636, 663). 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.
D2 · Cognitive Complexity · fallback.treeMetadata (cognitive 27) · ×1
  • fallback.treeMetadata (cognitive 27) assets/admin/js/mobile/fallback.js:2547 — fallback.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 5 function literals inside it that branch (lines 2556, 2587, 2582, …). 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.
D2 · Cognitive Complexity · codemirror.removeReadOnlyRanges (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · jquery.pjax.onPjaxPopstate (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · App.updatePlugin (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · Ticket.delete (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · bind (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · markedSpansAfter (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · init (cognitive 27) · ×1
  • 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). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · showPrimarySelection (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · click (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · modal (cognitive 27) · ×1
  • modal (cognitive 27) assets/admin/controller/pay/api.js:496 — modal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 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 27 points are its own statements and the rest belongs to 8 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.
D2 · Cognitive Complexity · index.renderChart (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.detailContent (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.copyHistoryArray (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · message.renderCartoonMobile (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Card.cardExportQuery (cognitive 26) · ×1
  • Card.cardExportQuery (cognitive 26) app/Controller/Admin/Api/Card.php:145 — 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.
D2 · Cognitive Complexity · Config.consumeTestSendQuota (cognitive 26) · ×1
  • Config.consumeTestSendQuota (cognitive 26) REDACTED:579 — 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.
D2 · Cognitive Complexity · CommodityOrder.data (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Currency.convertAll (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Image.downloadRemoteImage (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · GridTracks.track (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · KTUtil.slide (cognitive 26) · ×1
  • KTUtil.slide (cognitive 26) assets/admin/js/menu.js: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.
D2 · Cognitive Complexity · sanitizeHtml (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · render (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · runMode (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · highlightWorker (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · renderCardSubtitle (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · validateCompose (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Form.disposeControl (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Form.destroy (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Loading.show (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.alignHorizontally (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").expressionInner (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Message.siteBaseUrl (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Ticket.visibleCommodityQuery (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Shadow.layer (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · updateLineGutter (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · scrollPosIntoView (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · patchDisplay (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · locateNodeInLineView · ×1
  • 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.
D2 · Cognitive Complexity · #openColumnDetail (cognitive 25) · ×1
  • #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.
D2 · Cognitive Complexity · mobileAccountSubmit (cognitive 25) · ×1
  • 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. Most of this is not in the body itself: 0 of the 25 points are its own statements 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.
D2 · Cognitive Complexity · mobileDeliverySubmit (cognitive 25) · ×1
  • mobileDeliverySubmit (cognitive 25) assets/admin/controller/trade/order.js:63 — mobileDeliverySubmit has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 4, other 3. Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 66, a function literal at line 104, (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.
D2 · Cognitive Complexity · sanitizePluginDisplayHtml (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · _Save (cognitive 25) · ×1
  • _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). Most of this is not in the body itself: 0 of the 25 points are its own statements 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.
D2 · Cognitive Complexity · (anonymous).expressionInner (cognitive 25) · ×1
  • (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.
D2 · Cognitive Complexity · set.saveSettings (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · card.uploadCard (cognitive 24) · ×1
  • card.uploadCard (cognitive 24) assets/admin/controller/trade/card.js:101 — card.uploadCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 130, 166, 204, …). 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.
D2 · Cognitive Complexity · Config.security (cognitive 24) · ×1
  • Config.security (cognitive 24) REDACTED:714 — 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.
D2 · Cognitive Complexity · Store.sharedDomain (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · Cash.submit (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · Coupon.save (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · File.copyDirectory (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · bidiSimplify (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · defineOptions (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · menuContent (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · lifecycle.mount (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · navigation.handleClick (cognitive 23) · ×1
  • 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 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.
D2 · Cognitive Complexity · codemirror.normalizeKeyMap (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.onMouseDown (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").maybeoperatorNoComma (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Card.edit (cognitive 23) · ×1
  • Card.edit (cognitive 23) app/Controller/Admin/Api/Card.php:448 — Card.edit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.save (cognitive 23) · ×1
  • Store.save (cognitive 23) app/Controller/Admin/Api/Store.php:889 — Store.save has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, ternaries 3, error handling 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Commodity.inventory (cognitive 23) · ×1
  • Commodity.inventory (cognitive 23) app/Controller/Shared/Commodity.php:294 — 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.
D2 · Cognitive Complexity · Master.setCommodity (cognitive 23) · ×1
  • Master.setCommodity (cognitive 23) app/Controller/User/Api/Master.php:196 — 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.
D2 · Cognitive Complexity · Pay.savePluginConfig (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Client.headerIpCandidates (cognitive 23) · ×1
  • Client.headerIpCandidates (cognitive 23) app/Util/Client.php:339 — Client.headerIpCandidates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 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.
D2 · Cognitive Complexity · Csp.extraSources (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Lang.mapTag (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Lang.transObjectList (cognitive 23) · ×1
  • Lang.transObjectList (cognitive 23) kernel/Util/Lang.php:1051 — 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.
D2 · Cognitive Complexity · sanitizeRichHtml (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · markedSpansBefore (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · calculateScrollPos (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · endOperation_finish (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · CodeMirror (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · domTextBetween · ×1
  • domTextBetween::walk (cognitive 23) assets/static/codemirror/lib/codemirror.js:9224 — 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.
D2 · Cognitive Complexity · poll (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · definitionValue (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · cardOfferContent (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).attach (cognitive 23) · ×1
  • (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.
D2 · Cognitive Complexity · renderChannels (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).maybeoperatorNoComma (cognitive 23) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).atBlock (cognitive 23) · ×1
  • (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.
D2 · Cognitive Complexity · findMatchingClose (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ticket.sanitizeRichHtml (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.cardActionIcon (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · workflows.mount (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.triggerElectric (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · xml-fold.findMatchingOpen (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · File.data (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Store.remoteItemTree (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.inventoryState (cognitive 22) · ×1
  • Commodity.inventoryState (cognitive 22) app/Controller/Shared/Commodity.php:236 — Commodity.inventoryState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Order.callbackTest (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Bill.create (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Message.cleanContent (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Shop.getItemStock (cognitive 22) · ×1
  • Shop.getItemStock (cognitive 22) app/Service/Bind/Shop.php:269 — Shop.getItemStock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (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.
D2 · Cognitive Complexity · Ticket.cleanContent (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · CategoryTree.forAdmin (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · armAutofill (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · findPosH · ×1
  • 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.
D2 · Cognitive Complexity · change (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · index.confirmFileDelete (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · store.modal (cognitive 21) · ×1
  • store.modal (cognitive 21) assets/admin/controller/shared/store.js:1272 — store.modal has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1293, 1287, 1299, …). 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.
D2 · Cognitive Complexity · coupon.$(".btn-app-export").off().on() (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · shell.handleClick (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · workflows.discoverActions (cognitive 21) · ×1
  • 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. Most of this is not in the body itself: 0 of the 21 points are its own statements 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.
D2 · Cognitive Complexity · Commodity.data (cognitive 21) · ×1
  • Commodity.data (cognitive 21) app/Controller/Admin/Api/Commodity.php:296 — 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.
D2 · Cognitive Complexity · Config.emailFailureMessage (cognitive 21) · ×1
  • Config.emailFailureMessage (cognitive 21) REDACTED:1338 — 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.
D2 · Cognitive Complexity · Pay.paymentDeleteImpact (cognitive 21) · ×1
  • Pay.paymentDeleteImpact (cognitive 21) app/Controller/Admin/Api/Pay.php:289 — 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.
D2 · Cognitive Complexity · PriceTemplate.computePrice (cognitive 21) · ×1
  • PriceTemplate.computePrice (cognitive 21) app/Controller/Admin/Api/PriceTemplate.php:297 — 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.
D2 · Cognitive Complexity · Config.index (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Plugin.wikiRes (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Authentication.password (cognitive 21) · ×1
  • Authentication.password (cognitive 21) app/Controller/User/Api/Authentication.php:536 — Authentication.password has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Business.saveConfig (cognitive 21) · ×1
  • Business.saveConfig (cognitive 21) app/Controller/User/Api/Business.php:110 — Business.saveConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 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.
D2 · Cognitive Complexity · CommodityLang.widget (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · PluginPacker.pack (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · UploadPurge.inspectUploadPath (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ViewSafe.walk (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Di.inject (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Plugin.runHookState (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Tokens.split (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · sanitizeInlineHtml (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · addChangeToHistory (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · api.showTestResult (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · menu.KTScrolltop (cognitive 20) · ×1
  • menu.KTScrolltop (cognitive 20) assets/admin/js/menu.js: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 literals inside it that branch (lines 3180, 3158, 3118). 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.
D2 · Cognitive Complexity · overlay.closeTransientInput (cognitive 20) · ×1
  • overlay.closeTransientInput (cognitive 20) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · editorv2.register.destroy (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.makeChangeSingleDocInEditor (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").parseJS (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.reorder (cognitive 20) · ×1
  • Commodity.reorder (cognitive 20) app/Controller/Admin/Api/Commodity.php:701 — 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.
D2 · Cognitive Complexity · User.changeAccountBalance (cognitive 20) · ×1
  • User.changeAccountBalance (cognitive 20) app/Controller/Admin/Api/User.php:279 — 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.
D2 · Cognitive Complexity · Currency.assertConvertNoOverflow (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · Waf.wafPost (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · initTheme (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · hideDropdowns (cognitive 20) · ×1
  • hideDropdowns (cognitive 20) assets/admin/js/menu.js: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.
D2 · Cognitive Complexity · normalizeSelection (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · find (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · configureMouse (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · keepPageFieldVisible (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).attach.treeHtml (cognitive 20) · ×1
  • (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.
D2 · Cognitive Complexity · modal (cognitive 20) · ×1
  • 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. Most of this is not in the body itself: 0 of the 20 points are its own statements 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.
D2 · Cognitive Complexity · (anonymous).objprop (cognitive 20) · ×1
  • (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.
D2 · Cognitive Complexity · register.destroy (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · store.fitImportPopupHeight (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · store.importTaskLogText (cognitive 19) · ×1
  • store.importTaskLogText (cognitive 19) assets/admin/controller/shared/store.js:821 — 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 823). 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.
D2 · Cognitive Complexity · commodity.confirmCommodityDelete (cognitive 19) · ×1
  • commodity.confirmCommodityDelete (cognitive 19) assets/admin/controller/trade/commodity.js:73 — 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 78, 119, 120). 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.
D2 · Cognitive Complexity · coupon.confirmCouponDelete (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.renderLedgerCard (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · overlay.api.closeAll (cognitive 19) · ×1
  • overlay.api.closeAll (cognitive 19) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · Form.validator (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · editorv2.register.alignLine (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.getBidiPartAt (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.mergeOldSpans (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.TextareaInput.init (cognitive 19) · ×1
  • 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: 9 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 9399, 9365, 9370, …). 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.
D2 · Cognitive Complexity · foldcode.doFold (cognitive 19) · ×1
  • 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). To reduce it, split the body into named stages: move each independent 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 · card.uploadCard (cognitive 19) · ×1
  • 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). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · RechargeOrder.verifyExportToken (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Store.assertRemoteAssetDestination (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.item (cognitive 19) · ×1
  • Commodity.item (cognitive 19) app/Controller/Shared/Commodity.php:177 — 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.
D2 · Cognitive Complexity · Mcp.pluginConfigSet (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Ticket.normalizeTicket (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Client.normalizeTrustedProxyConfig (cognitive 19) · ×1
  • Client.normalizeTrustedProxyConfig (cognitive 19) app/Util/Client.php:178 — 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.
D2 · Cognitive Complexity · Helper.isInstall (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · LinkDomainGuard.allowList (cognitive 19) · ×1
  • LinkDomainGuard.allowList (cognitive 19) app/Util/LinkDomainGuard.php:68 — 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.
D2 · Cognitive Complexity · Lang.importPackFile (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · redactDebugValue · ×1
  • 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.
D2 · Cognitive Complexity · KTUtil.getResponsiveValue (cognitive 19) · ×1
  • KTUtil.getResponsiveValue (cognitive 19) assets/admin/js/menu.js: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.
D2 · Cognitive Complexity · updateSummary (cognitive 19) · ×1
  • updateSummary (cognitive 19) assets/user/controller/user/recharge.js:29 — updateSummary has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 6, 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.
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.
D2 · Cognitive Complexity · onKeyDown (cognitive 19) · ×1
  • 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 · (anonymous).attach.groupBlocks (cognitive 19) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous) (cognitive 19) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).attach.bindHost (cognitive 19) · ×1
  • (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). Most of this is not in the body itself: 0 of the 19 points are its own statements 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.
D2 · Cognitive Complexity · (anonymous).confirmDelete (cognitive 19) · ×1
  • (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.
D2 · Cognitive Complexity · renderConfigForm (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).parseJS (cognitive 19) · ×1
  • (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.
D2 · Cognitive Complexity · register.alignLine (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Install.html.renderDb (cognitive 18) · ×1
  • 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). Most of this is not in the body itself: 0 of the 18 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.
D2 · Cognitive Complexity · commodity.uploadCard (cognitive 18) · ×1
  • commodity.uploadCard (cognitive 18) assets/admin/controller/trade/commodity.js:745 — commodity.uploadCard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 3 (7 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 773, 809, 847, …). 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.
D2 · Cognitive Complexity · fallback.relativeTimeTimestamp (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · workflows.visible (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · workflows.releasePageHistoryGuard (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · workflows.addControl (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.prepareSelection (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.makeChange (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · foldgutter.updateFoldInfo (cognitive 18) · ×1
  • foldgutter.updateFoldInfo (cognitive 18) assets/static/codemirror/addon/fold/foldgutter.js: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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").objprop (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · jquery.pjax.pjax (cognitive 18) · ×1
  • 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). 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.
D2 · Cognitive Complexity · coupon.createCoupon (cognitive 18) · ×1
  • 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). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · Order.verifyOrderExportToken (cognitive 18) · ×1
  • Order.verifyOrderExportToken (cognitive 18) app/Controller/Admin/Api/Order.php:273 — 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.
D2 · Cognitive Complexity · Install.importLanguagePacks (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.getItems (cognitive 18) · ×1
  • Commodity.getItems (cognitive 18) app/Controller/Shared/Commodity.php:45 — 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.
D2 · Cognitive Complexity · Ticket.applyFilters (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Lang.collect (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Gradient.shape (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · viewCuttingPoint (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · update (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · updateDisplayIfNeeded (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · fromTextArea (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · #mobileDisplayValue (cognitive 18) · ×1
  • #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.
D2 · Cognitive Complexity · copyConfiguredField (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · updateTreeCollapsePresentation (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).attach (cognitive 18) · ×1
  • (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.
D2 · Cognitive Complexity · change (cognitive 18) · ×1
  • change (cognitive 18) assets/admin/controller/trade/card.js:474 — 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 481, 478). 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.
D2 · Cognitive Complexity · renderDelta (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).top (cognitive 18) · ×1
  • (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.
D2 · Cognitive Complexity · lang.langCard (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · wiki.mobile.destroy (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.cardSearchText (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.lineIsHidden (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.postUpdateDisplay (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.rebaseHistArray (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · codemirror.leftButtonStartDrag (cognitive 17) · ×1
  • 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 literals inside it that branch (lines 7425, 7447). 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.
D2 · Cognitive Complexity · codemirror.domToPos (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · javascript.CodeMirror.defineMode("javascript").classBody (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · commodity.safeItem (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ticket.create.initRemoteSelect (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Category.verifyCategoryDeleteToken (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Store.remoteItem (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · User.del (cognitive 17) · ×1
  • User.del (cognitive 17) app/Controller/Admin/Api/User.php:363 — 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.
D2 · Cognitive Complexity · Plugin.wiki (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ManageSSO.login (cognitive 17) · ×1
  • ManageSSO.login (cognitive 17) app/Service/Bind/ManageSSO.php:39 — 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.
D2 · Cognitive Complexity · Message.validateImage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Recharge.trade (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Ticket.validateImage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · FileCache.clearCache (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Ini.toArray (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · IgnoreStyleTagFilter.cssHasActiveContent (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · KTEventHandler._triggerEvent (cognitive 17) · ×1
  • KTEventHandler._triggerEvent (cognitive 17) assets/admin/js/menu.js: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 · (anonymous) (cognitive 17) · ×1
  • (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.
D2 · Cognitive Complexity · onKeyPress (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · updateViewportVars (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · openSheet (cognitive 17) · ×1
  • openSheet (cognitive 17) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · openActions (cognitive 17) · ×1
  • openActions (cognitive 17) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · controlAvailable (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · renderTreeToggle (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).classBody (cognitive 17) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).block (cognitive 17) · ×1
  • (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.
D2 · Cognitive Complexity · other.$("#currency-convert-btn").off().on() (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · plugin.$(".plugin-restart").click() (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · home.requestPurchase (cognitive 16) · ×1
  • 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 literals inside it that branch (lines 299, 289, 310, …). 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.
D2 · Cognitive Complexity · fallback.configureShellSearch (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.openRecordSheet (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · fallback.rebuild (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · overlay.confirmButtonIcon (cognitive 16) · ×1
  • overlay.confirmButtonIcon (cognitive 16) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · overlay.finalize (cognitive 16) · ×1
  • overlay.finalize (cognitive 16) assets/admin/js/mobile/overlay.js: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 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.
D2 · Cognitive Complexity · Table.setColumns (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Table.setSearch (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Util.fundVerify (cognitive 16) · ×1
  • Util.fundVerify (cognitive 16) assets/common/js/util.js:312 — Util.fundVerify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 2. 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 literals inside it that branch (lines 371, 389, 416, …). 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.
D2 · Cognitive Complexity · codemirror.updateDoc (cognitive 16) · ×1
  • 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). To reduce it, split the body into named stages: move each independent 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 · ticket.create.updateSummary (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ticket.create.submitTicket (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Cash.decide (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Config.configHttpUrl (cognitive 16) · ×1
  • Config.configHttpUrl (cognitive 16) REDACTED:408 — 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.
D2 · Cognitive Complexity · File.structuredReferenceImpact (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Plugin.setConfig (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Commodity.draftCard (cognitive 16) · ×1
  • Commodity.draftCard (cognitive 16) app/Controller/Shared/Commodity.php:414 — Commodity.draftCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (3 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.
D2 · Cognitive Complexity · Authentication.totp (cognitive 16) · ×1
  • Authentication.totp (cognitive 16) app/Controller/User/Api/Authentication.php:398 — 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.
D2 · Cognitive Complexity · Promote.quote (cognitive 16) · ×1
  • Promote.quote (cognitive 16) app/Controller/User/Api/Promote.php:163 — 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.
D2 · Cognitive Complexity · Security.personal (cognitive 16) · ×1
  • Security.personal (cognitive 16) app/Controller/User/Api/Security.php:49 — Security.personal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, 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.
D2 · Cognitive Complexity · Save.setMap (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Message.recipientScope (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Pay.redactLogSecrets (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Shared.unwrapRemoteItem (cognitive 16) · ×1
  • Shared.unwrapRemoteItem (cognitive 16) app/Service/Bind/Shared.php:278 — 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.
D2 · Cognitive Complexity · Lang.rebuild (cognitive 16) · ×1
  • Lang.rebuild (cognitive 16) kernel/Util/Lang.php:924 — 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.
D2 · Cognitive Complexity · commoditys (cognitive 16) · ×1
  • commoditys (cognitive 16) assets/static/acg.js:464 — 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 468, 473). 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.
D2 · Cognitive Complexity · openMessage (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · transposeChars (cognitive 16) · ×1
  • 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). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs 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.
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.
D2 · Cognitive Complexity · addAttribute (cognitive 16) · ×1
  • 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 · presentPopup · ×1
  • presentPopup::success (cognitive 16) assets/admin/js/mobile/overlay.js: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.
D2 · Cognitive Complexity · alignReferenceCards (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · compactCardDefinitions (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · cardSubtitle (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · applyRecipePresentation (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · click (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous).attach.nodesHtml (cognitive 16) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).attach.dragPointerMove (cognitive 16) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).attach.endDrag (cognitive 16) · ×1
  • (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.
D2 · Cognitive Complexity · (anonymous).attach.openActions (cognitive 16) · ×1
  • (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.
D2 · Cognitive Complexity · importItemRequest (cognitive 16) · ×1
  • importItemRequest (cognitive 16) assets/admin/controller/shared/store.js:949 — importItemRequest has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, other 2, ternaries 2, error handling 1. Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 965, 949, 998). 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.
D2 · Cognitive Complexity · renderFlow (cognitive 16) · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 30 shared lines) · ×1
  • Near-duplicate member family (5 members, 30 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:235-277 | app/Util/Schema.php:286-328 — These 5 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member pair (82 shared lines) · ×1
  • Near-duplicate member pair (82 shared lines) app/Controller/Admin/Api/Card.php:336 — app/Controller/Admin/Api/Card.php:336-441 | app/Controller/User/Api/Card.php:77-180 — These two members are variants of one another: 82 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 · Near-duplicate member pair (77 shared lines) · ×1
  • Near-duplicate member pair (77 shared lines) app/Controller/Admin/Api/BusinessLevel.php:42 — app/Controller/Admin/Api/BusinessLevel.php:42-150 | app/Controller/Admin/Api/Group.php:36-122 — These two members are variants of one another: 77 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 · Near-duplicate member pair (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared 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 variants of one another: 48 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 · Near-duplicate member pair (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) app/Controller/Admin/Api/Order.php:572 — app/Controller/Admin/Api/Order.php:572-619 | app/Controller/Admin/Api/RechargeOrder.php:478-525 — These two members are variants of one another: 41 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 · Near-duplicate member pair (24 shared lines) · ×1
  • Near-duplicate member pair (24 shared lines) app/Controller/Admin/Api/Upload.php:45 — app/Controller/Admin/Api/Upload.php:45-85 | app/Controller/User/Api/Upload.php:40-89 — These two members are variants of one another: 24 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 · Edited copy of a member (33 corresponding lines) · ×1
  • 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.
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:160 — app/Controller/Admin/Api/BusinessLevel.php:160-189 | app/Controller/Admin/Api/Card.php:39-64 | app/Controller/Admin/Api/Category.php:45-71 | app/Controller/Admin/Api/Commodity.php:52-77 | app/Controller/Admin/Api/Commodity.php:142-278 | 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 · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) app/Controller/Admin/Api/BusinessLevel.php:64 — app/Controller/Admin/Api/BusinessLevel.php:64-96 | app/Controller/Admin/Api/Group.php:58-90 — before extracting anything, compare `app/Controller/Admin/Api/BusinessLevel.php` and `app/Controller/Admin/Api/Group.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 98 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:64` 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.
D4 · Code Duplication · Duplicated block (22–33 lines × 2) · ×1
  • Duplicated block (22–33 lines × 2) app/Controller/Admin/Api/Order.php:93 — app/Controller/Admin/Api/Order.php:93-125 | 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 14 separate duplicated blocks between them, totalling at least 245 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:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) app/Controller/Admin/Api/Card.php:413 — app/Controller/Admin/Api/Card.php:413-439 | app/Controller/User/Api/Card.php:154-179 — before extracting anything, compare `app/Controller/Admin/Api/Card.php` and `app/Controller/User/Api/Card.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 95 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/User/Api/Card.php:154` 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.
D4 · Code Duplication · Duplicated block (14–27 lines × 2) · ×1
  • Duplicated block (14–27 lines × 2) app/Controller/Admin/Api/Order.php:548 — app/Controller/Admin/Api/Order.php:548-561 | app/Controller/Admin/Api/RechargeOrder.php:327-353 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 245 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:548` 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 6) · ×1
  • Duplicated block (22–23 lines × 6) app/Controller/Admin/Api/BusinessLevel.php:160 — app/Controller/Admin/Api/BusinessLevel.php:160-182 | app/Controller/Admin/Api/Card.php:39-60 | app/Controller/Admin/Api/Category.php:45-67 | app/Controller/Admin/Api/Commodity.php:52-73 | 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:184` 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–22 lines × 2) · ×1
  • Duplicated block (9–22 lines × 2) app/Controller/Admin/Api/Order.php:504 — app/Controller/Admin/Api/Order.php:504-512 | app/Controller/Admin/Api/RechargeOrder.php:307-328 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 245 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:504` 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.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) app/Service/Bind/Order.php:950 — app/Service/Bind/Order.php:950-968 | app/Service/Bind/Recharge.php:112-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/Service/Bind/Order.php:950` 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (18–20 lines × 3) · ×1
  • 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:280-298 | 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:280` 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.
D4 · Code Duplication · Duplicated block (7–20 lines × 2) · ×1
  • Duplicated block (7–20 lines × 2) app/Controller/Admin/Api/Order.php:477 — app/Controller/Admin/Api/Order.php:477-483 | app/Controller/Admin/Api/RechargeOrder.php:305-324 — before extracting anything, compare `app/Controller/Admin/Api/Order.php` and `app/Controller/Admin/Api/RechargeOrder.php` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 245 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:477` 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.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) app/Util/Schema.php:64 — app/Util/Schema.php:64-82 | app/Util/Schema.php:131-149 | app/Util/Schema.php:182-200 | app/Util/Schema.php:235-253 | app/Util/Schema.php:286-304 — 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:64` 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) app/Controller/Shared/Commodity.php:446 — app/Controller/Shared/Commodity.php:446-462 | app/Controller/User/Api/Index.php:342-359 — 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:446` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–17 lines × 4) · ×1
  • Duplicated block (10–17 lines × 4) app/Controller/Admin/Api/Bill.php:33 — app/Controller/Admin/Api/Bill.php:33-42 | app/Controller/Admin/Api/Card.php:241-257 | 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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) app/Controller/Admin/Api/User.php:172 — app/Controller/Admin/Api/User.php:172-188 | app/Controller/User/Api/Business.php:42-57 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) app/Service/Bind/ManageSSO.php:95 — app/Service/Bind/ManageSSO.php:95-111 | app/Service/Bind/ManageSSO.php:148-164 — both copies are in the same file, so extract the 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:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • 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:252-268 | 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • 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:553-567 — 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 · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) app/Util/CallbackIpWhitelist.php:269 — app/Util/CallbackIpWhitelist.php:269-283 | app/Util/Client.php:405-418 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) app/Util/CallbackIpWhitelist.php:183 — app/Util/CallbackIpWhitelist.php:183-195 | app/Util/Client.php:320-333 — 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 7) · ×1
  • Duplicated block (10–11 lines × 7) app/Controller/Admin/Api/BusinessLevel.php:163 — app/Controller/Admin/Api/BusinessLevel.php:163-173 | app/Controller/Admin/Api/Card.php:42-52 | app/Controller/Admin/Api/Category.php:48-58 | app/Controller/Admin/Api/Commodity.php:55-65 | app/Controller/Admin/Api/Commodity.php:215-224 | 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:163` 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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • 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:267-277 | app/Util/Schema.php:318-328 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) app/Controller/Admin/Api/BusinessLevel.php:81 — app/Controller/Admin/Api/BusinessLevel.php:81-91 | app/Controller/Admin/Api/BusinessLevel.php:107-117 | app/Controller/Admin/Api/BusinessLevel.php:119-128 | 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 5 separate duplicated blocks between them, totalling at least 98 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:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–10 lines × 3) · ×1
  • 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:397-401 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) app/Controller/Admin/Api/BusinessLevel.php:167 — app/Controller/Admin/Api/BusinessLevel.php:167-175 | app/Controller/Admin/Api/Card.php:46-54 | app/Controller/Admin/Api/Category.php:52-60 | app/Controller/Admin/Api/Commodity.php:59-67 | 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:167` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) REDACTED:893 — REDACTED:893-901 | REDACTED:967-973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) app/Controller/User/Api/Authentication.php:198 — app/Controller/User/Api/Authentication.php:198-204 | app/Controller/User/Api/Authentication.php:223-229 | app/Controller/User/Api/Authentication.php:268-274 | app/Controller/User/Api/Authentication.php:294-300 — 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • 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:281-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.
D4 · Code Duplication · Duplicated block (5–6 lines × 4) · ×1
  • Duplicated block (5–6 lines × 4) app/Controller/User/Api/Security.php:330 — app/Controller/User/Api/Security.php:330-334 | app/Controller/User/Api/Security.php:366-371 | app/Controller/User/Api/Security.php:398-403 | app/Controller/User/Api/Security.php:449-454 — 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:330` 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • 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:242-246 | 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • 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.
P5 · DR & Backup · No DR/backup evidence · ×1
  • 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.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 130 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 (+124 more).
R10 · Code Duplication · Duplication concentrated across 10 sibling directories (56 clone groups) · ×1
  • Duplication concentrated across 10 sibling directories (56 clone groups) assets/admin/controller/config/plugin.js:296 — 56 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) — 43 of them are reported below, and 13 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 56 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 56 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 56 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (51 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (51 clone groups) assets/common/js/component/authtree.js:9 — 51 duplicated blocks under assets/ have copies in at least two of the sibling directories admin, common, static, user — 39 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 51 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 51 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 51 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (5 clone groups) assets/user/controller/dashboard/index.js:1 — 5 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, business, dashboard, security, user under assets/user/controller/. That concentration is one structural fact, not 5 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 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Wholesale file copy (432 identical lines × 2 files) · ×1
  • 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 (247 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (247 matched lines × 2 locations) assets/admin/controller/trade/card.js:132 — assets/admin/controller/trade/card.js:132 · assets/user/controller/business/card.js:43 — the two spans are one implementation copied and then locally edited — 1595 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 (79 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (65 lines × 2 locations) · ×1
  • Duplicated block (65 lines × 2 locations) assets/admin/controller/trade/order.js:525 — assets/admin/controller/trade/order.js:525 · 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.
R10 · Code Duplication · Wholesale file copy (62 identical lines × 2 files) · ×1
  • Wholesale file copy (62 identical lines × 2 files) assets/user/controller/dashboard/index.js:1 — assets/user/controller/dashboard/index.js:1 · assets/user/controller/user/purchase.record.js:1 — these 2 files are line-for-line copies of one another — 62 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 (60 lines × 2 locations) · ×1
  • Duplicated block (60 lines × 2 locations) assets/admin/controller/trade/commodity.js:233 — assets/admin/controller/trade/commodity.js:233 · 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.
R10 · Code Duplication · Duplicated block (58 lines × 2 locations) · ×1
  • Duplicated block (58 lines × 2 locations) assets/admin/controller/trade/commodity.js:775 — assets/admin/controller/trade/commodity.js:775 · 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 (47 lines × 2 locations) · ×1
  • Duplicated block (47 lines × 2 locations) assets/user/controller/business/business.js:153 — assets/user/controller/business/business.js:153 · assets/user/controller/business/business.js:279 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (45 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (41 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (41 lines × 4 locations) · ×1
  • Duplicated block (41 lines × 4 locations) assets/admin/controller/trade/card.js:192 — assets/admin/controller/trade/card.js:192 · assets/admin/controller/trade/commodity.js:835 · assets/user/controller/business/card.js:103 · assets/user/controller/business/commodity.js:426 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) assets/static/acg.js:915 — assets/static/acg.js:915 · assets/user/js/treasure.js:11 — the two spans are one implementation copied and then locally edited — 317 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 (35 lines × 2 locations) · ×1
  • 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:1117 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (32 lines × 3 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) assets/admin/js/mobile/recipes.js:1614 — assets/admin/js/mobile/recipes.js:1614 · assets/admin/js/mobile/recipes.js:1728 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (25 matched lines × 2 locations) assets/common/js/component/search.js:28 — assets/common/js/component/search.js:28 · assets/common/js/component/search.js:60 — the two spans are one implementation copied and then locally edited — 100 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function _docMouseMove (cyclomatic 132, cognitive 229) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function inlineNormal (cyclomatic 121, cognitive 180) · ×1
  • Complex function inlineNormal (cyclomatic 121, cognitive 180) assets/static/codemirror/mode/markdown/markdown.js: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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 116, cognitive 135) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 78, cognitive 74) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 69, cognitive 204) · ×1
  • Complex function (anonymous) (cyclomatic 69, cognitive 204) assets/static/acg.js:505 — (anonymous) has cyclomatic complexity 69 and cognitive complexity 204; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 63, cognitive 113) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function blockNormal (cyclomatic 62, cognitive 66) · ×1
  • Complex function blockNormal (cyclomatic 62, cognitive 66) assets/static/codemirror/mode/markdown/markdown.js: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.
R2 · Cyclomatic Complexity · Complex function moveNode (cyclomatic 57, cognitive 75) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function insertLineContent (cyclomatic 56, cognitive 147) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function render (cyclomatic 49, cognitive 50) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function popup (cyclomatic 44, cognitive 47) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function tokenBase (cyclomatic 43, cognitive 57) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 41, cognitive 40) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function statement (cyclomatic 40, cognitive 46) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function createForm (cyclomatic 40, cognitive 8) · ×1
  • Complex function createForm (cyclomatic 40, cognitive 8) REDACTED:1899 — createForm has cyclomatic complexity 40 and cognitive complexity 8; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 39, cognitive 60) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 39, cognitive 52) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function indent (cyclomatic 36, cognitive 42) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function renderRelated (cyclomatic 36, cognitive 33) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function done (cyclomatic 36, cognitive 28) · ×1
  • 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.
R3 · Large Files · Large Files · ×1
  • Large Files — 43 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: assets/static/codemirror/lib/codemirror.js (8882), REDACTED (3978), assets/admin/js/mobile/fallback.js (3083), assets/admin/js/menu.js (2923), REDACTED (1951), assets/admin/js/mobile/recipes.js (1906) (+37 more).
R4 · Test Coverage · Test Coverage · ×1
  • Test Coverage — 0% of 130 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
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.
Minor — 85 finding(s)
X7 · Silent fallback defaults · Silent fallback default in catch · ×36
  • Silent fallback default in catch REDACTED:555 — `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:273 — `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/Client.php:128 — `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:239 — `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:59 — `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:897 — `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:1094 — `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:1133 — `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.
  • Silent fallback default in catch assets/admin/controller/trade/order.js:22 — `parseWidget` 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/user/business.level.js:16 — `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/user/group.js:16 — `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/user/ticket.js:106 — `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.
  • + 11 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate assets/admin/controller/trade/order.js:552 — `!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/order.js:443 — `!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/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/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 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, assets/admin/js/mobile/overlay.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/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/store/developer.js:882 — `mobileAdminEnabled() && Boolean(row.web_site) && row.web_site !== '#'` appears character-identically in 2 files — assets/admin/controller/store/developer.js, assets/admin/controller/store/home.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:189 — `plugin?.update_content || i18n('该更新没有提供说明')` 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/trade/card.js:68 — `response.headers.get('content-type') || ''` appears character-identically in 4 files — assets/admin/controller/trade/card.js, assets/admin/controller/trade/coupon.js, 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/user/controller/user/message.js:30 — `row.title || source.title || i18n('未命名消息')` appears character-identically in 2 files — assets/user/controller/user/message.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/user/ticket.js:135 — `tag === 'A' && ['href', 'title'].includes(name)` 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/user/ticket.js:137 — `tag === 'CODE' && name === 'class' && /^language-[\w-]+$/.test(attribute.value)` 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/user/ticket.js:136 — `tag === 'IMG' && ['src', 'alt', 'title', 'width', 'height'].includes(name)` 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/auth/login.js:38 — `target.charAt(0) === "/" && target.charAt(1) !== "/" && target.indexOf("\\") === -1 && !/[\u0000-\u001f\u007f]/.test(target)` appears character-identically in 2 files — assets/admin/controller/auth/login.js, assets/user/controller/auth/login.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:7 — `text === '' || text === '-' || text.startsWith('0000-00-00')` 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/common/js/util.js:519 — `typeof done === 'function' && done(res.data)` appears character-identically in 3 files — assets/common/js/util.js, assets/static/modules/hex.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/common/js/util.js:513 — `typeof error === 'function' && error(res)` 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/controller/trade/category-tree.js:35 — `window.AdminMobile && typeof window.AdminMobile.isEnabled === 'function' && window.AdminMobile.isEnabled()` appears character-identically in 3 files — assets/admin/controller/trade/category-tree.js, assets/admin/controller/trade/drag-sort.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/manage/set.js:53 — `window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches` appears character-identically in 9 files — assets/admin/controller/manage/set.js, assets/admin/controller/trade/category-tree.js, assets/admin/controller/trade/drag-sort.js, assets/admin/js/mobile/overlay.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 app/Service/Bind/Message.php:1027 — `!$file || !isset($file['tmp_name'], $file['name'], $file['size'], $file['error']) || (int)$file['error'] !== UPLOAD_ERR_OK` appears character-identically in 2 files — app/Service/Bind/Message.php, app/Service/Bind/Ticket.php. 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 app/Controller/Admin/Api/BusinessLevel.php:64 — `!array_key_exists($field, $raw) || $raw[$field] === '' || $raw[$field] === null` appears character-identically in 2 files — app/Controller/Admin/Api/BusinessLevel.php, app/Controller/Admin/Api/Group.php. 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 app/Controller/Shared/Commodity.php:450 — `!empty($map['sku']) && is_array($map['sku'])` appears character-identically in 2 files — app/Controller/Shared/Commodity.php, app/Controller/User/Api/Index.php. 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 app/Controller/Admin/Api/BusinessLevel.php:140 — `!is_scalar($value) || !in_array((string)$value, ['0', '1'], true)` appears character-identically in 2 files — app/Controller/Admin/Api/BusinessLevel.php, app/Controller/Admin/Api/Store.php. 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 app/Controller/Admin/Api/Category.php:291 — `!is_string($token) || $token === '' || substr_count($token, '.') !== 1` appears character-identically in 3 files — app/Controller/Admin/Api/Category.php, app/Controller/Admin/Api/Order.php, app/Controller/Admin/Api/RechargeOrder.php. 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 app/Controller/User/Pay.php:28 — `!isset($_GET['_PARAMETER'][0]) || !isset($_GET['_PARAMETER'][1])` appears character-identically in 2 files — app/Controller/User/Pay.php, app/Controller/User/Recharge.php. 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×8
  • 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: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.
  • 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/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.
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift — README claims a '云更新' feature but the evidence shows no cloud-upgrade or versioning component — searched for: `cloud update`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, REDACTED); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
  • README/code drift — README claims an '应用商店' with plugins and templates but there is no app-store directory in the evidence — searched for: `app store`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, REDACTED); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — 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/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (123276 LoC, 459 module-visible types across 75 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
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.
P3 · Security & performance tooling · No SAST · ×1
  • 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 4981 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.
P6 · Release Hygiene · No changelog · ×1
  • 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.)
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected docker/nginx.conf:61 — No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — 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.)
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) 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.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Outdated · ×1
  • 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.

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-da60459d07e44e6f8910ef5eeebc53ca/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-da60459d07e44e6f8910ef5eeebc53ca/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .36artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .5artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .5artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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 30 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`, … (+25 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a106f1-0d72-79ae-93f3-89784b573ba4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md